Questions tagged [addtocart]

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

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

Add to Cart Not Working - Magento 2

Magento 2.1.2 PHP Version: 5.6.17 MySQL Version: 5.6.33 The store is completely set up, designed and in production mode. Braintree payment method is set up. Categories and products are created. ...
3
votes
0answers
1k views

Your session has expired magento 2.3 [closed]

when i want add to cart product it showing error Your session has expired how i solve this problem.
3
votes
2answers
132 views

Magento 2. how to hide 'Add to cart button' using Plugins

How to Hide 'Add to cart' button using Plugins.I'm stuck in to hide add to cart button.
3
votes
1answer
181 views

Magento 2: Proper way to utilize “ajax:addToCart” event

I found the following codes in /vendor/magento/module-catalog/view/frontend/web/js/catalog-add-to-cart.js at around line 100, when I was trying to find ways to add some custom JS handling after ...
3
votes
2answers
79 views

custom option when product add to cart in magento 2.2.5

<?php namespace Ecomsolver\Measurement\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\App\RequestInterface; class SetAdditionalOptions implements ...
3
votes
1answer
107 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.
3
votes
3answers
2k views

Magento 2: Add multiple products to cart programmatically

Following is the event observer for adding multiple products into cart: <?php namespace Namespace\Module\Observer; class ThirdPartyAdd implements \Magento\Framework\Event\ObserverInterface { ...
3
votes
2answers
3k views

Add to cart button not working on product pages [closed]

Recently I started to make some changes on my Magento website, and now the add to cart button isn't working on the product view page. I have tried things such as changing the code in view.phtml and ...
3
votes
1answer
92 views

Magento 1 : How to disable product price update on the front-end when changing a product Qty

I want to disable the price update with qty. In default magento price calculation is "Product PriceXQty". I want to disable it and total price in the cart is product price only.
3
votes
2answers
1k views

Add to Cart button in Magento 2.1

I tried with button add to cart and it not working, app/code/Moo/Custom/view/product.phtml <?php $product = $this->getData('product'); $postDataHelper = $this->helper('Magento\Framework\...
3
votes
1answer
812 views

How to share cart for guest users between multi stores with different domain

I am able to share my cart for logged in customers while switching between two stores with different domain URLs. However, I could not implement the same for guest users. I know the cart details are ...
3
votes
0answers
226 views

Magento 2 - Add To Cart Button Direct To Product Details With Non Required Options

I am on Magento 2.1.1 and I am trying to change the Add to Cart button behaviour in Grid / List Views. At the moment, the add to cart button only directs the customer to the product detail page if ...
3
votes
2answers
2k views

How to override cart\addcontroller in magento 2?

I want this function in \code \StwBuyXGetY \BuyXGetY \Controller\Checkout\Cart\Add.php(this is written in magento 1.9, I want to convert it into magento 2). But I cant add any new function in add ...
3
votes
0answers
74 views

adding an item to the shopping cart does not add the first time; it does add the second time

This has been happening for a long time - when I add an item to the shopping cart the first time - it does not add to cart! The second time it does add... My Magento version is Magento 1.9.1.0 This ...
3
votes
0answers
1k views

Is there any way that one swatch is selected by default (magento configurable swatches)

I am trying use Magento Configurable swatches in my website (for colors). But I am facing some issues, in Product details page, we have to select one color swatch. In Product Listing Page, we are ...
3
votes
1answer
211 views

SOAP API to build cart for frontend - should I be worried? session collision or cart loss?

My developer has written PHP code on his CMS that connects via SOAP on behalf of the user browsing the site, to manage the cart from their CMS. I'm worried about the interaction of SOAP session (...
3
votes
0answers
1k views

Wishlist - Add all to cart goes to 404 page instead [closed]

When I click "Add All to Cart" on the wishlist page, I get a 404 error and the address in the bar is http://www.blahblahblah.com/wishlist/index/allcart/. The items are not added to cart. A slightly ...
2
votes
5answers
2k views

Add to cart button brings you to an empty cart for certain products need help troubleshooting!

So not one person in all of this section can help troubleshoot session issues? NOTE I've completely updated my question as this was never resolved: EDIT: I just noticed that while I set 777 on var/...
2
votes
2answers
11k views

I want to use ADD TO CART via URL in Magento 1.8 but don't know which files to change

I have seen some suggested changes to make to call the FORM KEY to allow the ADD TO CART FROM URL to work. <?php $formKey = Mage::getSingleton('core/session')->getFormKey();?> <form ...
2
votes
2answers
2k views

How to get Product Submit Url on Category page?

On product page the product form has given action = <?php echo $this->getSubmitUrl($_product) ?>. I want to get this submit url on category page for each product but on category page it ...
2
votes
1answer
3k views

Magento 1.9 How to add buy now button in product page?

I am using magento 1.9, I want to add BUY NOW button on product details page, Buy now button redirect to checkout page. I tried many solution already solved in this forum, But all the solutions are ...
2
votes
2answers
2k views

Making non-customisable bundles in Magento 2

I am trying to remove the options from bundles (in Magento 2), so that Bundle Items can be added straight to the Cart without users being able to customise these options. I thought the easiest way to ...
2
votes
1answer
9k views

Magento 2 programatically add product to cart? [duplicate]

We have a requirement that we wants to add product to cart programmatically in magento2.
2
votes
2answers
6k views

How to create and add 'buy now' button along with add to cart button on each product?

I am new to Magento, using Magento 1.9. with a custom theme. I successfully created buy now button on addtocart.phtml by the following codes <button type="button" title="Buy Now" class="button btn-...
2
votes
2answers
3k views

Add product to cart from email link

I am running a promotion and would like to make it very easy for customers to add three items to their shopping carts. The research I have done around URL querystrings no longer seems to work on ...
2
votes
1answer
1k views

Magento 2 Some item options or their combination are not currently available

We have installed Magento ver. 2.1.6. using composer with sample data. We have call event checkout_cart_product_add_after for adding addition information with item. The event observer code is given ...
2
votes
3answers
7k views

“Add to Cart” button on CMS Page - non product page

So, I am seeking a way to give my customers the ability to add a product to the Magento shopping cart directly from a standard non-product page (i.e. CMS). I am using Community Edition 1.9 and from ...
2
votes
1answer
9k views

Magento 1.9 cart not updating

I have been trying add products to cart via ajax call by following the procedure given in http://excellencemagentoblog.com/magento-add-product-to-cart-ajax and I have successfully added products to ...
2
votes
2answers
3k views

Magento2 catch ajax complete, add to cart

I'm building an custom mini-cart. I want it to update itself when an article is added to the cart. I'm trying to do this by jQuery with catching the ajax complete, but can't get it to work. Can anyone ...
2
votes
2answers
2k 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
944 views

Magento2 - Ajax Add to Cart - Out of stock situation - Stop redirect and show message dynamically

I have implemented Ajax to my "Add to Cart" button so that customers can add products to their cart without reloading the page. Here is bare minimum of code which I used in order to achieve ...
2
votes
1answer
2k 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
883 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
2answers
271 views

Cart & Checkout blank Magento 2.3 after trying to add product to cart

In Magento 2.3 I am attempting to add an item to cart, however the cart shows empty and if I 'proceed to checkout' the checkout page is blank with just the loading gif icon. If I go to 'checkout/cart'...
2
votes
2answers
154 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
3answers
4k 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
4answers
4k views

Error when adding to cart 'No such entity with id = 0'

When I add a product to my cart I get the following error: No such entity with id = 0 This happens with every product in the store, can anyone help point me in the right direction?
2
votes
2answers
358 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
228 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
186 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
439 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
3k 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
1k 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
8k 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/...