Jump to content

negative product.quantity_all_versions


Recommended Posts

PS version:

File involved: product.tpl (in catalog and miniatures)


Hi all,

got an issue with about product quantity when i'm using combinations.

Since we use and external management software to import products, sometimes quantities are negatives and lower than -1, for example:

  1. combination black: 5
  2. combination yellow: 1
  3. combination blue: -19


We would like to show that product is available in some combination, but the command we using:

                            {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}

gives a negative value (5+1-19= -13).


As a result, on the category page, the product will be shown as unavailable, even if some combination are still available, this only happen if the sum is negative obviously, when is positive all works fine.

I'm searching for a string that takes into consideration all of the combinations, giving a positive result in case any of them is positive, so that i can show on the category list something like "some combination available".

Something like 

{elseif (isset($product.quantity_all_versions) && $product.quantity_ANY_versions > 0)}

(obviously the command ANY doesn't exists xD)


I'm very new to prestashop, any help would be appreciated, thanks.


Edited by Batou (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...