Jump to content

Product list "out of stock" even if one combination is >0


Recommended Posts

Hi

 

I'm using prestashop 1.4.7.0

 

For example if a product has 2 attributes. One combination with quantity 0 (the default one) and the other combination with quantity 3. The product-list.tpl still shows the product as out of stock.

 

-------------------------------------------

{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}{/if}

---------------------------------------

 

Do you have any idea about what should be the issue? probably the code above count only the default attribute (combination)?

 

Thank you

Marius

Edited by presdeco (see edit history)
Link to comment
Share on other sites

if a product has 2 attributes. One combination with quantity 0 (the default one) and the other combination with quantity 3. The product-list.tpl still shows the product as out of stock.

 

For products with combination, if the default combination is out of stock (0 or less then 0) the message "This product is no longer in stock with those attributes but is available with others". I tested this with 1.4.7.0 and this is the case. If you are seeing anything different, then it is probably a theme issue. I would contact the theme developer.

 

See here and here.

 

 

Marty Shue

Link to comment
Share on other sites

  • 2 weeks later...

I had the same problem with product-list.tpl

 

I changed the script to:

 

{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif ($product.id_product_attribute > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if}

 

This now shows the "Product available with different options" message if the default product combination is out of stock but an alternative combination exists, rather than just skipping over the $product.quantity_all_versions > 0 test and displaying "Out of stock"

  • Like 2
Link to comment
Share on other sites

×
×
  • Create New...