Questions tagged [addtocart]

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

Filter by
Sorted by
Tagged with
2
votes
3answers
3k views

Add to Cart from Wishlist not working

Maybe something is amiss with my Theme - but when I go into Wishlist and choose "add to cart" next to the item in the wishlist, nothing happens. No error or anything like that. You just click it and ...
2
votes
2answers
2k views

Adding a Product to the Cart via Querystring using SKU

I know that we can adding a product to cart via querystring. but how do we add sku to cart via querystring in url without including product id like this : domain/checkout/cart/add?sku=ABC or domain/...
2
votes
1answer
3k views

Adding multiple products to cart failing

Assuming I want to create a link for the customer to click on that automatically adds some items to cart and redirects them to the cart. I created a controller that adds two items to cart, problem is,...
2
votes
3answers
5k views

add to cart button on featured products is not working [closed]

please visit this link : on home page, "add to cart button" on featured products is not working.
2
votes
1answer
30 views

Magento add to cart not working after cache

flurys.digifrizz.com is the site. In home page magento add to cart not working after cached. here is the custom_home.xml <?xml version="1.0" encoding="UTF-8"?> <page xmlns:xsi="http://www....
2
votes
1answer
60 views

Add existing custom option to cart item if the option was not included initially

I can update existing cart values: $item = $quote->getItemById($itemId); $item->getOptionByCode('option_code')->setValue($value); $item->saveItemOptions(); But this only works if the ...
2
votes
1answer
721 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 ...
2
votes
1answer
171 views

Magento 2.1.11 add to cart not working

I've upgraded my M2 CE from 2.1.3 to 2.1.11. Everything seems to be working, but I can't add product to cart. From any location on the website. There's nothing is reports nor log files. When I click ...
2
votes
1answer
346 views

Magento 2 add multiple variations configurable product to cart at one time

I am trying to add multiple variations configurable product to cart at one time but it shows following error jquery.js:9666 POST http://127.0.0.1/magento216/checkout/cart/add/uenc/...
2
votes
1answer
559 views

getBlock('cart_sidebar') is null on Checkout_Cartcontroller override

I'm trying to follow this tutorial: http://excellencemagentoblog.com/blog/2011/10/04/magento-add-product-to-cart-ajax/ It seems it's working, it adds the product to the cart, but it don't update it, ...
2
votes
2answers
435 views

How to add quote Item id as new field?

I have a new field varient_id in sales_flat_quote_item and sales_flat_order_item table. I want to save item_id as varient_id in sales_flat_quote_item and sales_flat_order_item table. ie,quote ...
2
votes
1answer
978 views

add class in button after product add to cart

In product listing grid/list view mode after added product to cart with ajax, Need add custom class in button (Add To Cart) . Can i create some observer js or i must rewrite standard methods ?
2
votes
2answers
816 views

magento1.9 : Check if the customer already exist or not?

How to check whether the customer is already registered user or new user. If they are a new user the product add to cart logic should be different, If they are a registered user the product add to ...
2
votes
1answer
818 views

add to cart products with max qty of products error with run script

add to cart products with max qty of products with below code include 'app/Mage.php'; Mage::app(); Mage::getSingleton('core/session', array('name' => 'frontend')); // Need for start the session ...
2
votes
3answers
3k views

Quantity in checkout shopping cart doesn't work properly for Magento

On live server the cart is working correctly. I change the quantity of a product in the cart then I push the "Update cart" button and all works fine. I transferred the site another domain and the cart ...
2
votes
1answer
604 views

Redirect “Add to Cart” from Category page to CMS page

On my category page, if the user clicks "Add to Cart", then I want to add that product to their cart and then redirect to a CMS page. I've seen the other solutions available, but none of them seem to ...
2
votes
2answers
2k views

Price update in Add to cart functionality from product detail page to cart page

Can anyone tell me in magento, when we click Add to Cart button in product detail page, where and how is Product Price and Qty input multiplied and updated in shopping cart page Subtotal column. I ...
2
votes
1answer
628 views

Madison Island View details and Add to cart

I am new to Magento so please forgive me if my question sounds foolish. I have the default Madison Island template which was there when i installed magento. I noticed that if you are looking on ...
2
votes
1answer
4k views

Remove or Stop item to cart from observer

Is there any way that we can remove the Items from the cart. Actually I have dynamic Grouped products were I need to allow the user to buy the item inside the grouped product. Now when someone only ...
2
votes
2answers
1k views

Translate Add to Cart button

We tried to change the Add to Cart button from 'out of stock' to '4-5 business days' for out of stock products using translate inline, which was simple enough. However, although the text was changed, ...
2
votes
1answer
406 views

How to share data between Observers?

My fellow devs! I am attempting to change the standard "add to cart" functionality to include AJAX. I've taken on board advice that overloading addAction method in the Checkout/CartController.php ...
2
votes
1answer
101 views

Add configure product in Cart using Magento 2 API facing an issue

Here's the url http://<magento host>/rest/default/V1/carts/mine/items Method POST Headers Authentication :: Bearer <customer token> Content-Type :: application/json Body json data ...
2
votes
2answers
113 views

Limit order total for customer in magento2?

Can we restrict customer for add to cart once his quote total crosses specific count? For example i need to restrict customer add to cart action, once the subtotal in quote crosses 500. I have ...
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 ...
2
votes
1answer
95 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 ...
2
votes
1answer
372 views

How to add to cart from external site?

I created a landing page on an external site and I want to be able to add to cart from that external site. Is there any hack I can use to do this? Is there a custom URL I can use? I am using Magento 2....
2
votes
2answers
786 views

