kingsinnersoul Posted June 20, 2013 Share Posted June 20, 2013 (edited) Hello, In the product-list.tpl there are three if statements for the add to cart button. Can anyone walk me through what each of the following statements is saying and what are the variables? 1. {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} 2. {if ($product.allow_oosp || $product.quantity > 0)} 3. {if isset($static_token)} Thank you Edited June 21, 2013 by kingsinnersoul (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2013 Share Posted June 20, 2013 1) this is main if statement for add to cart button, if the condition = false - button will not appear. for example, if you've got catalog mode on, button will not appear (!$PS_CATALOG_MODE) etc. 2.this is also related to this case, but this if condition checking the quantity of product and product setting: http://i.imgur.com/yzw8SMF.png 3) where you've got it exactly? i suppose that this checking the token value from your url (when you're logged, you can check url addres - there is usually token) - it's for safety Link to comment Share on other sites More sharing options...
kingsinnersoul Posted June 20, 2013 Author Share Posted June 20, 2013 (edited) Thanks Vekia. I got it from the the default PS 1.5.4.1 theme product-sort.tpl file line #59. Is this line the reason that the add button will not appear in my local host on the home page but will in the categories/specials list? Thanks Edited June 20, 2013 by kingsinnersoul (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 20, 2013 Share Posted June 20, 2013 weirdy, because i haven't got this code in my default template Link to comment Share on other sites More sharing options...
kingsinnersoul Posted June 21, 2013 Author Share Posted June 21, 2013 weirdy, because i haven't got this code in my default template I just downloaded a fresh copy of PS 1.5.4.1 and double checked it. Its all there... "..\prestashop_1.5.4.1\prestashop\themes\default\product-list.tpl" Lines 57-59... Link to comment Share on other sites More sharing options...
vekia Posted June 21, 2013 Share Posted June 21, 2013 now everything is clear, I checked wrong file: ...In the product-sort.tpl there are three if statements... Link to comment Share on other sites More sharing options...
kingsinnersoul Posted June 21, 2013 Author Share Posted June 21, 2013 My error. Fixed it. Thanks 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