Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [addtocart]

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

0
votes
0answers
21 views

How add to cart all children(product) of configurable product programetically?

my code that only adds first child product n number of time, but result is like all child product added to cart with it's options <?php namespace Vendor\Addall\Controller\Index; use Magento\...
1
vote
2answers
773 views

Magento 2 get quantity of product in cart without loop

I have written a controller in Magento 2 that adds products to the logged in users account. The controller is working properly however i am facing a slight issue. You cannot add a product to your ...
2
votes
2answers
144 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 = $...
0
votes
0answers
18 views

Add To Cart Not Working in Front Page

I am currently using an Magento theme Atstore, it comes with a module for the cart that provides the ability to add from the home page or catalog page without needing to get to the main item page. ...
0
votes
0answers
15 views

Magento 2 Clear cart is not working

In Magento 2.2.5, I dont want to maintain the cart items. I need only at the time of login to place order. It should be cleared once I logout or session expires. I used this persistent cart link. But ...
1
vote
0answers
22 views

magento 1 additional option of type file to cart programatically

i want to add custom option of file type while product is adding to cart. like i will be giving a customer an option to choose image from his computer, and when customer choose and hit add to cart ...
0
votes
0answers
18 views

Magento 1 show pop when product added to cart

Is there an easy way to show a popup that a product is added to the cart in Magento 1.9? The popup message itself will be no problem to create, but I need the code-part that checks and shows the ...
0
votes
1answer
116 views

Observer after product is added to cart

what is the name of the event that I can trigger after adding a product to the cart ? I need this : The customer adds a product to his cart Intercept the event thanks to the result of and API, add ...
0
votes
0answers
24 views

In Magento 2.2.5, Update the cart items with custom options

In Magento 2.2.5, I want to update the cart products with custom options. While adding to cart, It is added correctly and updated in quote_item_option table. While updating only qty is updated, ...
1
vote
0answers
11 views

How to get remain stock of product , if some of added in cart

I am just modifying magento add to cart ajax functionality. I want to check remain quantity of product if some is added to cart. But i tried ,many ways but i did not success. Instead of message ...
0
votes
1answer
65 views

Magento 2.2.1 - Disable Add to Cart for Specific Products

I need to figure out a way to disable the "Add to Cart" button on specific products. I found this link, but it creates a full attribute set which I don't want to do. How can you add an attribute and ...
0
votes
0answers
27 views

Add to Cart doesn't work in Chrome Browser, Safari and Microsoft edge

