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)
-   -   Display Certain Number of Featured Products (https://forum.x-cart.com/showthread.php?t=58787)

chamberinternet 04-06-2011 07:15 AM

Display Certain Number of Featured Products
 
Hi All ...

I'm developing an XC site on which I have 16 featured products assigned on the homepage.

However, I'd only want to display the first 8.
Is something I can tweak in the smarty code to achieve this?

The last 8 will only be displayed to customers with a certain membership level.

Can anyone help?

Many Thanks

Shafiq :sK

cflsystems 04-06-2011 02:47 PM

Re: Display Certain Number of Featured Products
 
You can use position field - set position for the first 8 you want to show say between 0 and 100 and above 100 for the rest and then just do check in the foreach loop in featured.tpl

{foreach from=xxx item=x}
{if $x.orderby lt 100}
show products code
{/if}

{if $x.orderby gt 100 && $userinfo.membershipid eq "y"}
show products code
{/if}
{/foreach}

You have to check on the correct variables syntax

chamberinternet 04-07-2011 04:19 AM

Re: Display Certain Number of Featured Products
 
Cool ... That makes sense ..

Thanks Steve!

Shafiq :sK

chamberinternet 04-19-2011 02:53 AM

Re: Display Certain Number of Featured Products
 
I've just noticed that within the $f_featured smarty variable, the orderby field is not available.

Any idea on how I can retrieve this information?

Many Thanks

cflsystems 04-19-2011 03:15 AM

Re: Display Certain Number of Featured Products
 
If not there you will have to modify the php script to include it. Look in /featured_products.php

chamberinternet 04-19-2011 03:16 AM

Re: Display Certain Number of Featured Products
 
Quote:

Originally Posted by cflsystems
If not there you will have to modify the php script to include it. Look in /featured_products.php


Yeah, i've just been looking in there, but i'm not 100% sure on how to do this.

Could you assist on this?

Thanks a lot

cflsystems 04-19-2011 02:29 PM

Re: Display Certain Number of Featured Products
 
It should be in search.php. Yes order doesn't exist in there, I would report this to QT as bug, if cart allows you to set it up it should be in included in the array


All times are GMT -8. The time now is 09:40 AM.

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