Jump to content

What is the meaning of these if statements?


kingsinnersoul

Recommended Posts

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 by kingsinnersoul (see edit history)
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...