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

Adding the Order Button to the Featured or Category Pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-16-2002, 12:50 PM
 
unioman unioman is offline
 

Member
  
Join Date: Nov 2002
Location: VA, United States
Posts: 25
 

Default Adding the Order Button to the Featured or Category Pages

I would like to give the customer the option of ordering directly from the featured or category pages so they don't have to click on the product link to get a more detailed description of the product before ordering.

Has anyone done this that can help me figure it out. I tried just copying the code from the product.tpl page (just the code for the table with the product options) - but it didn't work.

This would certainly help streamline a customer's experience if they knew what they were shopping for.


Another Question - for a store with few products, it would be helpful to be able to display all the products (in order of category) on the first page a customer goes to when entering in the store. Is there a way to do that without making them all Featured Products?
Reply With Quote
  #2  
Old 12-16-2002, 11:44 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

I totally agree - in the standard set up there are too many clicks needed to purchase.

Here is the codes to be added into the products.tpl template found in skin1/customer/main/

Code:
<form name=orderform_{%product.index%} method=post action="cart.php?mode=add"> a href="javascript: document.orderform_{%product.index%}.submit()"> {include file="buttons/add_to_cart.tpl"}</a> <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}"> </form>

Put that in the template where you want it to appear on the listing adding in the appropriate html for your set up.

Your second question - I have built this option to show all the products on a separate page but I guess it could be adapted to show on the front page. It must only be used for relatively small numbers of products though else it weirds out. I will find and adapt the code and repost it.
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 12-16-2002, 11:52 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

code is shown towards the bottom of http://forum.x-cart.com/viewtopic.php?t=1179&highlight=

If you were putting this on the home page I would adapt the welcome.tpl template to replace

{include file="customer/main/featured.tpl" f_products=$f_products}

with

{include file="customer/main/listall.tpl" products=$products}

and amend the customer/home.php file from

require "./featured_products.php";

to

require "./total_list.php";


PLEASE BACKUP ALL FILES BEFORE DOING THIS JUST IN CASE!!
__________________
ex x-cart guru
Reply With Quote
  #4  
Old 12-17-2002, 11:23 AM
 
unioman unioman is offline
 

Member
  
Join Date: Nov 2002
Location: VA, United States
Posts: 25
 

Default Thanks!

Thanks - that did it!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 06:25 AM.

   

 
X-Cart forums © 2001-2020