Add to Cart is not working - Magento 2.2 - with Browser: Chrome v61.0

I am having a problem with, Add To Cart on both Listing page and Product page. When I am adding a product to the cart from listing page, it's showing the cart page with no products. (see the below ...
2
votes
1answer
1k views

Show Pop Up when click on Add to cart Magento 2

Is there any mistake in this code or file structure ? link i followed what i did 1)app/code/SomeName/AddCartPopUp/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::...
2
votes
1answer
246 views

Can't override template file in Magento 2.1 module

I'm trying to override Magento's built-in addtocart.phtml file, but nothing I try seems to be working. I Have a module named QuantityDropdown under the Rethink namespace. As far as I can see it's ...
2
votes
1answer
728 views

Magento2: How to add Bundle Product in cart via REST API?

I need to add a bundle product in cart via REST API. Is there any sample code by which I can pass only SKU code and bundle product will add into cart. Please help me in this.
2
votes
1answer
1k views

magento 2 Adding one more Add to cart button

How to add one more add to cart button in magento 2 product view page and working of 2 buttons are independently [not conflict one button to another button] and validations also must to add product to ...
2
votes
1answer
2k views

Magento 2: Change the action of add to cart button on product and category pages to checkout page?

I am new to Magento 2 and want to change the action of add to cart button on product and category pages directly to the checkout page. Magento 2: Skipping Shopping Cart Page after Add to Cart I ...
2
votes
1answer
2k views

Add to Cart in custom block Homepage Magento 2

I am trying to add a Add to cart button in a custom block being added to the homepage. I've looked at many SO / MSE posts and all refer to Object Manager but I know it's not meant to be used, and ...
2
votes
2answers
1k views

Magento Community form key from external site url

I have an requirement to allow products to add to the cart from an external link, like in an email campaign. I've created an observer to allow a form key to be added to the url if it doesn't exist, ...
2
votes
1answer
314 views

Buy now and add to cart in magento [duplicate]

I need an add to cart and buy now button. It is working fine but when I click buy now button, nothing is happening and after a couple of seconds the page is redirecting to the cart page. I need to ...
2
votes
1answer
302 views

Check tier price is applied or not to product

How can I check whether tier price is applied or not after add product to the cart ?
2
votes
1answer
1k views

Add to cart url do not work

I have generated an add to cart url on the frontend, but it do not seem to work. When I click on the link, I get the "You have no items in your shopping cart." page. I have got this add to cart url ...
2
votes
1answer
828 views

Redirect to checkout on add to cart click

I need to have two buttons on my product page one with title buy now and second add to cart On click of "add to cart" it needs to follow the normal add to cart process while on click of buy now it ...
2
votes
3answers
915 views

Bundle product add to cart issue : Call to a member function getPosition() on a non-object

I am facing very weird issue on my server while adding bundle product in the shopping cart.Whenever I am trying to add my bundle product, it gives me error like Fatal error: Call to a member function ...
2
votes
1answer
218 views

Magento Add product to cart programmatically - Works in one website, fails in other

I have a magento store with two websites for Italian and Spanish market. I perform a php page to add items to cart programatically, but it works in Spain but not in Italy. See sample code that works ...
2
votes
2answers
2k views

I can't add to cart the first time

I am trying fix bug with Add to cart. I have 3 stores - Production, QA and local versions. When I press add to cart from list or product pages it load empty cart. If I try add the same product second ...
2
votes
1answer
926 views

How to get item's weight and row_weight on sales_quote_item_save_after

I would like to extract some information from a Mage_Sales_Model_Quote_Item object while adding a product to the cart with the sales_quote_item_save_after event. When I add a configurable product to ...
2
votes
1answer
349 views

Add to cart button in Reorder sidebar not working

Code in file app/design/frontend/base/default/template/sales/reorder/sidebar.phtml <?php $_items = $this->getItems()?> <?php if($_items): ?> <div class="block block-reorder"> ...
2
votes
1answer
120 views

Magento Checkout page as home page

I have only one product and I have to sell directly and not via product page or home page. When visiting the site URL it should directly add a product into the cart and redirect to checkout page.
2
votes
1answer
215 views

What is the use of using address in quote object while calculating total of cart(table: sales_flat_quote_address)

Please explain why magento involve address while calculating grand total and other calculations while calling collectTotals() in saving cart.It involve table sales_flat_quote_address while interacting ...
2
votes
2answers
1k views

How do I remove the Add to Cart button from Wishlist based on specific products?

I have already removed the "Add to Cart" button from both the Product Detail page and the Product List/Grid Page based on an attribute. I now need to be able to remove the button from Wishlist and ...
2
votes
1answer
2k views

Magento Ajax cart remove items not working in mini cart

I have created the custom ajax cart in magento,in that mini cart is updated without loading the page.But in that remove items link is not working,it is been redirecting to ajaxDelete action url(for eg:...
2
votes
1answer
5k views

Display Out of Stock product and disable Add to Cart button

I have a store where product quantity are set to 0. I have enabled back orders if qty is 0 for a product, however I would like to disable Add to cart in case product is out of stock. This means Add to ...
2
votes
2answers
2k views

add to cart button to refresh the page

I have a feature in my cart where the customer can pick to add last minute deals to their shopping carts and for products which are grouped products a pop up box appears showing the different options ...
2
votes
1answer
6k views

Add to cart button wont work

I found this code through Google to add a Button to my shopping cart page under where I have some products begin displayed. However when I click on the button, it redirects me to the shopping cart but ...