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
14 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 ...
0
votes
0answers
21 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
17 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
36 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
36 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
17 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
49 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
49 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
40 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
8 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
12 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
20 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
30 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
14 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
36 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
19 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
23 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
18 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 ...
0
votes
2answers
502 views

Magento 2.4 REST API for Create Cart Not Working

I am trying to create the magento default REST API for add simple product to cart like this way. First I generate the customer token with the use of this API Call. https://www.domain.com/rest/default/...
0
votes
1answer
29 views

Magento 2 : API Get Customer Cart Data using customer ID

I am building custom magento 2 API. I want to get customer CART DATA using CUSTOMER_ID. I have tried following code but its not working. $params = $this->request->getPostValue(); $customerId = $...
0
votes
1answer
30 views

Add to Cart button not adding in cart Magento 2.3.3

I have setup magento 2.3.3 on server php 7.2. All buttons working fine on product detail page but Add to Cart button not adding product in cart. Same is working fine on local pc xampp but not working ...
0
votes
1answer
53 views

Magento2 - add Product to cart with out-stock status

Is it possible add product to cart with stock status = out-stock. I used plugin to override method with afterIsSalable, with this add-cart-button showing but not adding product into cart. Note: ...
0
votes
2answers
61 views

“Invalid Form Key, please refresh the page? ” - addtocart

I am testing website deployed based on Magenta Template Framework, the problem that occurred is that the cart kept being empty even the add to cart link has been ran. And furthermore, i kept getting ...
0
votes
0answers
9 views

how can i add to cart group and bundle products in magento 2 programmatically

for a single product, I am using $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $quote = $objectManager->create('Magento\Checkout\Model\Cart'); $params['qty'] = 2; $quote->...
0
votes
0answers
24 views

Magento 2 LocalStorageCart

I want to manipulate localstorage and add or remove items from cart, the problem is with backend everything works from the frontend but when i go to the checkout page i see all the items that i ...
0
votes
0answers
27 views

How to add multiple products to cart using ajax in magento 2

I want to add more products to cart using ajax in magento 2 but it doesn't work. please help me to solve this problem here's my code file ajax.phtml <script> require(['jquery'], function($){ ...
0
votes
0answers
44 views

How to Add to cart all product in magento 2

I added a button ("Add all product") on the header. How can I add all products to the cart by clicking on. Someone can help me to solve this problem. Thank you
0
votes
0answers
11 views

Magento 2: After Ajax add to cart redirect to different page

Magento 2, after ajax add to cart, how can I redirect to the custom page. Need to redirect only for specific product categories if successful product is added to cart.
0
votes
0answers
36 views

I need bundle Product options to display automatically - i.e. without having to click the “customize and add to cart” button

I am upgrading to Magento 2 and they have changed the way that bundles display. With a brand new clean install of M2.4 I am reluctant to start messing about with the code too much. I thought I had ...
0
votes
0answers
8 views

Magento2 Restrict particular category product from adding to cart when other is present

Magento2 I have to add 2 conditions on add to cart For e.g. There are 3 categories A,B & C Restrict Category B products to add to cart when category A product is already added & vice verse ...
0
votes
0answers
113 views

How to display cart item count in custom header using JavaScript?

I've created a custom header that works fine. I replaced Magento's cart, and instead added a shopping basket icon in the header. Like so: When pressed it redirects to the cart. What I want to do is ...
0
votes
1answer
47 views

Magento2: Bundle Product add to cart without selecting options (Product Item)

I am working on cms page custom product layout for that I have written custom controller. but it show error {"0":"Please select all required options.","1":"#1 ...
0
votes
1answer
23 views

How to Add Product Specification Section Under Product Info in Magento 2?

How to Add Product Specification Section Under Product Info in Magento 2
0
votes
1answer
12 views

Child Theme showing strange labels on breadcrumbs, buttons, labels etc.( {{{Home}}{{Home}}{{Home}}{{themeVendor/ThemeName}}})

I have a problem with my child theme in Magento. On the products page it shows labels like "{{{Home}}{{Home}}{{Home}}{{themeVendor/ThemeName}}}" for the breadcrumbs or "{{{Add to Cart}}{...
0
votes
1answer
23 views

Magento2 display Add to cart success message under Add to cart button on product details page

Magento2 How can I display product Added to cart success message under Add to cart button on product details page?
0
votes
0answers
7 views

When adding simple product in cart getting the customer-data.js

Error: {"message":"The product that was requested doesn&#039;t exist. Verify the product and try again."} When adding the product to the cart getting this what is the purpose ...
0
votes
0answers
34 views

Add ajax qty plus minus buttons in shop page

Hello guys i want to add qty plus and minus in catalog view so when my clients press plus automatically add the item to cart and if the press minus remove the item specific qty from cart. and if they ...
0
votes
0answers
22 views

How to add product from one store to another store in magento2?

I have two store Store A -Store B I have one configurable product SKU-test123. Now I want to display it to StoreA's one CMS page for example: www.storeA.com/testcms (using catalog product widget) ...
0
votes
0answers
26 views

Ajax Add to cart in wishlist page magento 2.4

I'm looking for a way to add ajax functionality to the wishlist page. So when I add a product to the cart in my wishlist page it utilizes ajax. How would I approach this? Hope for an answer. Thanks in ...
0
votes
1answer
31 views

How to check if a product is salable using isSalable()?

I am trying to use plugin to override Magento\Checkout\Model\Cart.php - addOrderItem function Instead of getting item's quantity, how to check if product is salable using isSalable()? Is there any way ...
1
vote
0answers
38 views

Replace the QTY of the product in the cart on “add to cart” rather than increment

How to replace the quantity of the product in the cart instead of increment? Current behaviour: From the product page: Add 5 qty of product A Add 2 qty of product A (add product again) The cart qty ...
0
votes
0answers
18 views

How to get attributes before adding product to the cart past api / rest?

I've been researching and testing plugins and events for more than 20 days add the customized item passed by POST /V1/carts/{quoteId}/items. { "cartItem": { "sku": "1809&...
0
votes
0answers
15 views

Hit a curl request at the time of add to cart in magento 2?

I want to hit an external curl request at the time of add to cart click in magento 2. Based on that result product will be added or not in cart How will i hit curl on add to cart click ?
0
votes
0answers
15 views

Magneto 2: How to add a configurable product with custom options in cart

I am trying to add configurable product with it's custom options. Right now I have a swatch with 2 custom options. Whenever I try to add that product It just add the swatch value. It doesn't add the ...
0
votes
0answers
11 views

How to hit 3rd party API when user click on Add to cart in Magento 2?

I want to hit a 3rd party API when user click on Add to cart in Magento 2 and based on that result i want to add product on cart or show a custom message to user that didn't want to add that product ...
0
votes
2answers
49 views

Magento 2: Prevent add to cart or qty increase if a product already exists in cart

I want a feature where if a customer tries to add a product which already exists in cart then it should prevent it from adding again or qty increase. Instead I want to show a message that 'The product ...

1
2 3 4 5
21