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.

0
votes
0answers
10 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
11 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
19 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
16 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
16 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
46 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:...
0
votes
0answers
9 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
22 views

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

I want 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. Thanks in Advance :)
1
vote
0answers
5 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
23 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
23 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
14 views

How to disable add to cart when the product price is equal to 0

Is it possible to disable the add to cart button when the product price is 0 for: simple product configurable - more than one option swatches
0
votes
0answers
23 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
21 views

When adding product to cart programmatically, price shown is $0.00

<?php namespace Magedelight\Giftwrapper\Controller\Giftwrapper; use Magento\Store\Model\StoreManagerInterface; class AddNewItem extends \Magento\Framework\App\Action\Action { /** * @var \...
0
votes
0answers
16 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
10 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
40 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 ...
0
votes
0answers
13 views

M2 Related product add to cart with same quantity as product

We are using Related products on our site as product accessories. When our customers purchase two of a certain item, they often need two of the Related item as well. As the Related products are ...
1
vote
0answers
17 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
42 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
36 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
30 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
8 views

Need to add a button on a pop-up notification, it shows up when you add product to cart

when i add product to cart, there is a popup message that comes saying that you products has need added to the cart and there is a "Accept" button. I need to add another button over there saying "...
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
31 views

Magento 2 add product to cart redirecting to login page

I am trying to add product to cart. I used this code to add product in cart which is working fine for logged in user. If i am not logged in it redirect me to login page. I want to add product to cart ...
0
votes
0answers
29 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
25 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 %...
0
votes
1answer
28 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
22 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
32 views

How to update Magento cart items quantity using ajax?

I'm using this code for showing cart items quantity in my Magento 1 site. <span><?php echo Mage::helper('checkout/cart')->getCart()->getItemsCount(); ?></span> It's updating ...
0
votes
0answers
28 views

When click add to cart button in product details page I'm getting this error We can't add this item to your shopping cart right now. "

Log error code [2018-11-11 03:08:20] main.CRITICAL: cache_dir "tmp/" must be a directory {"exception":"[object] (Zend_Cache_Exception(code: 0): cache_dir \"tmp/\" must be a directory at /home/...
0
votes
0answers
13 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
36 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
34 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
19 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
40 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)
0
votes
1answer
53 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->...
0
votes
0answers
22 views

Configurable Product Add to Cart Issue

I have a configurable product with 4 associated product with it. When I go to configurable product and select a configurable option A and Add product to cart, product added in cart successfully. But ...
0
votes
0answers
25 views

Magento 2 Add to cart API with custom price

I am using following API for Add product to cart. http://{{magento2}}/rest/V1/carts/mine/items But i want to add custom price to cart. Anyone have idea about that ? $quote = $this->...
0
votes
0answers
14 views

Negative quatity is allowing while adding products in magento 2.2.6?

While adding the products from backend, in the quantity field if enter like -10 it is taking and product is saved. How should I prevent it or is there any reason for allowing negative quantity ?
1
vote
1answer
44 views

Frontend suddenly showing code

We now have 'code' on our frontend. See image. Please advise
0
votes
0answers
43 views

Magento wrong redirect after add to cart. 404 Page

I have a problem. In the moment that add product in cart, uenc parameter is wrong url to return after added product in cart generating not found page. I searched in whole place but I find nothing. ...
0
votes
1answer
34 views

Add to cart glide image animation | Fly to cart image animation. PHP/jQuery/JavaScript validation on successfully adding product to cart

I am trying to make a simple glide animation when adding product to the cart to indicate and "highlight" that the product was added. I managed to create a simple (not the best) glide animation for ...
0
votes
0answers
36 views

Magento 2 Ajax add to cart related products

So I've found the location to turn on ajax add to cart in the product page. I've also found where the; $showCart: true Lives to enable the related products to have an add to cart button on them. ...
1
vote
1answer
26 views

How to add multiple subproducts to the Magento 1.x cart at the same time?

I know there are already a lot of answers for how to add multiple products at once. I don't think this is a duplicate because here we are talking about subproducts not products. Currently on my ...
0
votes
1answer
58 views

Magento 2.2.5 How to add additional products to cart from new checkout step?

I'm a newbie in the Magento! I created the new checkout step "Additional Products" with 2 buttons - "next/skip" and "add to cart". I want to add required products to the cart, but I don't know what I ...
0
votes
0answers
17 views

How to update a url's param in Magento 2

if a customer tries to add to cart any product then he redirects to login/signup page. He login then -> redirect to after adding its product into cart to checkout. I have used Loginpost after plugin ...
0
votes
1answer
17 views

How can I change add to cart button on category page to saw view more and route to product page?

Instead of adding an item to the cart from the category page I would like to instead have it simply route to the product page.
0
votes
1answer
41 views

How to add buy now button on product page to checkout page with the quantities

I´m not a programmer but I'm running my shop with Magento, I tried to use the suggestion below to create a 'Buy Now' button and works fine. But add only 1 unit of the product. How can I do to add ...
1
vote
0answers
28 views

Home Page getting error when try add product in cart Magento 2

I have created my custom theme in magento and designed default.xml as per my requirement, everything is working fine but getting error when trying add product in cart from home page, also minicart ...