0

I have this issue where on some products the Add To Cart button and product options do not show up on the page. I have traced the code and have determined the problem is with the isSaleable attribute.

Tracing the code it seems like it should be returning true and if I hard code true in the isSaleable function everything shows up correctly. It seems to only be doing this for configurable products. Looking at the code and it looks like to me that the Config product bases the isSaleable on whether the product is enabled or disabled.

My question is, am I missing something else here and what would the repercussions would be if I were to just make that function return true all the time? We do not really use stock tracking.

Josh Pennington
  • 6,418
  • 13
  • 60
  • 93

2 Answers2

1

It's been a while since I've worked with Magento CE, but I think isSaleable is tied to the stock management system. I think you need to check the stock options and mark it in stock (with, of course, the product set to enabled). I would avoid hardcoding any of the functions if possible.

Edit: Did you try Inventory -> Manage Stock to "No" ? This is kind of a no-brainer, but products are set to be disabled by default, so General -> Status to "Enabled" is also required.

Nic
  • 13,287
  • 7
  • 40
  • 42
0

Products not displaying and/or displaying "out of stock" is a common Magento "gotcha".

To help myself and others troubleshoot this frustrating issue, I've compiled this checklist from this excellent SE answer: Magento products will not show in category and have added #7, to address a possible Magento Enterprise Edition cause of the hidden / out of stock products problem.

  1. The products must be Visible in Catalog.
  2. The products must be Enabled.
  3. Product must have a stock Quantity.
  4. The product must be set to In Stock. If the product is set not to track stock, it still has to have a stock Quantity and be set to In Stock.
  5. The product must be assigned to the target Category.
  6. If using multi-website mode (or if you imported the products through Data Flow), the products must be assigned to the target Website.
  7. Check Admin > Catalog > Categories > Catalog Events - make sure there is not a "closed" Catalog Event applying to your Categor(y/ies) or Product(s)
  8. Refresh your Cache / Indices.
Community
  • 1
  • 1
Silas Palmer
  • 2,687
  • 1
  • 29
  • 30