Magento – Missing add to cart button on some items

addtocartcachecatalogcataloginventorymagento-1.9

We're experiencing a strange issue with our catalog, I'm scratching my head of where to start looking for…

Here are the symptoms:

  1. Item X – doesn't have the "Add to Cart" Button.
  2. When I go to the catalog, enable and disable the item refresh the
    item and I see the button.

Good up to here.

Then I went to do the mass changes:

  1. Disabled the cache
  2. Selected the item group (more or less 1700 items)
  3. Re-indexed all the catalog.

The strange thing is that when I inspect the item, the the Add to Cart container is missing, when manually update the item (simply open the item and save it in the backend) it appears and solves the issue for that particular item, but no bulk action solves the issue from admin.

Examples:

Missing container

Any ideas?


UPDATE

Found the js issue on the pages, implemented the fix specified here:
Product.OptionsPrice is not a constructor magento 1.9.3

The given error disapered, but the initial issue still persists.

At this moment, at frontend console no errors.

  • // Cleaned cache
  • // Reindexed all (exept URL's, because it takes 3 hours to index)

UPDATE 2

httpd – access & error logs: nothing strange there.

var/logs – checked the most recent logs, can't see anything there all the data seems to be regular.

<Magento_root>/var/log/system.log and exception.log – system log is empty? Exeption log, nothing strange there (no errors).

Best Answer

I've experienced this problem in the past. In my case someone in our content department imported a brand of products without all required attributes filled out.

Just to make sure it's not something in the code base. Go to any of the pages that you're experiencing this issue on and open dev-tools in your browser of choice (right-click on the page and inspect element). Check if you see any errors in the console. enter image description here

If you do see a related error then you've got a front-end issue, probably relating to some javascript. If you don't see anything there check the following logs for errors:

  • Magento: <Magento_root>/var/log/system.log and exception.log
  • MySQL: If error logging is enabled, the location of this log tends to vary. If error logging is enabled it's going to be somewhere in /var/log (This is from your server root not magento)
  • Apache: If you're using apache as your http server you'll find the logs in either /var/log/apache2/ or /var/log/httpd/ depending on your linux distribution.

You should be able to find something in one of these areas to help you get started debugging the issue. Please update your post with any errors that you find in the console or logs.