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

Random Featured Products using Recommended Products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 09-25-2007, 10:51 AM
 
hhiker hhiker is offline
 

eXpert
  
Join Date: May 2007
Posts: 231
 

Default Random Featured Products using Recommended Products

We wanted to randomize the "featured products" on our home page. Being the featured products module does not do this, I figured out how to do this using the recommended products module. Here are the instructions on how to do this.

You can view it in action at www.highlandhiker.com/home.php

Quote:
1. Create new label called lbl_recommends_home. Add text to it that says what you would like the customer to see as the box header when they view your home page.

2. Create a new file called recommends_home.tpl and put it in skin1/modules/Recommended_Products/

3. Add the following code to recommends_home.tpl to:
{* $Id: recommends_home.tpl,v 1.9 2006/09/25 14:51:45 hhiker Exp $ *}
{if $recommends}
{capture name=recommends}
{include file="customer/main/products.tpl" products=$recommends}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends_home content=$smarty.capture.recommends extra='width="100%"'}
{/if}

4. Upload recommends_home.tpl to skin1/modules/Recommended_Products/ directory

5. In customer/main/welcome.tpl
Add:
{if $active_modules.Recommended_Products ne ""}
{include file="modules/Recommended_Products/recommends_home.tpl" }
{/if}

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

6. Comment out:
{*{include file="customer/main/featured.tpl" f_products=$f_products}*}

*** If you want this to show all through your page, you can simply edit recommended.tpl file and forget the rest of the steps.

*** To set the number of products that randomizes, you will need to change that in your admin. Doing so will also change the number of products shown on the product listing.

To remove recommended products from your product page, simply comment out the following in product.tpl
{if $active_modules.Recommended_Products ne ""}
{include file="modules/Recommended_Products/recommends_home.tpl" }
{/if}
__________________
-
-
Versions: 4.1.10 and 4.3.0 (see post for which cart)

"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge." - Thomas Edison

"Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it is the only thing that ever has." - Margaret Mead (1901-197 quoted in John M. RIchardson, ed. Making it Happen, 1982

"Water is the best of all things." - Pindar (c. 522 BC - c. 438 BC), Olympian Odes
Reply With Quote
  #2  
Old 10-09-2007, 01:22 AM
 
sunset sunset is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 94
 

Default Re: Random Featured Products using Recommended Products

I have tried this a few times and cant get it to work. It looks fabulous and just what i need.
Not sure what i am doing wrong. I am getting no featured products on the home page now.
__________________
Sunset
X-Cart Gold v4.1.8
Reply With Quote
  #3  
Old 10-09-2007, 04:43 AM
 
hhiker hhiker is offline
 

eXpert
  
Join Date: May 2007
Posts: 231
 

Default Re: Random Featured Products using Recommended Products

I looked over the instructions & saw that they did not quite make sense & I left out numbering step 6. When I posted that, I copied my own notes exactly. Here is my welcome.tpl file to give you an idea of what you should be doing. Your's probably looks a little different. We don't have many files that we have not modified.

If you still have problems, let me know.


Quote:
{* $Id: welcome.tpl,v 1.28.2.1 2006/07/12 04:51:17 svowl Exp $ *}
{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
{assign var="_name" value=$smarty.cookies.GreetingCookie|replace:"\'": "'"}
<h3>{$lng.lbl_welcome_back|substitute:"name":$_nam e} </h3>
{elseif $lng.lbl_site_title}
<h3>{$lng.lbl_welcome_to|substitute:"company":$lng .lbl_site_title}</h3>
{else}
<h3>{$lng.lbl_welcome_to|substitute:"company":$con fig.Company.company_name}</h3>
{/if}
{$lng.txt_welcome}
<br />
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<br />
{if $active_modules.Recommended_Products ne ""}
{include file="modules/Recommended_Products/recommends_home.tpl" }
{/if}
__________________
-
-
Versions: 4.1.10 and 4.3.0 (see post for which cart)

"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge." - Thomas Edison

"Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it is the only thing that ever has." - Margaret Mead (1901-197 quoted in John M. RIchardson, ed. Making it Happen, 1982

"Water is the best of all things." - Pindar (c. 522 BC - c. 438 BC), Olympian Odes
Reply With Quote
  #4  
Old 10-09-2007, 08:15 PM
 
sunset sunset is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 94
 

Default Re: Random Featured Products using Recommended Products

Thanks for the update hhiker...still no luck. Thanks anyway though. I am probably still doing something wrong. Being new to html etc...there is every chance that i have.
Cheers.
__________________
Sunset
X-Cart Gold v4.1.8
Reply With Quote
  #5  
Old 10-10-2007, 04:51 AM
 
hhiker hhiker is offline
 

eXpert
  
Join Date: May 2007
Posts: 231
 

Default Re: Random Featured Products using Recommended Products

Double check to see that you have it turned on in your modules & also configured.
__________________
-
-
Versions: 4.1.10 and 4.3.0 (see post for which cart)

"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge." - Thomas Edison

"Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it is the only thing that ever has." - Margaret Mead (1901-197 quoted in John M. RIchardson, ed. Making it Happen, 1982

"Water is the best of all things." - Pindar (c. 522 BC - c. 438 BC), Olympian Odes
Reply With Quote
  #6  
Old 10-25-2007, 10:53 PM
 
Media Pit Media Pit is offline
 

Newbie
  
Join Date: Oct 2007
Posts: 4
 

Default Re: Random Featured Products using Recommended Products

Hi there hhiker,

I am also interested in getting a randomised set of featured products on the front page, and I put in the changes you outlined, but am also getting no featured products at all on the front page now.

I have checked that the recommended products module is turned on, and also configured to show 10 products.

This is my entire welcome.tpl file and the changes as noted at the bottom.

Quote:

{* $Id: welcome.tpl,v 1.28.2.1 2006/07/12 04:51:17 svowl Exp $ *}
{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
{assign var="_name" value=$smarty.cookies.GreetingCookie|replace:"\'": "'"}
<h3>{$lng.lbl_welcome_back|substitute:"name":$_nam e} </h3>
{elseif $lng.lbl_site_title}
<h3>{$lng.lbl_welcome_to|substitute:"company":$lng .lbl_site_title}</h3>
{else}
<h3>{$lng.lbl_welcome_to|substitute:"company":$con fig.Company.company_name}</h3>
{/if}
{$lng.txt_welcome}
<br />
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<br />
{if $active_modules.Recommended_Products ne ""}
{include file="modules/Recommended_Products/recommends_home.tpl" }
{/if}
{*{include file="customer/main/featured.tpl" f_products=$f_products}*}



Thanks for any help,
Cheers,
Kiah.
__________________
X-Cart Version 4.1.8
Reply With Quote
  #7  
Old 10-27-2007, 08:25 AM
 
congiothoang congiothoang is offline
 

Newbie
  
Join Date: Sep 2007
Posts: 4
 

Default Re: Random Featured Products using Recommended Products

Shouldn't it have recommends_home.php as well ???
__________________
x-Cart Pro V4.1.8
Reply With Quote
  #8  
Old 11-01-2007, 01:59 PM
  SystemSkins's Avatar 
SystemSkins SystemSkins is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 350
 

Default Re: Random Featured Products using Recommended Products

Ok.. I'm lost already on step #1.

Quote:
1. Create new label called lbl_recommends_home. Add text to it that says what you would like the customer to see as the box header when they view your home page.

Create a new label? where? in what file? what ? isn't this what you have on your site named "Featured Products"
__________________
Doug Rock
X-cart Gold 4.1.9
_____________________________________
Altered Cart: 1-Page checkout
Firetank: Feed Manager
Website CM: CDSEO PRO
Website CM: Product A-Z Map
Website CM: Review Approval
Website CM: Site Map Pro
Qualiteam: Sales & Stats (free version)
Reply With Quote
  #9  
Old 11-01-2007, 02:40 PM
  SystemSkins's Avatar 
SystemSkins SystemSkins is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 350
 

Default Re: Random Featured Products using Recommended Products

I too am not getting anything on the main page.

My welcome.tpl
Quote:
{* $Id: welcome.tpl,v 1.28.2.1 2006/07/12 04:51:17 svowl Exp $ *}
{if ($active_modules.Greet_Visitor ne "") and ($smarty.cookies.GreetingCookie ne "") and $logout_user eq ''}
{assign var="_name" value=$smarty.cookies.GreetingCookie|replace:"\'": "'"}
<h3>{$lng.lbl_welcome_back|substitute:"name":$_nam e} </h3>
{elseif $lng.lbl_site_title}
<h3>{$lng.lbl_welcome_to|substitute:"company":$lng .lbl_site_title}</h3>
{else}
<h3>{$lng.lbl_welcome_to|substitute:"company":$con fig.Company.company_name}</h3>
{/if}
{$lng.txt_welcome}
<br />
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<br />
{if $active_modules.Recommended_Products ne ""}
{include file="modules/Recommended_Products/recommends_home.tpl" }
{/if}

my recommends_home.tpl
Quote:
{* $Id: recommends_home.tpl,v 1.9 2006/09/25 14:51:45 hhiker Exp $ *}
{if $recommends}
{capture name=recommends}
{include file="customer/main/products.tpl" products=$recommends}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends_home content=$smarty.capture.recommends extra='width="100%"'}
{/if}

my recommends_home.tpl is in: /skin1/modules/Recommended_Products/
my welcome.tpl is in: skin1/customers/main/

My recommended products module is enabled in modules
Recommended products options:
Select recommended products randomly: YES
Number of products to be displayed in recommended products list: 6

What am I doing wrong? Does this work with my version?


http://www.systemskins.com/sscart/home.php
__________________
Doug Rock
X-cart Gold 4.1.9
_____________________________________
Altered Cart: 1-Page checkout
Firetank: Feed Manager
Website CM: CDSEO PRO
Website CM: Product A-Z Map
Website CM: Review Approval
Website CM: Site Map Pro
Qualiteam: Sales & Stats (free version)
Reply With Quote
  #10  
Old 11-01-2007, 05:29 PM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: Random Featured Products using Recommended Products

Quote:
Originally Posted by SystemSkins
Ok.. I'm lost already on step #1.



Create a new label? where? in what file? what ? isn't this what you have on your site named "Featured Products"
Log into the admin area of X-Cart and its under languages.
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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

   

 
X-Cart forums © 2001-2020