Jump to content

Prestashop 1.6 quantity check problem


Recommended Posts

Hello everybody.

Please help me to solve one problem.

On my Prestashop 1.6.0.14 I'm trying to check quantity in product.tpl

Under the section:

	<p id="add_to_cart" {if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE}style="display:none"{/if} class="buttons_bottom_block">
	<button type="submit" name="Submit" class="exclusive lmromancaps">{l s='Add to cart'}</button>
	</p>

I'm trying to add code:

	{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE }
	<input type="button" class="exclusive lmromancaps b1c" value="Order">
	{else}
	<input type="button" class="exclusive lmromancaps b1c" value="Quick buy">
	{/if}

But the condition when the product doesn't have quantity never happens. This code only working for product which doesn't have any attributes and features, but for products with features and attributes I can't check the quantity.

For example if product has attributes, Color 1, quantity = 1, Color 2, quantity = 0, my code doesn't see that Color 2 has no quantity, it see that it has quantity.

Please help me to do it, what I'm doing wrong?

 

Thanks.

Edited by dmf (see edit history)
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...