| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Adding extra variable to $product array | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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.
__________________
xcart Gold Plus 4.6.3 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Adding extra variable to $product array
I think you want to look at include/func/func.product.php
"function func_select_product"
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Adding extra variable to $product array
I believe $product['categoryid'] already exists.
|
|||||||||
#4
|
|||||||
|
|||||||
Re: Adding extra variable to $product array
Thanks, you're right that's the script. I've managed to figure it out.
Quote:
__________________
xcart Gold Plus 4.6.3 |
|||||||
#5
|
|||||||
|
|||||||
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:
__________________
xcart Gold Plus 4.6.3 |
|||||||
#6
|
|||||||||
|
|||||||||
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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#7
|
|||||||
|
|||||||
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:
__________________
xcart Gold Plus 4.6.3 |
|||||||
#8
|
|||||||||
|
|||||||||
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.
|
|||||||||
|
#9
|
|||||||
|
|||||||
Re: Adding extra variable to $product array
Excellent, thanks very much.
__________________
xcart Gold Plus 4.6.3 |
|||||||
|
|||
X-Cart forums © 2001-2020
|