Questions tagged [addtocart]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

Add to cart functionality is not working for any product

my add to cart not working, its showing nothing in cart for 2 stores and for 1 store adding a default product everytime, doesn't matter which product we added, its showing this exception.... We can't ...
0
votes
0answers
11 views

Add free product in cart on orders above 999/- in magento 2

I want to add 1 product as free on orders above 999/- and 2 same product on orders above 1499/- in Magento 2. Please help.
0
votes
1answer
26 views

Magento 2 remove add to cart button for specific products?

I have tried to remove the Add to cart button with many solutions out there, but none has worked. I'm using this solution: How to remove the Add to Cart button from Catalog pages in Magento 2?. Also ...
0
votes
1answer
31 views

How to add dropdown for product qty in update cart page in magento 2?

I added dropdown for product qty box in addtocart.phtml like below: <div class="field qty"> <label class="label" for="qty"><span><?php /* @escapeNotVerified */ echo __('...
0
votes
0answers
14 views

Remove duplicate product form cart while adding bundle product

I have added a product Abc in cart. Then I have added bundle product in cart that has abc as child product. I want if abc is already added and bundle product is also going to add.thus remove abc ...
1
vote
0answers
15 views

Magento 2 How to get product qty before added to cart with JS?

I'm trying to get the quantities of a bundle product before added to cart with js, jquery, knockout js or whatever can allow me to do this. I want to validate that user cannot add to cart if the qty ...
0
votes
0answers
11 views

Bundle product add to cart issue

We have bundle products having options with input type radio buttons.When we add to cart we are facing error Call to a member function renderTierPrice() on null in vendor/magento/module-bundle/view/...
1
vote
1answer
21 views

How to create Add to cart button using Custom Module in Magento 2

I want to create Add to cart button using Custom module in product page,listing page and other page.Please advise me how to create this functionality. Any help would be appreciated... Thanks...
1
vote
1answer
28 views

Magento 2 how to get get product ID in after plugin?

please help, I'm struggling with this. I'm using this plugin public function afterAddProduct($subject, $productInfo, $requestInfo = null) I'm trying to get the product Id of the product in this way:...
0
votes
1answer
55 views

Magento 2: Get the qty of products before added to cart

I'm trying to get the qty of products in a plugin with a method called beforeAddProduct, with this method I can manipulate things before being added to cart. I need to check that the qty added to ...
0
votes
0answers
12 views

Magento 2 how to set maximum and minimum qty for bundle product?

I have this situation. I have an e-commerce site of artesanal beers. The beers are sold by 24packs, however the customer in frontend can define what beers and how many of them they want, but the rule ...
0
votes
0answers
9 views

Bundle_option_qty not working, with programmatically add bundle product to cart (magento 2.3.2)

I would like to add a bundle product to cart programmatically, however i'm experiencing a problem with the bundle_option_qty. I can change the selection of the bundle option, however the code is ...
0
votes
0answers
9 views

how can i add custom button that send ajax request to add products to cart on product detail page in magento 2

I have added a custom add to cart button but due to its type submit it reloads the page and adds data to cart. now I have placed a div. by clicking on div I want to trigger an ajax request and add ...
0
votes
0answers
19 views

Magento2.3 - Add Quantity Increment/Decrement on Category Page

I want to add Quantity Increment/Decrement buttons on Category Page. I am using a theme that already provides this feature on product page. Now I want to add same feature in category pages. Anyone ...
1
vote
1answer
112 views

Add to Cart Success Message Translation issue?

<?= $block->escapeHtml(__( 'You added product %1 to the <a href="%2">shopping cart</a>.', $block->getData('product_name'), $block->getData('compare_list_url')), ...
0
votes
0answers
22 views

Magento 2.3.4 “Product doesn't exist. Verify product and try again” error when adding to cart

We get this error when trying to add certain products to cart in a productive Magento 2.3.4 shop. Some of the products appear in the search, but not all. All of them have stock management deactivated, ...
0
votes
1answer
33 views

Add to cart success message

<?= $block->escapeHtml(__( 'You added product %1 to the <a href="%2">comparison list</a>.', $block->getData('product_name'), $block->getData('compare_list_url')), ...
0
votes
1answer
41 views

Overriding Magento 2.3 Checkout Cart Control Using Plugin using around but not working

What I am trying to achieve is when a product is added to the cart, the customer will have the option to add a special gift box. As every product has a different gift box and price so to do this what ...
0
votes
0answers
31 views

Issue with adding product to cart Magento2

When a user try to add a new product to cart it is working fine. The number of product in cart is getting updated as one. But when he try to add another product to cart, then it is not getting added ...
0
votes
0answers
15 views

Prevent ajax call in add to cart only in home page

I want to prevent ajax call in home page and in category page only for configurable page . As I need this Ajax call in the product page (Page containing a product with details) this is the Ajax code ...
1
vote
1answer
30 views

Magento 1.9 - How to apply handling fees if selected products available along with other products in the cart?

If the cart contains any one of the selected products along with other products that should be applied handling fees and cart contains only the selected products no need to apply handling fees. Here ...
0
votes
0answers
11 views

Need to create table with custom attributes in frontend for simple product

I need to create a Table in frontend, which will display custom data instead of the tab section in product details page.
0
votes
0answers
15 views

How to add out of stock product into cart Magento2.3?

Please check below image. And Backorder is also enable.still product not added into cart. Please suggest how to do it?
0
votes
1answer
21 views

Magento 1.9 I need add qty in category page and mask should not load

My template used ajax cart this code in my category page(list.phtml) <a href="<?php if(!Mage::getStoreConfig("ajaxcart/addtocart/enablecategory", $code) && !Mage::getStoreConfig("...
0
votes
0answers
11 views

Adding both add to cart and add to quote button on products

Is it possible to have an "Add to Cart" and "Add to Quote" buttons on product pages? We have products that we would like our customers to have the option of either submitting a quote or adding to ...
0
votes
0answers
19 views

Add to cart configurable product configurations in a loop

I modify phtml of product to show all possible sizes (size is a custom attribute) in a table with possibility to choose by user how many products of each size he wants to add to cart. Let's assume, ...
1
vote
2answers
51 views

How to display programmatically created custom options in admin order details

I created 4 programmatically custom options. It is successfully display in cart page and also make successful order. I created module for that. Here its code. path : vendor/addtocart/controller/index/...
0
votes
1answer
53 views

Magento 2.2.3 I want to show how many quantity is already added for each product in category page

I've added one field to show already added qty on the category page. I've made it the place next to the add to cart button. When I click the add to cart button, it increases the qty. But the problem ...
0
votes
0answers
36 views

Magento 2:Add another new Custom mini-cart?

I want to add new Minicart like shown in the following screenshot, using KnockOut Js, Give me some logic how can I cater to this problem
0
votes
1answer
30 views

Magento2 - How to get cart sale-rules information with respect to specific Product?

I am using event checkout_cart_add_product_complete which is triggered after Doing Add to cart any product, in the observer of this event I want to get associated cart price rule if any applied?
0
votes
0answers
33 views

Magento2 - Add to Cart not working on Catalog page

I cannot add products to shopping cart after clicking on Add to Cart button. Go to http://marsh.wsisites.net/products/lcd-character-displays.html Click on View detail and check.
0
votes
2answers
52 views

Magento2 - disable add to cart on product page

Im running Magento2.3.4 and would like to disable the add to cart bottom on some product pages because they are to complicated to ship. Have created an Yes/No attribute "afhentes" and I would like to ...
0
votes
1answer
28 views

How move add to cart button below product images in product page magento2.2.4

Try every possibility. it's not working. <move element="product.info.addtocart" destination="product.info.media" after="product.media" <move element="product.info.addtocart" destination="...
0
votes
0answers
25 views

Magento 2 custom modal Close button redirect to footer

I have a custom modal in Magento 2 , using knokoutjs. This modal has a Continue Shopping button : 'buttons': [ { text: 'Continue Shopping', click: function () { ...
0
votes
1answer
227 views

How to redirect to cart after adding product to cart programmatically

I want to redirect to cart page after adding the product into cart, I know there is a provision in config but I have a custom product type and that config is not working for that product. That ...
0
votes
0answers
13 views

How to reset quantity in input field when adding products from grouped products page?

I have my Magento 2.3.2 site configured so that adding products to the cart keeps the customer on the page (doesn't redirect to cart). When a customer adds any product to the cart from a grouped ...
0
votes
0answers
27 views

How to solve Add to cart not working in Magento 2?

Our "add to cart" button are not working... When we click on the button, the page refresh then nothing. Any ideas? https://stage.shopunder.com
0
votes
0answers
56 views

window.checkout is undefined

When I do an add to cart, nothing happens. I have this error in the console: TypeError: window.checkout is undefined For: images.js & minicart.js Thank you for your help.
0
votes
2answers
61 views

Magento2.3 - How to add the double Quantity when I click add to cart on the product page?

I want to add the double quantity when I click add to cart button using event in Magento2.3.2 which function I can override for this. Thanks in advance.
0
votes
0answers
115 views

Magento 2: Rest API “Checkout Cart Product Add After” event is not working

I have faced issue in checkout_cart_product_add_after event using add to cart rest API. Same add to cart event is working in website. But it is not working in Add to cart rest API. Add to cart API ...
0
votes
1answer
42 views

Is there any way in magento 2 to prevent user to add more than 1 product in cart

I want to set a limit of 1 product in the cart. Magento 2 C.E provides an option to set a limit of qty of a single product in the cart but that option allows two individual products in the cart. I ...
0
votes
0answers
22 views

Magento 2 custom add to cart button on product page

I want to create a new Add to Cart button which takes the value based on the result of a calulator I've add the calculator to catalog_product_view.xml <block class="Magento\Framework\View\Element\...
1
vote
1answer
57 views

Magento 2 : which event should I use when want to add free item in cart?

when purchase a Product X, want to add product Y automatically to code. It saves in cart but 'save' function is goes into loop because it also has event as 'checkout_cart_save_after'. events.xml <...
0
votes
0answers
24 views

Magento 2: Move Stock info above Add to cart

I know this questions has been posted other times, but in my case didn't solve the issue. I need to move the Stock info before the add to cart button (in the product page of course). I put this code ...
2
votes
1answer
40 views

Magento 1.9 :- How to add Area value dynamically

I want to add custom text area value when product added to cart
0
votes
1answer
31 views

Remove Item from Minicart throws Invalid Form Key error in Magento 1.9

I had installed a fresh setup of Magento ver 1.9.3.9 and when I add the product to cart and click on Remove Item from Minicart it gives me exception error and page goes to There has been an error ...
1
vote
1answer
20 views

Update Product Qty while product is being added to cart

I want to update qty to 2 when product is added to Cart. Basically I want that when a user ads a product to cart(qty is not visible for user), it is set to qty by default. I have created an observer ...
2
votes
1answer
42 views

How to move “addtocart” button to the left side in category view?

I'm pretty new to Magento2 and I'm trying to move elements inside category view. I would move my add to cart button to the right of the screen in category view, and my quantity box too. I've created ...
1
vote
0answers
31 views

Excess qty adding into cart when adding product in cart with custom option programmatically

I am using this the following code to add a product in cart with custom option value. But all the time cart qty taking the value of "Maximum Qty Allowed in Shopping Cart" and then adding 1. For ...
1
vote
1answer
145 views

Magento 2 : How to check product is in stock by color and size?

I want product can be pre order if not in stock. suppose, Product X has 3 sizes S,M and L. and colors Red, Blue and Black. At Product Details Page, If I select size L and Color black which is not in ...

1
2 3 4 5
20