| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
product's sequence number | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Is there an easy way to get product's sequence number in current category?
For example if I open 5th product I need to get something like $current_product=4 (considering it starts with 0), so then I can pass it to javascript. I know I can go through $products or $cat_products to get this number, I just was wondering if that number already exists somewhere. It's for v.4.4.4
__________________
X-Cart Gold Plus 4.6.6 A lot of custom mods |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Possibly the closest you could get to doing this with some pre-existing code/variables would be if you set the product positions in the category, then use the order_by variable.
__________________
Paul Dodman e-business & m-commerce consultant w: www.luminointernet.com e: xcart@luminointernet.com Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart. |
|||||||||
#3
|
|||||||
|
|||||||
![]() Nice idea, unfortunately order_by is available only for categories in $categories_menu_list, I don't know how to include it into $product.
__________________
X-Cart Gold Plus 4.6.6 A lot of custom mods |
|||||||
#4
|
|||||||
|
|||||||
![]() OK, that was simple.
in product.php PHP Code:
PHP Code:
In my design I display products of current category at the bottom of product area so PHP Code:
And now I can use {$product.seq_number} in my templates.
__________________
X-Cart Gold Plus 4.6.6 A lot of custom mods |
|||||||
|
|||
X-Cart forums © 2001-2020
|