Questions tagged [addtocart]

Questions related to the functionality of adding product to shopping cart in Magento.

0
votes
0answers
213 views

Add to cart with ajax not working in homepage

I installed Magento 2.2.5, and set Luma theme as default. In my homepage add to cart is not working with ajax, while on the other pages works just fine. Any idea?
0
votes
0answers
13 views

Making addToCart and cart page execute synchronously in magento 1.9

I am a complete newbie in magento, javascript and php So I am using magento 1 and my checkout page takes around 1 sec and cart page takes around 1.5 sec to load I want to decrease the time these two ...
1
vote
1answer
56 views

where is cart success.phtml called?

Where is the file: CartSuccess.phtml being called from when the users clicks on the "Add to cart" button on a simple product from within a category page? I want to change the way that the Cart ...
0
votes
1answer
117 views

Add custom option to configurable product M2

I wrote a plugin to add custom option while adding the product to cart public function beforeAddProduct($subject, $productInfo, $requestInfo = null) { $additionalOptions['...
1
vote
1answer
247 views

Why my “Add to cart” button is not working in product page?

Add to cart button not working in my product page. But my test server is working fine, I copied and pasted the code as it is but, onclick event hasn't fire...
0
votes
0answers
88 views

Magento 2 products are not being added to cart

Does anyone know why this would be happening. My SSL cert is not installed correctly, can this be an issue? If not what can it be? I am taken to the cart page but it's empty.
4
votes
1answer
258 views

Add to cart not working in Magento 1.9

I have same issue in Magento 1.9 i'm using magento 1.9.3.2 Login to a customer accounts Try to add something to the shopping cart and place an order After order is saved go back to store and try to ...
0
votes
2answers
310 views

Product is available to buy in increments of x

In Magento 1.x, a pop up used to appear when the shopping cart did not contain the correct quantity increment according to the inventory setting in the backend. In M2, I do not see that message. ...
1
vote
1answer
353 views

M2: after add to cart showing error message

After add to cart, product added to cart and showing this "We can't add this item to your shopping cart right now." error message. I have set website and all other necessary fields for product in ...
1
vote
0answers
187 views

How to get items added in cart magento 2?

I'm new in magento 2. I want to show popup after click add to cart button so I override add to cart button. And then I tried to get items added by this code but it does not work. Please help me. ...
0
votes
0answers
73 views

Magento 2, how to add `attribute` and `custom option` of configuration product into cart?

Using Magento 2.2, API, Configurable Product. I had read the Similar Question for add attributes with custom option but it cannot help me to understand. I need to create new Web Service for Add ...
2
votes
0answers
188 views

Magento 1.9 : Add value to file type custom option when adding product to cart programmatically

I am calling $cart->addProduct($product, $params); for adding product to cart. Where, $product is product collection & $params is as follows as received from product page. Array ( [...
0
votes
2answers
298 views

Magento 1.9 : Add custom options programmatically to associated products

I have been working on showing custom options of simple product for grouped product. I am done with initial phase of allowing required custom option product and then showing it on frontend. I have ...
0
votes
1answer
335 views

Magento 2.2.3 Related Products add to cart button issue

i'm just wondering if anybody faced with following issue. I have enabled "add to card" button on my Related products as per this article Now button appeared but the problem is that is actually does ...
0
votes
1answer
273 views

Add to cart takes too much of time in magento2.2.4?

Actually, I tried to add the product to cart but it takes so much of time. I have disabled the cache while i am in the developing this website. How to rectify this time delaying issue?
0
votes
0answers
74 views

How to add the same product twice in cart with different qty and 0 price

I have tried to add the same product in cart with different qty and 0 price if certain condition full fill that added product. Now I am using below code to make it working but it goes to infinite ...
1
vote
2answers
518 views

Magento 2, When qoute calculate subtotal?

Using magento 2.2, API. I created a web service for add multi-product in to cart, but not calculate subtotal. Help please! CODE /** * * {@inheritdoc} */ public function addMultiItemToCart($email, ...
0
votes
0answers
86 views

Unabel to change currency when items in cart page in magento 2.2.0

I want to change currency after adding product to cart . but still loading in any infinite loop and showing error of max_nesting_level cross to 10000. Currency switcher is working without adding to ...
0
votes
2answers
99 views

Add to cart button freezes and nothing is put in basket

We currently run a Magento 2 Store with the Porto theme from Smartwave. We use the TIG PostNL extension for shipping. After the latest update of this extension the add to cart button doesn't work ...
0
votes
0answers
140 views

magento 2 cross sell add all to cart not working

I have added cross-sell block to my cart page as below and cross sell products are coming as expected.The items.phtm now has a button add all to cart.This is not working .How can i make this work . ...
2
votes
1answer
28 views

Cant Access a Value on Input or Button with type Submit

I want individual add to cart buttons for grouped products but keep the original add to cart button so that multiple products can be added to cart if needs be with a single click. This was fine ...
0
votes
1answer
87 views

Add to cart custom template

I want to know how to add the link to add the product to the card. I get all my product from magento, but I only display "add to card" but without link. On my template, I display several products, ...
3
votes
1answer
103 views

How to display swatch on cart page for added products in cart

How to display swatch on cart page for added products in cart. Right now it shows as Text, like Color Blue, but it should show like swatch icon.
0
votes
1answer
345 views

Redirecting to homepage after add to cart

I'm having issues that when you add a product to the cart, it automatically redirects to the homepage. I have tried switching it to redirect to cart as well, but it still redirects to the homepage. I ...
0
votes
1answer
168 views

Magento 2.2.4 - Add to Cart Not Working after Move Add to Cart Buttons Below Image on Product View

I have tried the following code to move add to cart buttons below image in catalog_product_view.xml Button has moved below that element but Add to Cart Button is not Working anymore. <move ...
1
vote
1answer
522 views

Add to Cart, Add to wishlist like product list page on related products

How to display add to block on related products similar to it is displaying on list page?
0
votes
1answer
392 views

Get selected product options on configurable product

When I select the product options of configurable product on my website I get a pop-up with the added product. I want to show the selected options on the pop-up. I already got the following code which ...
1
vote
2answers
563 views

Magento2 - duplicate quote item to new row and new price

Is it possible to add the same product (with same configurable options) with different price based on some custom values present in the product page to the shopping cart, but have it appear as ...
0
votes
1answer
249 views

Configurable product is not added to cart in catalog page Magento 2.2.2

I recently created a configurable product, when I select any of the size and color from catalog page then click add to cart button, it will redirect to the cart page. Not Added any item in my Cart. ...
1
vote
0answers
147 views

Ajax call getting CORS errors/conflicts

What i'm trying to do is as follows, we have different external content pages that have one or more of our products and need a simple "add to cart" button. To accomplish this i want to use a ajax ...
0
votes
0answers
88 views

add custom quantity in cart

Hei all I am working on customisation of product detail page where I have added text box for qty with every available size, my module will work like if user want S size with 5 pieces , M size with 2 ...
0
votes
2answers
144 views

What different between 'adding items in to cart' and ''adding item into quote'?

Using Magento 2.2, I need to add the simple and configuration products into the basket by REST API. On the stack, I saw someone use cart and other use quote. What the correct solution for add items?
2
votes
1answer
91 views

Why does the second product dynamically added to the cart lose its options in Magento2

I am dynamically adding products to the cart in Magento2 with some custom options. Every product has the same base product id with different options. RepresentProduct has been properly overridden so ...
3
votes
2answers
59 views

Require js didn't load my Js in custom module

I'm working on a custom module for GTM. The last part I facing issue is with require js. I want to trigger a custom JS on "add to cart" click. I made a requirejs-config.js file in Vendorname/...
1
vote
0answers
910 views

Magento 2 : I need to change add to cart success message after adding product into cart through plugin

I need to change add to cart success message after adding product into cart through plugin. Currently i have used below code for override cart method and its working fine. <preference for="...
1
vote
1answer
67 views

tier price working on view and list page but not in cart page

I have applied Tier price on my website. It shows "As low as" on list price and also applies successfully to view the product page. But when I add the product to the cart, it doesn't apply. <?php ...
2
votes
0answers
194 views

Magento2.2.x Custom page side bar in display mini cart items

My custom page in displaying all product with add to cart product functionalities I want display mini cart items on page sidebar. after add to cart item update and display in that sections. like that....
0
votes
1answer
214 views

move product overview below product review in Magento2?

help me to move the product overview below product review in product details page like this...and help me to make qty and add to cart button in a single line...
0
votes
1answer
726 views

“Shipping address is not set” error when saving cart

I have a simple code, where i add a simple product to the cart $cart = $obj->get('\Magento\Checkout\Model\Cart'); $cart->addProduct(5, 3); $cart->save(); but the last row, returns this ...
1
vote
4answers
170 views

magento2 Only single product in cart [closed]

I want to do following in Magento 2 Only one product in an entire cart If the cart is not empty and I add a product to the cart then product in the cart will remove and newly added replace it(a ...
0
votes
1answer
185 views

magento2 cart add multiple configurable product variants showing one product only

I am trying to add a configurable product with with different variants but its showing one item with 2 quantity instead of showing 2 item with each quantity one. $wholedata = $this->getRequest()-&...
0
votes
1answer
37 views

multistore customer login and add to cart fails

We have following situation on Magento 1.9.2.2 installation (ultimo theme) with multistore setup as websites in subfolders, e.g. domain.com/en-ca, etc.. Add to cart works when on the default website (...
0
votes
1answer
214 views

Need to add “Add to Cart” button Grouped product page in magento 2 for Main Product

I have displayed grouped product in product details page, now I have added "Add to Cart" button for each grouped product button, now problem is if i click on main product "Add to Cart" button then its ...
1
vote
1answer
393 views

How to add 'Buynow' button on product's gallery and product's detail view?

I need to add a button for 'Buy Now / Checkout' along with the 'add to cart' button. I need to display both of these buttons together in product gallery as well as product's detail view page. I have ...
1
vote
0answers
21 views

Checkout cart products disables randomly

I have created a website using Magento 2.2.3. I'm facing issues with adding product to the cart. The issue is, I can add the product to the cart and able to checkout. But, If i want to add some ...
1
vote
1answer
243 views

Magento 2 - Check if static block is enabled

On my Magento 2 store I have a static block that outputs a message to inform customers that the prices are not currently available. On my template files I'd like to wrap the prices and Add to Cart ...
1
vote
1answer
368 views

Ajax request on add to cart magento 2

I am new to the Magento, so not sure how we can implement this I want to send ajax request on Add to cart button on product detail page where I have to send the request to get stock from third party ...
0
votes
0answers
160 views

How to add custom option during add to cart in Magento 2.2?

I want to add the custom option when click on add to cart button in Magento 2.2 I am using the code in Observer: <?php namespace Vendor\Delivery\Observer; use Magento\Framework\Event\...
2
votes
1answer
647 views

Integrity constraint error referring to quote_item table while adding product to cart

I am getting the following error while trying to add product to cart in Magento 2.2.3. [2018-05-02 09:52:43] report.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or ...
0
votes
0answers
181 views

Magento 2.2.3 CE, price is zero when adding to cart

I have a very strange issue. After upgrading from 2.1.3 to 2.2.3 CE I've noticed one strange issue, which is as I found out, related to MSP_CashOnDelivery module. But please let me explain the ...