X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding the Order Button to the Featured or Category Pages (https://forum.x-cart.com/showthread.php?t=974)

unioman 12-16-2002 12:50 PM

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?

funkydunk 12-16-2002 11:44 PM

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.

funkydunk 12-16-2002 11:52 PM

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!!

unioman 12-17-2002 11:23 AM

Thanks!
 
Thanks - that did it!


All times are GMT -8. The time now is 03:45 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.