Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Product listing with "add to cart" functionality

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-21-2002, 02:43 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default Product listing with "add to cart" functionality

Ability to make product listings with option to add to cart instead of making the customer click to product details before adding to their cart:

Code:
{* ADD TO CART by Josh Sowin | petsupplyonline.com *} <form name=orderform_{%product.index%} method=post action="cart.php?mode=add"> <input type=hidden name=amount value=1> <input type=hidden name=mode value=add> <input type=hidden name=productid value="{$products[product].productid}"> <input type=hidden name=cat value="{$smarty.get.cat}"> <input type=hidden name=page value="{$smarty.get.page}"> <a href="javascript: document.orderform_{%product.index%}.submit()"> {include file="buttons/add_to_cart.tpl"}</a> </form>

Thank Josh for such luvely template editing!

kudos!
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #2  
Old 10-09-2002, 07:01 PM
 
amanda amanda is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 41
 

Default

Hi

At the risk of sounding like an idiot, where exactly do we put that code?

Thanks
Amanda
Reply With Quote
  #3  
Old 10-09-2002, 07:19 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

[skin1]/customer/main/featured.tpl

__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #4  
Old 10-13-2002, 06:58 PM
 
Anonymous Anonymous is offline
 

eXpert
  
Join Date: Sep 2002
Posts: 222
 

Default

Ummm

I am having a bit of a problem with it... I am using the latest version x-cart.com and here is what I have changed in the file you said...

{* $Id: featured.tpl,v 1.13 2002/05/20 06:55:20 lucky Exp $ *}
{capture name=dialog}
{if $f_products ne ""}
{include file="customer/main/products.tpl" products=$f_products}
{else}
{$lng.txt_no_featured}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog extra="width=100%"}

{* ADD TO CART by Josh Sowin | petsupplyonline.com *}
<form name=orderform_{%product.index%} method=post action="cart.php?mode=add">
<input type=hidden name=amount value=1>
<input type=hidden name=mode value=add>
<input type=hidden name=productid value="{$products[product].productid}">
<input type=hidden name=cat value="{$smarty.get.cat}">
<input type=hidden name=page value="{$smarty.get.page}">
<a href="javascript: document.orderform_{%product.index%}.submit()">
{include file="buttons/add_to_cart.tpl"}</a>
</form>


But that didn't seem to work....

Thanks for your help.
Amanda
Reply With Quote
  #5  
Old 10-13-2002, 08:21 PM
 
Jeannie Jeannie is offline
 

eXpert
  
Join Date: Sep 2002
Location: Texas
Posts: 257
 

Default

I'm running v3.1
Just trying out different places and found that if you add Josh's code to customer/main/products.tpl you will have an Add to Cart button on the product listing. And if you click the product to view details you have another Add to Cart button.
Reply With Quote
  #6  
Old 10-13-2002, 10:24 PM
 
Anonymous Anonymous is offline
 

eXpert
  
Join Date: Sep 2002
Posts: 222
 

Default

Thanks for that, got it working now
Reply With Quote
  #7  
Old 10-14-2002, 01:43 AM
 
Anonymous Anonymous is offline
 

eXpert
  
Join Date: Sep 2002
Posts: 222
 

Default

Ok, now I have sorted that, any idea's on having a 'wish list' button on the same page???

Thanks again guys...

Amanda
Reply With Quote
  #8  
Old 10-14-2002, 02:11 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Code:
<a href="javascript:document.orderform_{%product.index%}.mode.value='add2wl'; document.orderform_{%product.index%}.submit()">

__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:51 PM.

   

 
X-Cart forums © 2001-2020