Products are added to the cart twice the quantity, when you click on Add To Cart button more than one.

Hi @bnymn, thanks for the well written issue!
But I'm going to close it, as it has already been reported before in https://github.com/magento/magento2/issues/15052 & https://github.com/magento/magento2/issues/15580
Quick summary: it's a new bug introduced in one of those new modules from Amazon which get installed by default now in Magento 2.2.4. Quick fix is if you don't need those modules to simply disable them, which should fix your issue. If you don't want to disable those modules, it is mentioned over here that a fix is pending for Magento 2.2.5: https://github.com/amzn/amazon-payments-magento-2-plugin/pull/227
Hi,
I am too facing add to cart issue, like adding product twice for second time onwards.
Once disabled Amazon module, works fine, is there any other solutions without disabling module for Magento 2.2.4 .
@vasudevsundar Hey, how did you disable amazon module? I wanna do it correctly, cause i don't use it anywhere
@swishhh, you have two options:
composer.json file: "replace": {
"amzn/amazon-pay-and-login-magento-2-module": "*"
}
Then run composer update, followed by a bin/magento setup:upgrade.
After this, there won't be any trace of the Amazon modules code in your project, there might still be some leftovers in the database though, but that's less important and shouldn't cause problems.
bin/magento module:disable Amazon_Core Amazon_Login Amazon_PaymentAfter this, the code of the Amazon modules is still in your project, but it is just not active.
You can choose whatever you're most comfortable with :)
@hostep thanks a lot :)
Any one help me how can i add add-to-cart button on CMS. I need Name, Thumbnail Image, Price, Add-to-cart Button On CMS PAGE, here add to cart not woking,
code :
file path: app/desgin/frontend/base/default/template/myphp/myphpcode.phtml
Place the below code
<?php $_productCollection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*');
?>
<table>
<tr>
<th class="prosku">Sku</th>
<th class="proname">Name</th>
<th class="proprice">Price</th>
<th class="proimg">Thumbnail</th>
<th class="pro-button">Add to Cart Button</th>
</tr>
<?php
if(count($_productCollection)) {
foreach($_productCollection as $product) {
?>
<tr>
<td class="prodsku"><?php echo $product->getSku(); ?></td>
<td class="prodname"><?php echo $product->getName();?></td>
<td class="prodprice"><?php echo $product->getPrice();?></td>
<td class="prodimg"><img src="<?php echo $product->getImageUrl();?>" width="100px" height="100px"/></td>
<td class="prod-add_to_Cart-button"><?php if($product->isSaleable()): ?>
<p><button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Add to Cart')) ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?></td>
</tr>
<?php
}
}
?>
</table>
<style type="text/css">
.prodsku, .prodname, .prodprice, .prodimg, .prod-add_to_Cart-button{
padding:10px;
}
.prosku, .proname, .proprice, .proimg, .pro-button{
padding:10px;
}
</style>
Most helpful comment
Hi @bnymn, thanks for the well written issue!
But I'm going to close it, as it has already been reported before in https://github.com/magento/magento2/issues/15052 & https://github.com/magento/magento2/issues/15580
Quick summary: it's a new bug introduced in one of those new modules from Amazon which get installed by default now in Magento 2.2.4. Quick fix is if you don't need those modules to simply disable them, which should fix your issue. If you don't want to disable those modules, it is mentioned over here that a fix is pending for Magento 2.2.5: https://github.com/amzn/amazon-payments-magento-2-plugin/pull/227