MrBaseball34 Posted July 5, 2010 Share Posted July 5, 2010 I've added a property to the Product Object to handle our images, it is called hack_image.Now, when a New product OBJECT is created, it is populated with the correct value from the DB.But, when I get in the shopping-cart-product-line template, the variable $product is an array, not an objectand my hack_image value is no longer there.I've looked high and low for when this array is built.Oh, and another thing, Why would some properties sometimes be accessed like this:$product->nameand other times accessed like this:$product.nameCan anyone help out?? Link to comment Share on other sites More sharing options...
rocky Posted July 6, 2010 Share Posted July 6, 2010 In PrestaShop, the Product class is only called in product.php to get an individual product. Anywhere that PrestaShop needs to get multiple products, an SQL query is performed instead of creating Product objects, then the Product::getProductProperties() function is called on each row in the result. I think you'll need to modify all the SQL queries to include your image_hack field. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted July 6, 2010 Author Share Posted July 6, 2010 Every place that it selects product(s) in the Product class, it uses p.* so the hack_image column *should* be included.I can't seem to find any SQL selecting any products that doesn't include all columns, with the exception of getting the quantity andfinding out if a product is new... Link to comment Share on other sites More sharing options...
MrBaseball34 Posted July 6, 2010 Author Share Posted July 6, 2010 Where is the $product array in the shopping-cart-product-line template filled, anyway? I can't find it. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted July 6, 2010 Author Share Posted July 6, 2010 In Cart.php, in getProducts, the SQL had been changed to add the hack_image column. But in my 1.3.1 version it hadn't been.Looks like that is the culprit. I just didn't know where to look and finally found it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now