View Single Post
  #4  
Old 02-28-2012, 12:43 AM
 
Stizerg Stizerg is offline
 

Senior Member
  
Join Date: Apr 2008
Location: Sydney, Australia
Posts: 195
 

Default Re: product's sequence number

OK, that was simple.
in product.php
PHP Code:
// product's sequence number in current category - by Stizerg
if (is_array($products)) 
    foreach(
$products as $x=>$pr)
        if (
$pr['productid'] == $productid) {
            
$product_info["seq_number"] = $x+1;
            break;
        }
// 
before
PHP Code:
$smarty->assign('product'$product_info); 

In my design I display products of current category at the bottom of product area so
PHP Code:
include './products.php'
must be included somewhere in the beginning of product.php, otherwise it wouldn't work.
And now I can use {$product.seq_number} in my templates.
__________________
X-Cart Gold Plus 4.6.6
A lot of custom mods
Reply With Quote