Jump to content

Product Quantities / Combinations


Recommended Posts

Hello Prestashop Community


I was asking myself how to modify the product.tpl to solve the following problem:


I want to show a default message when the $product->quantities is smaller or equal to 10.

So my product.tp looks like that at the moment:

				<!-- number of item in stock -->
				{if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}
				<span id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
					{if $product->quantity <= 10 && $product->quantity > 0}
					(<span id="quantityAvailable">{$product->quantity|intval}</span>
					<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='Item in stock'})</span>
					<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items in stock'})</span>
					<span>{l s='(More than 10 Products in Stock)'}</span>

This works fine so far but only for products without combinations.

If a product has combinations, the value inside $product->quantities is always the stock of all combinations added.


Now, how can I get access to the specific combination quantities?

Or, how can I check if a product has combinations in smarty?


I hope somebody can help me.


Greetings Nihi

Edited by Nihi (see edit history)
  • Like 1
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...