Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
2answers
54 views

Remove block from layout depends on condition

I want to remove block product.info.addtocart from layout depends on some conditions
1
vote
1answer
18 views

Magento 2 Bundle Product Add To Cart Like Simple Product

We have bundle products that are just groupings of simple products. I have disabled all options for the bundle products so that customers can't edit quantities etc. because I want them to act like ...
1
vote
0answers
37 views

Expected to start loader but did not find one in the dom - Ajax Call Magento 2

I have implemented Ajax call to add product to cart, which is somewhat like below: $.ajax({ showLoader: true, url: SERVER_URL+'common/custompurchase/addtocart', data: data, type: "...
2
votes
0answers
19 views

how to edit quantity in cart with ajax magento 2?

I'd like to know how to change the quantity of a product on front using ajax ? When I change the quantity in the input and them click on the small pencil to apply modification, I'm redirected to the ...
0
votes
0answers
16 views

How to get Child product according to option selected from Configurable product Magento2

I have this code in my addtocart : <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->get('Magento\Framework\Registry')->registry(...
0
votes
1answer
21 views

Can't add items to cart in Magento 1.7

I'm working on migrating my site over to a new server and everything is up and running, except when I go to add an item into stock it doesn't work. I am not getting a Magento error nor is it ...
0
votes
0answers
15 views

Tier Price is not working in magento 1.9.3

when I put the products price $204.75 and tier price 190.95 and add to cart 25 products. when I show my shipping cart, they still show the actual prize not tier price but why? enter image description ...
0
votes
0answers
23 views

Magento 2.2 - Update product custom option label after Add to cart process

I want to update product custom option value after Add to cart process in the cart, checkout, email and etc. Does have any idea about this?
4
votes
3answers
175 views

Change “add to cart” text for not registered users

What the best way to change text add to cart only for not registered users? Documentation recommend change dictionary file. https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/translations/...
0
votes
0answers
21 views

How to change row subtotal with custom price in cart?

I need to change row subtotal with custom price. Product X : $90 Applied Catalog Discount : $80 User trying to add : 4 Qty User can only purchase 3 items with discounted price. For the remaining ...
0
votes
1answer
30 views

How to add a product with two line items

I want to add a product with two line items. Say for example if i add Product A with qty of 4. I need to split cart into two line items. 3 qty as one line item and 1 is in another. How Can I achieve ...
0
votes
1answer
21 views

Disable add to cart button if quantity more than one in magento 1.9

I want to disable add to cart button if quantity more than one in magento 1.9
0
votes
2answers
79 views

Add multiple items to cart in Magento2

I am implementing add to cart functionality from ajax using product id. This is my code of template file <tr class="border_bottom child-items selected"> <td >...
0
votes
0answers
16 views

Additional Add to Cart Button

I am trying to create a secondary "Add to Cart" button which will add a product to cart, like "normal", but will add an additional Get/Post Parameter. By "normal", I mean, it sends all form data; ...
0
votes
0answers
18 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
195 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
124 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
13 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
13 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 ...
0
votes
0answers
9 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
31 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
17 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
8 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
57 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
17 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":"...
0
votes
0answers
20 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
37 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
77 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
19 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
33 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
10 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
25 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
18 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
17 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
14 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
26 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 ...
2
votes
2answers
27 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 if you guys help me it will be a really glad for me Thanks in advance
0
votes
0answers
19 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
101 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
14 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 ...
0
votes
0answers
25 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
14 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 ...
0
votes
1answer
33 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
26 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
38 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
22 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
35 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
170 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
19 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
113 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 ...