Jump to content

ADD TO CART button always disabled


Grockell

Recommended Posts

I've set up a new store (ver 1.7.6.8) using the Classic theme (It does have a custom child theme, but that is not overriding any of the purchase template files).
I used the Import feature to bring in categories and products from an existing Loaded Commerce store. As far as I can tell, all of that went great, but for every single product the "ADD TO CART" button has the "disabled" attribute added to it:

<button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit" disabled="">
    <i class="material-icons shopping-cart"></i>
    Add to cart
</button>

Looking for suggestions.  This is the first PrestaShop site I've built, and I suspect there is some checkbox somewhere I am missing.

Link to comment
Share on other sites

Solution (at least in my case).

I created a new product through the interface then compared how it was saved in the database to the imported products. I think that when I was creating the file for the import I had assumed that "available_for_order" meant you could order the item when it was out of stock, and I set it to 0.  Seems that it instead means that you can order the item from the store. I also noticed the interface-created product had a set redirect_type (I had left that blank).  I used the SQL below to update my database and the buttons are working now. There was a moment of thinking this was not the solution when I had only modified the ps_product table, but when I made the same edits to the ps_product_shop table as well, it began working.
 

UPDATE `ps_product` SET `redirect_type`="301-category", `available_for_order`=1 WHERE `active` = 1

UPDATE `ps_product_shop` SET `redirect_type`="301-category", `available_for_order`=1 WHERE `active` = 1

 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
On 11/20/2020 at 12:41 PM, Grockell said:

Solution (at least in my case).

I created a new product through the interface then compared how it was saved in the database to the imported products. I think that when I was creating the file for the import I had assumed that "available_for_order" meant you could order the item when it was out of stock, and I set it to 0.  Seems that it instead means that you can order the item from the store. I also noticed the interface-created product had a set redirect_type (I had left that blank).  I used the SQL below to update my database and the buttons are working now. There was a moment of thinking this was not the solution when I had only modified the ps_product table, but when I made the same edits to the ps_product_shop table as well, it began working.
 


UPDATE `ps_product` SET `redirect_type`="301-category", `available_for_order`=1 WHERE `active` = 1

UPDATE `ps_product_shop` SET `redirect_type`="301-category", `available_for_order`=1 WHERE `active` = 1

 

Hi, good solution, I tried this and it worked perfectly for the exixting products(import), however when adding a new product through back office, the add to cart button is disabled for the new product, i also executed the queries you provided, however this button is disabled, do you know if i am missing something? prestashop 1.7.6

Link to comment
Share on other sites

Full disclaimer, I've been using Prestashop for only a couple of months... so I'm only guessing.

With me, comparing the product made through the BackOffice (which worked) to the imports that didn't was how I found the issue.  My suggestion for a product created through the BO that is not working would be to go into the edit -> Quantities (tab) and make sure that there are enough of them on hand to sell, and check to make sure the Availability Preferences (same tab) are not just set to "Deny orders".

If those look good, I would back into the ps_product and ps_product_shop tables and compare the new product to existing ones that do work to try and figure out what the difference is.

HEY, if you have not already gone live (or made too many other edits), open up the PDF and look towards the back where it tells you how to wipe out all the sample data that it starts off with! (Or leave it, like I did and because I had already made way too many changes before I got to that part of the book).

 

Good luck, let me know how it turns out.

 

 

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