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)
-   -   Product ID in Category List? (https://forum.x-cart.com/showthread.php?t=57470)

Pilbeam 01-11-2011 06:53 AM

Product ID in Category List?
 
I'm not sure if this has been answered before, I've been searching the forums and have seen many similar queries, but not any that suit my specific question;

I need to retrieve the wholesale price(s) of each product as they are looped through on the product list, the product ID is defined in a Smarty variable on the products_list.tpl, but I need it as a PHP variable so that I can query the database BEFORE the tpl loads.

Can someone help?

cflsystems 01-11-2011 03:20 PM

Re: Product ID in Category List?
 
productid is part of the products array that is assigned to smarty. you need to look inside the array, loop through it for each element.productid

Pilbeam 01-12-2011 12:20 AM

Re: Product ID in Category List?
 
Don't mean to sound ignorant here, but where is said Array? It's not in products.php, I can't seem to find exactly where the products Array is defined in PHP...

cflsystems 01-12-2011 04:16 AM

Re: Product ID in Category List?
 
It's not called Array. The name is probably $products or similar

adam.fearn 01-12-2011 05:02 AM

Re: Product ID in Category List?
 
No I realise that, and it is called $products, I just can't find where the variables within the array are defined.

EDIT: I'm using another account to post this response, just in case it confused you.

cflsystems 01-12-2011 05:14 AM

Re: Product ID in Category List?
 
Loop through the array with foreach to access them


All times are GMT -8. The time now is 01:11 PM.

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