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

Replacing "Featured Products" with "Recommend

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 06-10-2005, 03:39 PM
 
Allan Martel Allan Martel is offline
 

Advanced Member
  
Join Date: Mar 2004
Posts: 72
 

Default 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
__________________
____________
____________

X-Cart v 4.0.14
X-Cart v 4.0.11
____________
____________
Reply With Quote
  #2  
Old 09-02-2005, 01:40 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Works well, thanks
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 09-23-2005, 04:08 PM
 
salsabeel salsabeel is offline
 

Senior Member
  
Join Date: Jan 2004
Posts: 132
 

Default 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!
__________________
X-Cart Platinum 4.6.5
Reply With Quote
  #4  
Old 11-20-2005, 04:33 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

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
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #5  
Old 01-09-2006, 06:16 AM
  NightFire's Avatar 
NightFire NightFire is offline
 

X-Adept
  
Join Date: Jul 2004
Location: The Netherlands
Posts: 561
 

Default

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}
__________________
Best regards,
Niki Buitenrust Hettema

X-Cart Gold 4.1.8 (Live & Loaded)
Royal Bhaktapur: Handmade products from Nepal - Pashmina's, scarfs, shawls, stola's and more...
Reply With Quote
  #6  
Old 01-17-2006, 10:58 PM
 
Maree Maree is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 85
 

Default

I cant get this working either - same error message as above
__________________
Maree
4.0.13
Reply With Quote
  #7  
Old 01-18-2006, 10:18 AM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

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!
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #8  
Old 01-19-2006, 02:11 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default

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
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #9  
Old 01-19-2006, 03:43 AM
 
Maree Maree is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 85
 

Default

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
__________________
Maree
4.0.13
Reply With Quote
  #10  
Old 02-04-2006, 07:11 AM
 
webadmin-jj webadmin-jj is offline
 

Advanced Member
  
Join Date: Apr 2005
Posts: 30
 

Default

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.
__________________
Webmaster, Janzjewelry
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


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 09:45 AM.

   

 
X-Cart forums © 2001-2020