X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Replacing "Featured Products" with "Recommend (https://forum.x-cart.com/showthread.php?t=14503)

Allan Martel 06-10-2005 03:39 PM

Replacing "Featured Products" with "Recommend
 
I have (finally) managed to replace the "Featured Products" with "Recommended Products" on home.php - now 6 products are displayed at random instead of the static "Featured Products"

My next goal would be to make this now display the pricing information and the "Buy Now" button, in 2 rows of 3 products.

I'm pretty sure that this would just be editing the recommends.tpl file.....any help would be appreciated!

Heres what I did:

in skin1/customer/home.tpl, add
Code:

{include file="modules/Recommended_products/recommends.tpl"}
under

Code:

{include file="customer/home_main.tpl"}

In skin1/customer/main/welcome.tpl

remove

Code:

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

and finally, in home.php add:

Code:

if(!empty($active_modules["Recommended_Products"]))
        include "./recommends.php";


under
Code:

if (empty($products))
        include "./featured_products.php";


This was done in 4.0.11

Hope this helps someone!

Allan

balinor 09-02-2005 01:40 PM

Works well, thanks :)

salsabeel 09-23-2005 04:08 PM

Re: Replacing "Featured Products" with "Recom
 
Quote:

Originally Posted by Allan Martel
My next goal would be to make this now display the pricing information and the "Buy Now" button, in 2 rows of 3 products.


Allan,

Were you able to get this to work? Look forward to your reply, thanks!

BoomBoomBap 11-20-2005 04:33 PM

This is a great mod!

A couple notes from my own implementation:

If you only want the above mod to appear on the homepage, use the following code in:
skin1/customer/home.tpl
Code:

{if $main eq "catalog" and $current_category.category eq ""}
{include file="modules/Recommended_products/recommends.tpl"}
{/if}

it seems that otherwise this will also appear on the categories (and perhaps some other) pages.

If you want to limit the number of random items that appear then you will want to use customer recommends.php. Personally, I created recommends_home.php and made the following modification:

open recommends_home.php

Code:

find:
ORDER BY RAND(NOW()+$rnd) LIMIT ".$config["Modules"]["number_of_recommends"]);

replace with:
ORDER BY RAND(NOW()+$rnd) LIMIT 20");

note: this appears twice on the page


NightFire 01-09-2006 06:16 AM

The mod doesn't works for me.
Did exactly what was descriped above. But getting this error:

Code:

Warning: Smarty error: unable to read resource: "modules/Recommended_products/recommends.tpl" in /......./public_html/shop/Smarty-2.6.9/Smarty.class.php on line 1088


Recommends.tpl
Code:

{* $Id: recommends.tpl,v 1.4.2.1 2005/10/31 14:10:44 max Exp $ *}
{if $recommends}
{capture name=recommends}
{section name=num loop=$recommends}
<LI>
<FONT class="ItemsList">{$recommends[num].product}</FONT>
</LI>
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"}
{/if}


Maree 01-17-2006 10:58 PM

I cant get this working either - same error message as above

BoomBoomBap 01-18-2006 10:18 AM

Try emptying out the recommends.tpl file and just placing some text in there to see if the file is being found. If you get the same error make sure that your file is indeed at this location: modules/Recommended_products/recommends.tpl

Case sensitive!

amy2203 01-19-2006 02:11 AM

I just tried this and got the same error, it is a case-sensitive issue. In my store 3.5.10 the file is

modules/Recommended_Products/recommends.tpl

Note the capital P of Recommended_Products - That it generating the error,

hth

Maree 01-19-2006 03:43 AM

Thanks Amy - that was the problem.

The following notes are for others who are looking at this hack-

I now have recommended products randomly displaying in a 2 column 200 thumbnail format (thanks to Balinors Mod in Completed Mods). I've also added a hack to pull the price up

2 problems with doing all this -recommended products is displaying products that are hidden but available for sale - and the price is not displayed in the nicely formated including GST display that was on featured products.

So the best way I feel is to request xcart to add a checkbox in future releases so that featured products can be dispayed randomy from the whole active product catalogue or a user nominated array.

Hope this helps someone else

webadmin-jj 02-04-2006 07:11 AM

X-Cart Gold 4.01

So I think I might be getting closer to what I'm looking for. So much discussion on this topic, but none of it exactly what I need.

The situation:
-Featured products set to random
-Featured products module display called in the welcome.tpl

Result:
Featured products module boundaries and header show up, but it's empty

1. Why is is empty when I've told X-Cart to randomly select?
2. Once I get it past that point, how would I manually select items for display in featured items?

Thanks.


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

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