Jump to content

Out of stock in product list


Recommended Posts

Hello,

 

When a product is out of stock the 'Add to cart' button gets disabled in product list. When I refill the stock the 'Add to cart' button becomes enabled again. So far no problem. But, when a customer buys a product that has been out of stock the 'Add to cart' button gets disabled even if there is 20 products in stock. I then have to open the product in admin and hit 'Save' and the 'Add to cart' button gets enabled again (please notice that I don't do any changes, I just hit the 'Save' button).

 

It is only the 'Add to cart' buttons in the product list that keeps getting disabled, not the 'Add to cart' buttons on the product pages.

 

Here are the code that I guess disables the button:

                {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}
                    {if ($product.allow_oosp || $product.quantity > 0)}
                        {if isset($static_token)}
                            <a class="ajax_add_to_cart_button buy_exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a>
                        {else}
                            <a class="ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}", true)} title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a>
                        {/if}                        
                    {else}
                        <span class="noexclusive"><span></span>{l s='Add to cart'}</span>
                    {/if}
                {/if}        

Anyone know how to solve the problem?

Link to comment
Share on other sites

×
×
  • Create New...