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)
-   -   Show featured products in 2 blocks (https://forum.x-cart.com/showthread.php?t=60585)

sinobest 08-18-2011 09:51 PM

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?

cflsystems 08-19-2011 03:17 AM

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

sinobest 08-20-2011 12:07 PM

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!

cflsystems 08-20-2011 04:18 PM

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}

sinobest 08-20-2011 05:17 PM

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.

DrQuietus 06-22-2012 02:13 AM

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

cherie 06-27-2012 12:51 PM

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']


All times are GMT -8. The time now is 07:37 AM.

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