Jump to content

PS 1.7.0.4 "out of stock orders" not working


SDeAstis

Recommended Posts

Hi,

since last update to PS 1.7.0.4 although I set the stock management to ON and I allow orders out of stocks in the global settings and also at product creation, the product configured as "accept orders with quantity 0" doesn't work. In the front office the "Add to cart" button for those product out of stock is not enabled. This was working in the previous version.

 

Thanks for you attention and support.

Link to comment
Share on other sites

Hi,

 

I fixed the problem, at the moment it works for me. I don't know if this is the best solution but you could try it out.

 

change the next file at row 41:

\themes\classic\templates\catalog\_partials\product-add-to-cart.tpl

 

I just removed "disabled out of the line so it wil be permanently active.

 

original line(row 41):

<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}>

 

my version:

<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}{/if}>

 

Maybe someone else has an better solution.

Link to comment
Share on other sites

Hi,

I got your solution but looks not correct for me.... I've enabled the option for customers to order unavailable products at store level . So the if statement should check that property! I will look also into the product class if there is a property defined. Actually the property should be there since I check the option for customers to book the product if not available also at product creation. So in my opinion the if statement should check at least a couple of logical variables.

Link to comment
Share on other sites

By the way, I ask developers to have a look into this and provide a soluzion/fix as soon as possible since in my shop I have many many articles not available in stock but configured as "Customer can order it in case not availble in stock". At moment I can not receive any order from my customers.

 

Please help!

Link to comment
Share on other sites

  • 2 weeks later...
  • 11 months later...

Same bug with me .All products are out of stock .I set "Allow orders for out of stock products".Also allow every product for orders but its not working.
Temporary solution ,i edited as  kaizer wrote those lines.It works only in product page.No "add to cart button" and cant order in home page modules (best sellers,featured products,new arrivals).That is very bad.I m close to finish an eshop and how to give it while nothing works.

If i change quantity to 1 ,all working fine but every store have the 3% of products in stock so there isnt solution to make all quantities 1.If a customer go to pickup in store?
I will not proceed next time with prestashop 1.7 .Seems like disaster.

Even the new method of translation is worst than ever.I cant translate the add to cart button and the quick view.
I ve traslated in so many places,i cleared cache etc, and keep displaying quick view and add to cart in english
:-(

bug4.png

Link to comment
Share on other sites

  • 2 years later...
On 1/27/2017 at 11:15 AM, keizer said:

Hi,

 

I fixed the problem, at the moment it works for me. I don't know if this is the best solution but you could try it out.

 

change the next file at row 41:

\themes\classic\templates\catalog\_partials\product-add-to-cart.tpl

 

I just removed "disabled out of the line so it wil be permanently active.

 

original line(row 41):

<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}>

 

my version:

<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}{/if}>

 

Maybe someone else has an better solution.

Fixed my problem. Thanks.

Link to comment
Share on other sites

On 1/27/2017 at 11:15 AM, keizer said:

Hi,

 

I fixed the problem, at the moment it works for me. I don't know if this is the best solution but you could try it out.

 

change the next file at row 41:

\themes\classic\templates\catalog\_partials\product-add-to-cart.tpl

 

I just removed "disabled out of the line so it wil be permanently active.

 

original line(row 41):

<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}>

 

my version:

<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}{/if}>

 

Maybe someone else has an better solution.

Have you seen bugs since you've changed that file?

Link to comment
Share on other sites

On 1/27/2017 at 12:15 PM, keizer said:

Hi,

 

I fixed the problem, at the moment it works for me. I don't know if this is the best solution but you could try it out.

 

change the next file at row 41:

\themes\classic\templates\catalog\_partials\product-add-to-cart.tpl

 

I just removed "disabled out of the line so it wil be permanently active.

 

original line(row 41):

<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}>

 

my version:

<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}{/if}>

 

Maybe someone else has an better solution.

This is wrong. This way the button will always be active, even if you have "allow out of stock" disabled for a product.
This condition will work:

{if !$product.add_to_cart_url}disabled{/if}

As you can see, that's the original condition in classic theme.

This condition in your theme is clearly wrong:

{if !$product.add_to_cart_url || $product.quantity_wanted>$product.quantity}


because the last part only checks product quantity, regaldless if allow out of stock is active.

Link to comment
Share on other sites

1 hour ago, rdy4ever said:

This is wrong. This way the button will always be active, even if you have "allow out of stock" disabled for a product.
This condition will work:


{if !$product.add_to_cart_url}disabled{/if}

As you can see, that's the original condition in classic theme.

This condition in your theme is clearly wrong:


{if !$product.add_to_cart_url || $product.quantity_wanted>$product.quantity}


because the last part only checks product quantity, regaldless if allow out of stock is active.

What do you suggest then? Is it an issue?

Link to comment
Share on other sites

20 hours ago, anat92 said:

What do you suggest then? Is it an issue?

This is not currently a Prestashop issue, as in the original classic theme the code is correct. Is an issue related to old, 3rd party themes that were not updated by their authors. What I'm suggesting is to use this condition instead of keeping the old condition empty of content (wich is a big NO in any programming language):

{if !$product.add_to_cart_url}disabled{/if}

This condition is correct and it will work.

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