Questions tagged [addtocart]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Notify Customer on Product/category page that this item already in cart

I have to notify the customer that this product is already in the cart on the product page and category page too before Add to cart Button like product page For Category Page I have tried to get ...
0
votes
0answers
6 views

How to keep 'In stock' even though the qty is 0 after a csv file import

We are currently running a cron job to import sku, qty, and price every 30 min. If the qty for a product becomes 0, the stock status changes from 'In stock' to 'Out of stock' automatically, 'Add to ...
0
votes
0answers
25 views

Minicart and add to cart success message is not showing after product added to cart in Magento 2.3.3

Hello, I am facing an issue during add to cart. When a product added to cart then minicart is not loading also flash message is not showing. This is my product details page url "http://127.0.0.1/...
0
votes
1answer
27 views

Fill HTML space while KnockoutJS renders

I'm doing an extension for the shopping cart which consists on adding and removing quantities using + and - buttons without reloading the whole page. Thus I'm using Ajax for sending the request and ...
0
votes
1answer
17 views

Can't find the option to exclude SKU

I can't find this screen: I'm trying to exclude an SKU from a cart rule, How do I get to it? I got here: And I can't see where there's an option to choose SKU.
0
votes
0answers
19 views

Magento 2: Disable redirection to product page if requested quantity is not available on add to cart function

On catalog category page, when I add any product to cart and the requested quantity is not available, it redirects to product page and shows error message there. What I want is to display error ...
0
votes
0answers
11 views

Magento add to cart in sub domain not working

I have configured a staging environment from the live environment. I have completely copied all files and the exact database of live and configured staging. But, the issue is I can add to the cart in ...
0
votes
1answer
14 views

How to add only one product using Magento 2 REST API?

I am using REST API for Magento 2. I want to add 1 product only in Cart using REST API. Like if cart is empty one product is added is cart and if one product is in cart then remove that existing ...
0
votes
0answers
16 views

Can anyone resolve this issues? Two buttons (add to cart )are coming with the disabled mode

I need to apply the code for the add to cart button but it is coming in disabled mode hence unable to do the required changes.strong text
0
votes
1answer
24 views

Magento 2 : Double qty before add to cart

how to change the functionality of add to cart button like I click on add to cart then qty should be doubled? <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for ...
0
votes
0answers
22 views

magento 1.9 redirect to cart page

i am using magento 1.9 i have some products on home page and on category pages there is a button called "Buy Now" when user click on the button its make redirect to "Add cart" page,...
0
votes
1answer
14 views

Magento 2 - Show modal if no quote shipping address

I am trying to alert the user that they have not added a postcode into their session when clicking "Add to cart" I have created a mixin, "catalog-add-to-cart-mixin.js" within my ...
0
votes
0answers
19 views

Need to modify the product detail page for adding a button beside the add to cart button

<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** @var $block \Magento\Catalog\Block\Product\View */ ?> <?php $_product = $block->...
0
votes
1answer
13 views

Upsell products in drawer cart

So, after i add an item to cart it will open a drawer with the information of that product added to cart and below that all his upsell products. In my CartController.php the code is like that: $...
0
votes
1answer
53 views

Magento 2: Change “Add to Cart” Button text When item is removed from the minicart

I rename the "addtocart" button text to "item in cart" when product is in cart. but if i remove item from minicart at that time i want to again set button text as "addtocart&...
0
votes
2answers
79 views

Magento 2: Change “Add to cart” button text to “Item in Cart” when item is added to cart

I want to rename the add to cart button as soon as the product is added to cart.
0
votes
1answer
46 views

Second add to cart button on product page does not add related products - Magento 2.4.2

We have a second add to cart button on our product page, using the following code, see below. But when a related product is checked and this second add to cart button is clicked, the related product ...
0
votes
0answers
15 views

Magento2: CA UK domain Add to cart not working

