Jump to content

[PS1.7.0.4] Allow ordering of out-of-stock products "not working"


SDeAstis

Recommended Posts

Hi,

in my new shop (www.maraschiomoto.com) I have a lot of product with many combinations. Since we can not sustain the effort to have in stock all of them we want to allow customers to "order out of stock products". So I configured the option in the back office in "Product stock preferences". I also set up the policy "When out of Stock" as "allow order" at product creation in at the bottom of the combination tab. Although I've done all of these steps the products with quantities zero are not available and my customers cannot book them since the add to cart button is disabled. The functionality was available in PS 1.7.0.3. Please have a look into this and tell me if there is something wrong on my side or the latest PS release has an issue.

 

Many thanks. 

  • Like 1
Link to comment
Share on other sites

Thank you very much for the support. I made the product-add-to-cart.tpl changes and this is the diff with the original.

 

--- C:\Users\sdeastis\Documents\personal\SitoMaraschioShop\Bugs_prestashop\product-add-to-cart.tpl.orig 2017-02-03 11:33:04.000000000 +-0100
+++ C:\Users\sdeastis\Documents\personal\SitoMaraschioShop\Bugs_prestashop\product-add-to-cart.tpl 2017-02-03 11:29:38.000000000 +-0100
[spam-filter] -35,27 +35,30 [spam-filter]
             value="{$product.quantity_wanted}"
             class="input-group"
             min="{$product.minimal_quantity}"
           />
         </div>
         <div class="add">
-          <button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit" {if !$product.add_to_cart_url || $product.quantity_wanted>$product.quantity}disabled{/if}>
+          <button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit" {if !$product.add_to_cart_url}disabled{/if}>
             <i class="material-icons shopping-cart"></i>
             {l s='Add to cart' d='Shop.Theme.Actions'}
           </button>
           {block name='product_availability'}
             <span id="product-availability">
-              {if $product.show_availability && $product.availability_message}
+              {if $product.show_availability && $product.availability_message && $product.quantity_wanted<=$product.quantity}
                 {if $product.availability == 'available'}
                   <i class="material-icons product-available"></i>
                 {elseif $product.availability == 'last_remaining_items'}
                   <i class="material-icons product-last-items"></i>
                 {else}
                   <i class="material-icons product-unavailable"></i>
                 {/if}
                 {$product.availability_message}
+              {else}
+                <i class="material-icons product-unavailable"></i>
+                {l s='Out of stock' d='Shop.Theme.Catalog'}
               {/if}
             </span>
           {/block}
         </div>
       </div>
       <div class="clearfix"></div>
[spam-filter] -71,6 +74,7 [spam-filter]
           }
         {/if}
       </p>
     {/block}
   {/if}
 </div>
+

 

Now customers can add to cart also out-of-stock products but the product is tagged beside the add-to-cart button as "not available" although I set the message "available for order" when out of stock at the bottom of the product combination tab during product creation. Now I'm one step ahead but can also this side effect of the change I made be fixed?

 

Thanks and regards!

 

  • 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...