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

Show featured products in 2 blocks

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-18-2011, 09:51 PM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Show featured products in 2 blocks

I want to show featured products in 2 seperated blocks, each block has its own block title, and show products according to product order, how to do, pls?
__________________
X-Cart Version: 4.7.12 GOLD
www.cheapglasses123.com prescription glasses online at discounted prices.
prescriptionglassesusa.com
www.loupesusa.com X-Cart Version: 4.7.11 GOLD PLUS
Reply With Quote
  #2  
Old 08-19-2011, 03:17 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,197
 

Default Re: Show featured products in 2 blocks

Use the position field for future product - say 2 block of 3 products each - 1 block positions 0-100 second block positions 100-200. Then create each block based on position with an if statement
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
sinobest (08-20-2011)
  #3  
Old 08-20-2011, 12:07 PM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Re: Show featured products in 2 blocks

Quote:
Originally Posted by cflsystems
Use the position field for future product - say 2 block of 3 products each - 1 block positions 0-100 second block positions 100-200. Then create each block based on position with an if statement

would you please offer me the details codes?

Thanks in advance!
__________________
X-Cart Version: 4.7.12 GOLD
www.cheapglasses123.com prescription glasses online at discounted prices.
prescriptionglassesusa.com
www.loupesusa.com X-Cart Version: 4.7.11 GOLD PLUS
Reply With Quote
  #4  
Old 08-20-2011, 04:18 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,197
 

Default Re: Show featured products in 2 blocks

It is somethign like this

{if $product.orderby lt 100}
show first block
{elseif $product.orderby gt 100}
show second block
{/if}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 08-20-2011, 05:17 PM
 
sinobest sinobest is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 462
 

Default Re: Show featured products in 2 blocks

for example, i have set 30 featured products, i want to show 3 blocks:
Hot Prducts: featured products 1-10
Discount Products: featured products 11-20
Latest Prodcuts: featured products 21-30

How to modify skin/2-columns/customer/main/featured.tpl, do i need modify other files also.
__________________
X-Cart Version: 4.7.12 GOLD
www.cheapglasses123.com prescription glasses online at discounted prices.
prescriptionglassesusa.com
www.loupesusa.com X-Cart Version: 4.7.11 GOLD PLUS
Reply With Quote
  #6  
Old 06-22-2012, 02:13 AM
  DrQuietus's Avatar 
DrQuietus DrQuietus is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 81
 

Default Re: Show featured products in 2 blocks

There are a couple of these threads floating around about grouping featured products by the sort order. It seems very simple but the order variable is not available to smarty. So there needs to be a SQL query (I'm guessing) in the featured_products.php file. Can anybody provide php I would need to add, so I can have an if statement in the templates? Like:

if $f_products.orderby lte 100
show them
else
something else
/if
__________________
Dave Jones
dave@industrialwebworks.net
Mostly 4.7.2 - 4.7.5
Reply With Quote
  #7  
Old 06-27-2012, 12:51 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Show featured products in 2 blocks

You might have to add a line like this to include/search.php:
PHP Code:
$fields[] = $sql_tbl['featured_products'] . '.product_order'
You may also have to wrap that in a test for $inner_joins['featured_products']
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
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 01:06 PM.

   

 
X-Cart forums © 2001-2020