Questions tagged [addtocart]

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

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

Add to cart configurable product programatically magento2

I tried with add to cart configurable product but getting error when run the custom code using observer but same code when run from controller than it's working fine. you can see below code for bundle ...
2
votes
1answer
3k views

Magento 2 - Quantity Field on Related Products Listing

I'm trying to add a quantity field to the related products section on my product page. I'm overriding module-catalog/view/frontend/templates/product/list/items.phtml in my theme. So far, here is my '...
2
votes
1answer
4k views

Magento2 Add to Cart from homepage not working

I've set up a Magento v2.0.6 installation Running Luma theme. I've created a own template based on the Luma with some minor changes (removing links, adding custom CSS etc.) at least nothing big. I'm ...
2
votes
1answer
919 views

magento2 addtocart not working in chrome and extremely slow

I have magento2 installed on local machine the addto cart works in mozilla on product page how ever its extremely slow and on chrome it shows adding after addto cart but it does not add at all, there ...
2
votes
1answer
2k views

Add to cart configurable products using magento soap api V1

Trying to add configurable product in magento cart using magento soap api V1 but not able to add the products. can anyone please let me know the way how to do it. Any help would be appreciated.
2
votes
1answer
2k views

Error “Your session has expired” when click on add to cart in magento 2.3

I am new in magento, I am creating website in magento 2.3 and I have installed FreeGo theme in my magento website. But when i click on product's add to cart then it's giving me error--> Your ...
2
votes
2answers
287 views

How to add multiple products to cart programatically in Magento 2

This is the code snippet that I am using $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $quote = $objectManager->get('\Magento\Checkout\Model\Cart'); $_product = $...
2
votes
1answer
642 views

Before add to cart, how to get the simple product of configurable product which would be added?

Before add to cart, how to get the simple product of configurable product which would be added? Notice the Before, because I need compare the simple product attribute with products already in cart to ...
2
votes
2answers
452 views

Magento 2, Add Product in Cart in loop

i have written a small functionality, where i need to get data from XML or CSV and populate the data in the cart. I am able to read the data from the file and create an array of the items foreach ($...
2
votes
2answers
267 views

want to move the extra images section below the main image in all product pages [closed]

I am building an ecommerce website named "bookslab.in". I want to move the extra images of product down below the main image of the product. I am attaching the screenshot of where i want to move the ...
2
votes
2answers
193 views

Want to make zipcode text field as a “required” field on my product page of magento site [closed]

My website bookslab.in is almost ready. I am selling the books online. Now i am stuck on this problem. I want to make the zipcode field on my product page as a "required" field before users add the ...
2
votes
1answer
479 views

Magento Buy Now Button for Configurable Products

I Need Add a Buy Now Button For Direct Checkout. I Have Coded But Not Working For Configurable Products. If There Are Any Extension For That Please Suggest Me.
2
votes
3answers
4k views

Magento 2: How I can add Configurable products to cart from category view with selected options

Currently simple products added to cart works from category view. I want same it for configurable products with selected options should be add to cart from category view page. Currently when I select ...
2
votes
1answer
2k views

Adding items to order as order is placed

I am trying to add a zero cost product to all shopping carts at time of placing order. So far I have my observer setup and working as <events> <sales_order_place_before> <...
2
votes
1answer
2k views

Product specifications add [closed]

I just install magento. When I try to product add there already have many input field. I need some multiple extra field that's can be some time one entry some time multiple entry like extra option ...
2
votes
1answer
1k views

How to add particular product into cart programmatically at admin side

Many a times you have heard or seen about how to add particular product into shopping cart programmatically at frontend side. But I want to do the same at admin side. Suppose, I have product 'SLR ...
2
votes
2answers
9k views

Add to cart with custom option

I need help in adding cart with the additional custom option included on it I've looked around stackoverflow and stackexchange for the answer but sadly it failed and they only add product simply, and ...
2
votes
3answers
4k views

How to get available quantity of product?

I am adding products in cart programmatically. But whenever I enter quantity more than available, it gives me a 503 error. e.g. Lets say a product has 7 quantity saved in admin and out of 7, 3 is ...
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
44 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 ...
2
votes
2answers
61 views

Magento 2: Disable add to cart button for certain products in category page

I am doing a custom module and now I want to hide the 'add to cart' button for certain products. I have followed the https://magenticians.com/magento-2-disable-add-to-cart-button/ documentation and i ...
2
votes
1answer
40 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
362 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
240 views

How to implement ajax based toast notification for add to cart, wishlist and compare?

Is there any way to show toaster notification using jQuery for add to cart and wishlist and compare from product list page and detail page. Want to show some of the below toast notification after ...
2
votes
1answer
141 views

after magento upgrade 1.7.0.2 to 1.9.3.9 add to cart after blank screen open

URL like generate https://domain.com/stage/checkout/cart/add/uenc/ how to solve it this issue Thank you in advance!
2
votes
2answers
2k 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 ...
2
votes
1answer
181 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
392 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
3answers
6k views

Magento 2 add product to cart with custom price from the custom controller?

I have a created a product with price: 0, Now i would like to add a product with custom price from my custom controller. since i am submitting a custom form in the customer dashboard to my controller. ...
2
votes
1answer
757 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
491 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
1k 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
1k 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
885 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
630 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
3k 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
640 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
424 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
40 views

Magento 1.9 :- How to add Area value dynamically

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

Magento Add to cart button not showing for not logged visitors

Hello I'm new with the magento. I'm working with the 1.9.2.4 version and when I'm not logged the button add to cart doesn't appear. I tried to look in app/design/frontend/your-theme-package/theme-...
2
votes
2answers
1k views

Magento 2 How to Disable Add to Cart Button for Out of Stock Products

Magento 2.3 I have a 3rd part software I use for stock management so dont need Mangeto to manage my stock. If I set the manage stock option to no then the add to cart button on the product page is ...
2
votes
1answer
173 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
357 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
30 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 ...

1 2 3
4
5
20