add to cart does not work in all browsers. while click add to cart mini icon it shows {"product_name":"ACCU CHEK ACTIVE 10'S STRIPS","message":"ACCU CHEK ACTIVE 10'S STRIPS was added into cart.","r":"...
1
vote
0answers
26 views

how to show different prices for login and non-login user on cart page in magento 1.9

There are two prices one for login user and other one is for non login user but when i click add to cart button it show login customers prices to non-login customers please help how can i fix this.
0
votes
1answer
73 views

Magento 2: Cache problem Cart items drops

Have been struggling with this problem for some time now and its a bit confusing. The problem is the following that my cart drops the products added when I visit a new category on the site. When FPC ...
0
votes
0answers
174 views

Magento 2.2.3 CE unable to add/remove item from wishlist?

We are getting facing an error message when we add (or) remove item from wishlist in magento 2.2.3 CE can you please advise? ? we didn't write any custom code from custom module. Fatal error: ...
0
votes
0answers
28 views

Uncaught Error: Unable to process binding

In my Magento 2.1 website, I didn't change anything but suddenly getting this error in my console. Because of JS mini cart and checkout process is not working knockout.js:3012 Uncaught Error: Unable ...
0
votes
0answers
59 views

How to move add to cart at the last for each product in product list page magento 2?

How to move add to cart at the last for each product in product list page magento 2?
0
votes
0answers
25 views

Custom add to cart button results in 'We can't find product error'

I'm trying to add a custom add to cart button to the product detail page that adds a separate/featured product to the cart. I'm using the following code to add the button for the product <?php $...
0
votes
1answer
35 views

How to enforce minimum quantity for a given sku?

I am seeking a way to enforce minimum order quantities for an individual SKU. This is for a member's only wholesale only website. Example: SKU: X6T, which has four color options (red,white,blue,amber)...
0
votes
0answers
26 views

Magento 2. How do I select all the products of specific category

I want to hide the price for specific category using System.xml now I don't know how to hide prices for all the products available in specific Category like I want to hide prices of Men then how can I ...
0
votes
0answers
20 views

Qty in cart always 1 for every product?

I am running a Magento 1.9.3.7 store with the Ultimo theme. No matter what I enter in the qty box on the product page, the number is always 1 ion the cart. I debugged a little and figured that there ...
1
vote
0answers
17 views

Magento 2. How to get every single Product ID

I'm trying to get Category ID and as well Product Id Like I want to get it for to show all 'add to cart' button for specific category if you can help me that how can I hide 'add to cart' button for ...
1
vote
1answer
31 views

Add to cart not working in custom template magento2

I am getting add to cart url by product object like below. Block file. use Magento\Catalog\Api\ProductRepositoryInterface; use \Magento\Checkout\Helper\Cart as CartHelper; class CustomAdd ...
3
votes
2answers
121 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.
0
votes
0answers
24 views

Magento 2. trying to hide Price while not logged In [duplicate]

I am trying to hide the price n its works perfectly but the issue is the price cannot be hidden for limit price. Dangs/Hideprice/etc/adminhtml/system.xml <?xml version="1.0"?> <config ...
2
votes
1answer
623 views

Magento 2 . How to hide 'Add to cart' button while not logged in

This is how I tried but its not working Bodak/DisableAddToCart/etc/adminhtml/system.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
0answers
23 views

Query string to add product and apply promo code: M2

I currently have set up a query string that automatically adds a set amount of products to the users cart when they click a specific button. I already have everything set with with the FormKey() and ...
1
vote
0answers
28 views

Magento 2 How to hide price of product and add to cart button and Show a custom Link if not logged in [duplicate]

How to Hide the Price of the product and also add to cart button if the user is not logged in and want to give a link in place of Add to cart button to Login.
1
vote
0answers
36 views

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 ...
1
vote
1answer
67 views

Floating fixed position cart

I need to add floating cart with product count in my site(screenshot_1). Which is now in header minicart. I need to fix minicart in right side of my site. How I can do that? screenshot_1
0
votes
0answers
41 views

add to cart programmatically doesn't work

I'm building rest api to dd product to cart but it doesn't work and returns quote = null. here is my code /** * @api * @param int $productId * @return \Magento\Quote\Model\Quote */ public function ...
0
votes
0answers
60 views

Magento 2 in Add to Cart page Remove item not working

Magento 2 in Add to Cart page Remove item not working. After Login Add to Cart page Remove Item not working?
0
votes
0answers
58 views

How to add bundled product to cart programmatically in Magento 1.9?

I am trying to add the bundled product to cart programmatically, Still, I didn't get any solution. I have tried to add the configurable product to cart, That is working fine. this is the code I have ...
0
votes
0answers
88 views

Magento2 How to resolve the error “we can't add product to shoppingcart right now ”?

When I am trying to add any product to cart in product view page it showing error "we can't add product to shoppingcart right now".The product having quantity also still it's showing like this.please ...
0
votes
1answer
673 views

Magento 2- How to move custom options after cart button?

I want to move custom options below Add to Cart button and also want to move short description within form tag.How can I achieve this? Also I want to know why my custom php code not working in ...
1
vote
0answers
22 views

Getting error while adding image of product to cart using RSET API

I am facing one issue. I am adding configurable product to cart with its image,size and color but getting the below error using magento-2 REST API. Error: {"message":"The image content must be ...
1
vote
0answers
230 views

Custom Add to Cart on Bundle product page: Magento2

I want to customize my bundle product page on magento2 store and want different "add to cart" buttons for all the simple products of that bundle product i.e. if there are 3 products available in a ...
1
vote
0answers
123 views

How to add “Add To Cart” Pop Up Magento 2 Custom theme? [closed]

Here i am trying to add a pop-up once product added to cart using custom theme magento 2?? I tried this link
0
votes
1answer
83 views

Why Add to cart not working for complete magento 2 website in Internet Explorer

Here in our website Addtocart option not working in magento 2 for Internet Explorer latest version also.
0
votes
0answers
14 views

Addtocart block not being called for downloadable product

I have just setup a new website/store and am trying to add downloadable products. The issue I'm having is that the product page is not calling the addtocart block which is called from within catalog/...
0
votes
0answers
109 views

Magento 2| How to add “Add to cart” Button functionality in jQuery?

I am adding "Add to cart" button functionality in jQuery function for calculated product quantity. I have add simple button yet. I have doing it as: My function is: $(document).ready(function(){ ...
1
vote
1answer
223 views

Could not create cart for customer using magento-2 REST API

I need to create cart and get the quote id for the customer using magento-2 REST API but I am getting the following error. Error: stdClass Object ( [message] => No such entity with %...
1
vote
1answer
192 views

Magento 2 : Add product to cart as per customer with custom price programmatically

I need to add product to cart as per customer vise with custom price. I'm trying by below code. But, it returns error Uncaught TypeError: Argument 1 passed to Magento\Quote\Model\Quote::...
0
votes
1answer
35 views

Products can not be added to cart by click “Add to cart” for second time

I have Related products block in my product description page. I have configured a particular product's Minimum Qty = 5. So users can only buy products in multiples of 5. Below is the screenshot of ...
0
votes
0answers
37 views

Direct add to cart link in product grid for children products of a configurable parent in M1.x using getAddUrl

we sell clothing in sizes. On the product grid (category page) we want to show the available sizes. Requested behavior: A customer can click on the size and it will automagically add the product to ...
0
votes
1answer
125 views

Add to cart button from controller layout cause redirect to controller url

I've got controller that render products in .phtml with add to cart button and return it via layout to ajax. When i hit the add to cart button this makes redirect to controller page. I need to reload ...
1
vote
1answer
59 views

Change text and Relink the “Add To Cart” button in the product list page (list.phtml)

Do you know how to Change text and Relink the "Add To Cart" button in the product list page (need to change code in the file list.phtml). In my magento server, the list.phtml file is located in the ...
0
votes
2answers
32 views

Get param : Controller of custom product interface

I've created a page where I have a list of products. In each row (1 row = 1 product), I have a button "add to cart" : <?php $postParams = $block->getAddToCartPostParams($_product); ?> <...
0
votes
1answer
73 views

Show Pop Up when click on Add to cart checkbox for related products Magento 2.1.7?

How to show Pop Up when clicking on Add to cart checkbox for related products Magento 2.1.7? The pop-up message should be (The product has been added to cart)
1
vote
1answer
513 views

Magento 2 - Programatically adding product to cart adds item with price of zero

When adding a product to the cart programatically, the product is added with a price of zero. Having read other questions on here with similar requests, I have added in $this->quote->...