4140 Posted November 29, 2011 Share Posted November 29, 2011 I've added the option to display an image in a product's page when a checkbox is checked in BO. It's just like the on_sale option and to add it I've copied and modified all the lines of text about on_sale in all core files, BO and product page, also created a field in the data base. All works fine until the moment I decided to add a text to the product's listing in product list if the checkbox is marked. In product.tpl I'm calling the image with the following line {if $product->free_bag}somethig-something{/if} Just like the on_sale function is called. In product-list.tpl this does not work, so I check how on_sale is being called and modify it to get the following {if isset($product.free_bag) && $product.free_bag == 1}something-something{/if} But nothing happens. What am I missing/doing wrong here? Link to comment Share on other sites More sharing options...
cedricfontaine Posted November 29, 2011 Share Posted November 29, 2011 Did you try to activate the smarty debug in order to check if your variable is available ? Did you modify classes in order to load your data ? Link to comment Share on other sites More sharing options...
4140 Posted November 29, 2011 Author Share Posted November 29, 2011 Just tried it in homefeatured.tpl and it works just fine. Product-list still doesn't show it. Turned on smarty debug, but didn't find anything. Link to comment Share on other sites More sharing options...
cedricfontaine Posted November 30, 2011 Share Posted November 30, 2011 In Smarty debug you should see all your data. Did you see free_bag in products ? Link to comment Share on other sites More sharing options...
4140 Posted November 30, 2011 Author Share Posted November 30, 2011 It isn't there. I can't understand why - I've added it in all the core files where on_sale was mentioned and in the template files where I need it. Still works in product page and homefeatured, but not in product-list. Link to comment Share on other sites More sharing options...
cedricfontaine Posted December 1, 2011 Share Posted December 1, 2011 It's probably related how product-list grab its data. Have a look in the php page and check which class it calls. Link to comment Share on other sites More sharing options...
4140 Posted December 1, 2011 Author Share Posted December 1, 2011 I am not sure where and what to look for. Thanks for your help, btw Link to comment Share on other sites More sharing options...
cedricfontaine Posted December 5, 2011 Share Posted December 5, 2011 Contact me via message, and I'll see how I can help/ Link to comment Share on other sites More sharing options...
4140 Posted December 8, 2011 Author Share Posted December 8, 2011 Nevermind that. I don't know what exactly happened, but now it is as it should be. Thank you for your time! 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