Add to cart button not working on product page in magento 2.4.4. [enter image description here][1]
(1) Magento_Catalog/templates/product/view/form.phtml
` require([ 'jquery', 'priceBox' ], function($){ var dataPriceBoxSelector = '[data-role=priceBox]', dataProductIdSelector = '[data-product-id=escapeHtml($_product->getId()) ?>]', priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);
priceBoxes = priceBoxes.filter(function(index, elem){
return !$(elem).find('.price-from').length;
});
priceBoxes.priceBox({'priceConfig': <?= /* @escapeNotVerified */ $block->getJsonConfig() ?>});
});
`
(2) UPDATE core_config_data SET value = REPLACE(value, 'http://magento246.local/', 'http://magento246.local/') WHERE path = 'design/head/includes';
(3) setup:upgrade,setup:di:compile,indexer:reindex,setup:static-content:deploy -f,cache:flush,cache:clean,rm -rf var/cache/*
(4) [enter image description here][2]
I solved in many ways but this bug is not fixed.Above are some of those methods.
This problem is coming occasionally. Doesn't always come And it is coming in all 6 types of products.
It comes only on the product page. If we add to cart from category page then it does not come that bug.
If I page from category then I do cart. Then after that, if I do it on the product page, then this bug does not come.
This bug comes when I do it directly on the product page.
There was no ad cart at that time.
(Magento2.4.4)
yes i tried to solve but this bug is not fixed.
[1]: https://i.stack.imgur.com/cGbHd.png
[2]: https://i.stack.imgur.com/Yyo2v.png