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)
-   -   Short description for Product Recommends (https://forum.x-cart.com/showthread.php?t=40601)

tqualizerman 06-19-2008 12:04 AM

Short description for Product Recommends
 
I'm trying to show the short description for the recommend products and am working with the file /modules/Recommended_Products/recommends.tpl

Throwing {$product.descr} simply echoes the short description of the product the customer is looking at, not the recommends. So I'm wondering how I can call on the short description of each product recommendation.

Any ideas?

Jerrad 06-19-2008 12:32 AM

Re: Short description for Product Recommends
 
Did you tried this:

{$recommends[num].descr}

tqualizerman 06-19-2008 12:55 AM

Re: Short description for Product Recommends
 
I just did, but nothing is returned -- just blank.

Yurij 06-19-2008 06:06 AM

Re: Short description for Product Recommends
 
Quote:

Originally Posted by tqualizerman
I just did, but nothing is returned -- just blank.


I am not sure that this is a good solution, but it was invented for 5 minutes.

Open file "include/func/func.product.php" and find next lines:
PHP Code:

$fields[] = "$sql_tbl[products].productid";
    
$fields[] = "$sql_tbl[products].provider"


add after this text next line:
PHP Code:

$fields[] = "$sql_tbl[products].descr"


.... now you can use in the template /modules/Recommended_Products/recommends.tpl variable:

{$recommends[num].descr}

tqualizerman 06-19-2008 08:45 AM

Re: Short description for Product Recommends
 
Awesome, that worked flawlessly.

Another question I had was along the same lines and probably requires a similar edit (I think.)

Would it be possible to add an 'add to cart' button into the Upselling/Related products module?

Yurij 06-20-2008 12:18 AM

Re: Short description for Product Recommends
 
Quote:

Originally Posted by tqualizerman
Awesome, that worked flawlessly.

Another question I had was along the same lines and probably requires a similar edit (I think.)

Would it be possible to add an 'add to cart' button into the Upselling/Related products module?


Add the following line for every products in the file "skin1/modules/Upselling_Products/related_products.tpl"


PHP Code:

<a href="cart.php?mode=add&productid={$product_links[cat_num].productid}&amount=1">Add to cart</a


Instead of text "Add to cart", you can use image or button.

tqualizerman 06-20-2008 09:39 PM

Re: Short description for Product Recommends
 
Thanks again Yurij,

Worked flawleslly.

mrerotic 11-11-2009 04:16 PM

Re: Short description for Product Recommends
 
How can you add a buy now button to 4.2.1 for this?


All times are GMT -8. The time now is 01:19 PM.

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