cancel
Showing results for 
Search instead for 
Did you mean: 

2.4.2CE: Category View does not Enable the add to cart button like the product specific page does

2.4.2CE: Category View does not Enable the add to cart button like the product specific page does

Hello, We have a problem with 2.4.2 staging environment where the add to cart button is disabled and the JS file that enables it seems not to be getting loaded. This apparently is only happening on the category view level as when you get into the product page directly the js file loads and the button is enabled when it is supposed to be. While we do have some extensions and such that run on the site the issue persists even after disabling all these. We have no "core" file modifications in place at this time with the 2.4.2 staging site as this is being used to upgrade from 2.2.10.

 

I cannot find any other errors related to this it just seems like the category view is not including the file catalog-add-to-cart.js. We are using the luma extension. We have no enabled overrides that i am able to find/aware of and as i said the customization stuff has all been disabled via module:disable currently.

 

I am at a loss for what to try and do to figure out what is blocking the file from loading? Thanks for any help that can be provided.

3 REPLIES 3

Re: 2.4.2CE: Category View does not Enable the add to cart button like the product specific page doe

Hi @dkeymel,

 

The problem may be caused by your custom theme. Currently, it is preventing the js files from loading. Please change back to the default Magento theme then try again with add to cart button.

 

Hope this can help you! Let me know if you need further assistance.

_________

If issue solved, Click Kudos & Accept as Solution.

LitExtension - #1 Shopping Cart Migration Expert

LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.

Visit website: http://litextension.com/

Re: 2.4.2CE: Category View does not Enable the add to cart button like the product specific page doe

Hi there! Thanks for your response. You are right something is stopping this from working but we have a stock LUMA theme as far as i can tell. I took a copy of the git hub files and did a file comparison with meld between our luma and blank theme files and the files in the github and there were no differences between them. We did disable all of our extensions and the custom admin theme that was installed. This did not solve the issue either. I am still grappling with the luma/blank themes files to see where something might be different or if there is even a more core set of files to all themes on the front end that might be responsible for these JS files getting loaded? Is there a reference somewhere that loads these files that could be missing for the category view that is not missing for the product page itself?

Re: 2.4.2CE: Category View does not Enable the add to cart button like the product specific page doe

Hi @dkeymel,

 

Since Magento 2 stores root URL in the third path (e.g.: design/head/includes), the problem usually occurs after a domain change or hosting change. Follow the steps below to fix the error.
1. Run the additional SQL lines below:
UPDATE core_config_data
SET value = REPLACE(value,'<old-root-URL-or-domain>', '<new-root-URL-or-domain>')
WHERE path = 'design/head/includes';
2. Use the below command to delete the cache:
rm -rf var/cache/*

 

You can search for files by path: public_html/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
Line 95: change "disabled" to "enabled" to make buttons active again

 

Hope this can help you! Let me know if you need further assistance.

__________

If issue solved, Click Kudos & Accept as Solution.

LitExtension - #1 Shopping Cart Migration Expert

LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.

Visit website: http://litextension.com/