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

Display Certain Number of Featured Products

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-06-2011, 07:15 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default 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
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #2  
Old 04-06-2011, 02:47 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
chamberinternet (04-07-2011)
  #3  
Old 04-07-2011, 04:19 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: Display Certain Number of Featured Products

Cool ... That makes sense ..

Thanks Steve!

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #4  
Old 04-19-2011, 02:53 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default 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
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #5  
Old 04-19-2011, 03:15 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #6  
Old 04-19-2011, 03:16 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default 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
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #7  
Old 04-19-2011, 02:29 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 06:22 AM.

   

 
X-Cart forums © 2001-2020