Adding extra variable to $product array
Hi,
Does anybody know how to add an extra variable to the $product array? I need to add each product's sub-category id. Thanks for any advice. |
Re: Adding extra variable to $product array
I think you want to look at include/func/func.product.php
"function func_select_product" |
Re: Adding extra variable to $product array
I believe $product['categoryid'] already exists.
|
Re: Adding extra variable to $product array
Thanks, you're right that's the script. I've managed to figure it out.
Quote:
|
Re: Adding extra variable to $product array
Yes, I think you're right, from looking at the func.product.php script that variable is there so I might be able to use that, or if not I'll just look the id/ids up from the database.
Quote:
|
Re: Adding extra variable to $product array
Whenever you are wondering if a variable exists, or what is contained in an array, use webmaster mode.
|
Re: Adding extra variable to $product array
yes, I used {$products|@debug_print_var} to inspect the array, seems like there's everything apart from each product's categoryid.
Quote:
|
Re: Adding extra variable to $product array
Ah, $products is different than $product. Since a product can be in more than one category you may be looking for the product's main category. This info can be pulled from the products_categories table and you may want to do this in include/search.php.
|
Re: Adding extra variable to $product array
Excellent, thanks very much.
|
All times are GMT -8. The time now is 06:01 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.