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

Product ID in Category List?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-11-2011, 06:53 AM
 
Pilbeam Pilbeam is offline
 

Newbie
  
Join Date: Sep 2010
Posts: 2
 

Default 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?
__________________
X-Cart installation (v4.4.2)
Reply With Quote
  #2  
Old 01-11-2011, 03:20 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 01-12-2011, 12:20 AM
 
Pilbeam Pilbeam is offline
 

Newbie
  
Join Date: Sep 2010
Posts: 2
 

Default 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...
__________________
X-Cart installation (v4.4.2)
Reply With Quote
  #4  
Old 01-12-2011, 04:16 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Product ID in Category List?

It's not called Array. The name is probably $products or similar
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 01-12-2011, 05:02 AM
 
adam.fearn adam.fearn is offline
 

Newbie
  
Join Date: Jan 2011
Posts: 8
 

Default 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.
__________________
X-Cart Gold, version 4.4.2.
Reply With Quote
  #6  
Old 01-12-2011, 05:14 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Product ID in Category List?

Loop through the array with foreach to access them
__________________
Steve Stoyanov
CFLSystems.com
Web Development
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 12:36 PM.

   

 
X-Cart forums © 2001-2020