I have 2 other domains on my server. CA and UK, I am trying to add to cart product but nothing is happening. No log, No any error, Just AJAX called and then stop with success message: {"cart"...
0
votes
1answer
28 views

Magento 2 : Issue with cart rule

I have created a custom cart rule "Percent of product original price discount" I am checking If coupon discount is better deal than special price for the customer then to use the coupon ...
0
votes
1answer
26 views

how to get child item object while adding to cart?

I wanna put customize the code with qty while adding to cart product. For that I have created Plugin Magento\Quote\Model\Quote\Item and used addQty() method,but in this method I call quoteItem object. ...
0
votes
1answer
24 views

I have added one custom attribute for product named percentage. How can I add that attribute to product price after adding that product into cart?

I have tried below code. However its working fine but other products for which custom attribute is not being added from admin, I am not able to add to cart such products.
0
votes
1answer
25 views

Magento 2 Add product to cart programmatically returning to original price

I have a product of $1, because I change the price later. What I'm doing is that I send the price on an Ajax request to a Controller, just like this: $.ajax({ ...
0
votes
0answers
17 views

Redirecting to cart after product added to cart

Magento 2.3.5 Having some trouble getting a module I've been working on to redirect to cart after altering the cart contents. As you'll see below I started with Gaiterjones's BuyXGetY module (https://...
0
votes
0answers
19 views

Add multiple items to cart while saving cart

I've run into a problem with my code when I try to add multiple items to my cart. I've added a product with the ID of 7 to the cart and then i'm trying to add a product with an ID of 8 to the cart, ...
0
votes
0answers
21 views

How to redirect user to Cart page after “Add to Cart”?

I have made a custom .phtml file to show "Add to Cart" button where I call/use the .phtml file in a CMS page. Below is my code: <?php $sku = $block->getData('product-sku'); $...
1
vote
1answer
29 views

Magento 2 - How to have a custom “add to cart” button in CMS page?

So I am trying to add "Add to Cart" button in my CMS page. In one CMS page, I will have one item and multiple "Add to Cart" buttons. I'm wondering how can I do this? All the ...
0
votes
2answers
89 views

How to create new quote programmatically from old order after place the order in magento 2

I want to create a new quote based on the old order. I can create order programmatically but not able to just add to cart product in a new quote. I don't want to place the order. Need is only add to ...
0
votes
2answers
80 views

Magento 2.4 - How to enable ajax for add-to-cart button and wishlist button of product widgets on homepage?

I have added products on the homepage using the widget, how to enable ajax for add-to-cart button and wishlist button of product widgets.
0
votes
0answers
17 views

Magento1 : Get the total price from the quantity of products before adding to the cart

Goodmorning everyone. I am a web designer not a developer, my coding knowledge is extremely limited. Despite all the tutorials I've read, I have a hard time understanding the magento logic for ...
0
votes
0answers
13 views

Magento 2: Wishlist add all to cart button -> don't add items to cart with no price and 0 quantity

i am using a hide price attribute to hide the price and add tocart button for the product, on wishlist page when user clicks on "add all to cart" button, i want to restrict those product who ...
1
vote
0answers
28 views

Magento 2.3 same product with different custom options is not showing separate in the cart?

I am adding the same product in the cart with different custom options but the product is merging with the first one and item quantity increased in the cart only. I want to show separate same products ...
0
votes
1answer
23 views

How to change Quote Item attributes after adding it to cart?

I want to change almost all the quote item attributes after adding it to care like name,price,sku and almost everything. As we have a requirement where at the runtime only we will decide this ...
0
votes
2answers
47 views

Cart items not shows in cart on using Magento 2 REST API

I am using Magento 2 REST API for add to cart item in guest but after checking on cart page it's just empty. Why it is empty. http://127.0.0.1/mag/rest/V1/guest-carts/Hkt4RC38lJX1rAalFoPlsk2suRwb8Fnp/...
1
vote
2answers
85 views

Magento 2.4.2 : Add to Cart button is disabled on listing page

In Magento 2.4.2 "Add to Cart" button is disabled in template and is being enabled using js post initialization vendor/magento/module-catalog/view/frontend/templates/product/list.phtml <...
0
votes
0answers
42 views

how to solve this prompt: “current customer does not have an active cart”?

when the customer proceed to checkout, the prompt:"current customer does not have an active cart" denying them from placing the order
0
votes
2answers
55 views

Increment/decrement buttons on category page without refeshing

I want to add increment and decrement buttons for quantity on catalog page without refreshing the page Pease help!
0
votes
2answers
79 views

How can I prevent a product to be added to cart without show any messages?

I'm trying to prevent a product to be added to cart without showing any messages. In order to do that I'm using a beforeAddProduct plugin and it works well but it shows an exception message in order ...
0
votes
2answers
59 views

How can I redirect to the cart page programmatically?

I'm using this plugin in order to prevent a product be added more than one time and it works perfectly but I'd like to add a feature: instead to stay on the product page once the product is added more ...
0
votes
1answer
19 views

Catalog product / Category redirecting to 404 page, Add To Cart not working

I got issue on Magento stroefront, there was no products showing on any category page. If I open any product direct and try to item to cart. Then it shows empty cart page. Admin panel working fine. ...
0
votes
1answer
14 views

How to Redirect Buy Now Button to View Cart instead of Shipping Address

When we click on Buy Now button it is redirecting to the shipping page (https://vitalticks.in/checkout/#shipping) But for us, it will be redirected to the View Cart page. https://vitalticks.in/...
0
votes
0answers
43 views

Magento 2: How to unset existing custom option and set new custom option and add product in cart programmatically

I am using Magento 2.3.1, and I have products which have one custom option that is required. Now I have create a custom controller to add product in cart without existing custom options as sample ...
0
votes
1answer
21 views

Cart page showing HTTP 500 Error and Not working

I am using porto theme in magento 1.9.4.When user add products to cart then items added in cart but when user click to view cart or continue for checkout than gets 500 error. Any body know what might ...
0
votes
2answers
17 views

Add text under AddToCart Button in Product Description Page Frontend - Magento2.3.5-p2

I tried so many ways to add text under addtocart button in PDP page, but nothing works. My block and phtml not getting called. catalog_product_view.xml <?xml version="1.0"?> <page ...
0
votes
0answers
33 views

Magento 2: Error on using API for add to cart

we have used magento 2 core api for add to cart, but when we add to cart by api and later if we try to add to cart for that same account from website it gives below error. Server cannot understand ...
0
votes
0answers
21 views

Display custom options on category page and allow add to cart

I want to display product's custom option on listing page and want to allow customer to add to cart from the category listing page. I have added Qty field and following code to display the custom ...
0
votes
1answer
65 views

Product in reservation show like out of stock (MAGENTO2 MSI)

I have stock_qty = 2 and salable_qty = 0 because of my products reservations and when I open product page add To Cart exists. Can this product show like out of stock when salable qty is 0 ?
0
votes
0answers
20 views

M2.2 | Button that can add multiple individual products to the cart all at once?

In short, we are looking for the ability to have a customizable button (be it through js, small module or whatever) to where we can have a button that would infact add multiple individual products to ...
0
votes
1answer
25 views

Limit Cart Items to Add in Cart

I want to limit cart items to be added in cart. Limit Checkout Order or Add to Cart Limit to allow only 6 type of items. These 6 items can have variable Qty value. I have done the below code using ...
0
votes
1answer
21 views

How to Add Additional Options in Magento 2 and convert it into order?

I need to add my custom detail in cart along with product detail and transfer these details in order too. I want to use additional option functionality for this.
0
votes
1answer
24 views

Limit Add to Cart Items

I want to Limit Checkout Order or Add to Cart Limit to allow only 6 types of products/items. These 6 items can have variable Qty value. Eg: One Checkout/AddCart Maximum 6 Items: Item-1 25Qty, Item-2 ...

1
2 3 4 5
22