Questions tagged [cart]

Question related to the shopping cart: adding/removing products, shoping cart price rules, the appearance of the shopping cart page.

Filter by
Sorted by
Tagged with
0 votes
2 answers
2k views

how to redirect to cart page by clicking go to check out button

I need to redirect to cart page instead of checkout page as i click go to checkout button in cart drop-down.
0 votes
0 answers
14 views

On Cart Page Estimate shipping and taxes section add custom validation to zipcode

How can I add custom js validation to my cart estimate page for the zipcode? The default Magento 2 behavior is that, on any change in pincode field, the prediction action starts and a spinner is shown,...
2 votes
1 answer
2k views

Product dimensions in Magento 2.2.5 update

I have installed Magento 2.2.5 locally with sample data. Now three new attributes Length, Width, Height Added. These are the default attributes, created by Magento 2.2.5 or by some third party ...
0 votes
1 answer
2k views

Change Row Total for Quote Item whithout changing the Price

I have tried to set a custom price for this purpose but it's getting multiplied by quantity. All I need to add an extra amount(like 50$) to each quote item after it's added to the cart. So it will be ...
0 votes
2 answers
2k views

Magento 2 Mini Cart values with Full Page Cache

Running Magento 2.1.10 CE, with multiple stores. We have all the cache enabled, with Full Page Cache running with Varnish. Having an issue with the minicart values since enabling cache Steps: 1- ...
1 vote
1 answer
1k views

custom fee order totals issue

I created custom fee based on following link. (Please look at my module at : https://github.com/sivajik34/Delivery-Signature-Magento2) how to add fee to order totals in magento2 Everything is ...
1 vote
1 answer
2k views

Magento 2 - Prevent form submit on page reload when Product add from sample script to Magento Shopping Cart

Below sample PHP script will list simple/configurable product with add to cart button. When user clicks on submit button, it will redirect to Magento shopping cart page and selected product will be ...
0 votes
2 answers
3k views

Magento 2 - invalid form key (add/delete from cart)

I have serious problems with custom Magento 2 theme and (probably) formkey cashing. I have 2 views of exactly same e-shop. - View 1: Luma Theme - View 2: Custom Theme (Luma child) - overriding ...
5 votes
1 answer
2k views

Magento 2 order redirected to cart -> getLastSuccessQuoteId() returns false

I'm trying to place order in magento 2.1.7 but every-time I click the "place order" button, I get redirected to the cart page. With debugging I found out, that in the class /vendor/magento/module-...
1 vote
1 answer
2k views

Magento 2 Minicart content not displaying

I'm working on developing my own theme by extending the Magento Blank theme. I'm trying to add the minicart to my header.phtml file. I'm loading the minicart in my header like so: <?php echo $...
0 votes
4 answers
4k views

Magento 2 - get Current Country Code in Cart Page

I want to Fetch Current Country Code in Cart Page Section (js)
0 votes
2 answers
2k views

How can i do cross sell products blocks on add to cart popup box

How can i display my cross sell products blocks under add to cart popup box, my add to cart block, <?php class Cmsmart_AjaxCart_IndexController extends Mage_Core_Controller_Front_Action { ...
0 votes
1 answer
2k views

Magento 2: Change UI template

For the checkout, I would like to use a different UI template to that which is used on the cart. Currently, they both use the same UI template: <item name="template" xsi:type="string">ui/form/...
0 votes
1 answer
3k views

Magento2: Update additional options in cart page

I added the custom option to the shopping cart like this tutorial Cloudways . My question is how can I update this option in Cart page like "Qty"?
4 votes
3 answers
2k views

Magento 2: What is the best way to observe cart change to modify cart item in magento 2?

I'm using Magento v2.3.4 and i want to modify the cart item, if there is an update on the cart (add to cart, update cart item, and remove cart item). Currently I'm using plugin for quote collectTotals(...
3 votes
4 answers
6k views

Remove apply discount code from Cart

How do I remove the discount code from the cart ? There are loads of examples of how to remove it from the checkout but I also need to remove it from the cart.
2 votes
1 answer
2k views

Magento2 - Add Custom Column in cart item table and insert data to custom column when product add to cart

i have added new column in 'quote_item' table. i want to add the data to custom column when user add any product to cart.
0 votes
2 answers
2k views

Cart page sub total label

Using Magento 1.9.2.2 I want to change Sub Total Label(Just label) everywhere... I found that it's coming from app/design/frontend/base/default/template/tax/checkout/subtotal.phtml From this ...
0 votes
1 answer
1k views

Magento2.4 How to override \Magento\Checkout\Controller\Cart?

Even if I simply copy the file without changes, it does not work as a preference. Any idea why? I created a preference in di.xml <?xml version="1.0"?> <config xmlns:xsi="http://...
3 votes
2 answers
3k views

How to reload the quote or cart in Magento 2

I am working on ajax cart. When i update the cart qty, I am trying to reload the quote but its not loading properly $this->cart->getQuote()->getShippingAddress()->collectShippingRates()-&...
1 vote
1 answer
1k views

Magento 2: How to set item Row total?

I want to set a custom row total. I am using 'checkout_cart_product_add_after' event. And want to update Row total. I going to add an extra amount in an item row total. like, $item->setRowTotal($...
0 votes
1 answer
2k views

Apply discount if 2 of the different item from a category are added

I'm looking to build the following Shopping Cart Rule and I have no idea how to do it. I have multiple sku available, if you add 2 different sku in your cart from the same category, you get 10% off. ...
2 votes
3 answers
4k views

Disable "Proceed to Checkout" button on cart page magento 2

In my custom module I have to check some conditions and have to disable "Proceed to Checkout" button from the Cart page. I know it's coming from magento\vendor\magento\module-checkout\view\frontend\...
0 votes
1 answer
37 views

Magento 2 Add Quantity Dropdown and to show Textbox when Quantity selection is 10 from dropdown at Cart Page

I want to add dropdown of 1 to 10 of quantity at cart page and if customer choose the 10 from quantity dropdown then the textbox appears for quantity field. please help me. thank you.
3 votes
2 answers
3k views

What settings control how long the products stay in cart for guests?

At the moment most of our customers are guests (we do no require accounts) Very often when customers returns to our website they see empty cart page (verified by testing and screen recording tools) ...
0 votes
1 answer
2k views

Get quantity in stock for items added in cart in JS

I need the quantity available for each product in cart in my custom javascript file. Does anyone know how to do this?
0 votes
1 answer
2k views

Trigger modal after placing a product in minicart on Magento 2

I need to show a modal after a product is placed inside cart. This is what i have so far. This is my default.xml <body> <referenceContainer name="content"> <block ...
0 votes
2 answers
1k views

How to Remove cart products if a specific product is added in cart

This is my onpage.phtml page to get product id. I need to remove all other products in cart except the mention product id below if this product is on cart. $objectManager = \Magento\Framework\App\...
2 votes
1 answer
2k views

magento 2 remove shipping amount from cart total

I want to remove shipping amount from cart page because we do not provide estimate shipping amount calculation block. Also, when customer add product to cart then its display grand total without ...
0 votes
3 answers
2k views

How to get updated cart subtotal in checkout_cart_product_add_after event observer in Magento 2?

I want to add a free product to cart with another product. For that I wrote checkout_cart_product_add_after event observer. My problem is, I don't get the updated cart subtotal(after adding first ...
0 votes
1 answer
2k views

How to add onClick event to add to cart button

Magento version 2.1.9 I want to use facebook pixel on my magento site. I want to add onclick event to all "add to cart" buttons. Thank you in advance.
0 votes
1 answer
2k views

How to check if the current shopping cart has met the conditions of a specific Shopping Cart Price Rule

I have a specific shopping cart rule that checks weather 3 items or greater of products from certain categories have been added to the cart, and then gives a discount on a specific Item ( I will call ...
1 vote
2 answers
4k views

Magento 2 How to remove shipping rate estimation in shopping cart?

Sometimes the estimation of shipping showed Shipping (undefined - undefined) so I want to remove this row of thing. How can I remove it? Thanks.
0 votes
1 answer
1k views

Remove wishlist items when added to cart

I want to remove the wishlist products that are added to the cart. I've followed this link: Keeping wishlist items for keeping the wish list items after being added to the cart.i have set my $delete ...
7 votes
6 answers
6k views

Maintain cart for a week in Magento 2?

I am building a Magento 2 store. The Cart is saved for one hour only, it get deleted after one hour of inactivity. Is there any setting on Magento that allow a longer (may be a week or so) cart ...
0 votes
0 answers
26 views

Add product attribute data to cart data

I'm working on displaying two specific options, compound_id and medication_id, in the checkout data within Magento. At present, I've managed to display mif in the cart data, but that's outside the ...
8 votes
2 answers
7k views

Magento 2 No such entity with cartid =

I'm experiencing this error on my site quite often: Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with cartId = It's not using multiple stores, so the entity_ids ...
3 votes
1 answer
4k views

Magento 2 adding multiple items to cart at one time

I am trying to add multiple products to Cart at one time, But i am facing issue while second product adding to cart as per attached screen shot. The second product showing in cart items but price is ...
1 vote
1 answer
3k views

How to update subtotal after changing price with observer

I am using an observer to change bundle product price. I have tried events 'checkout_cart_product_add_after' and 'checkout_cart_save_after'. Both events update the product's price but the subtotal ...
7 votes
3 answers
8k views

How to get item id from quote item collection in Magento 2?

I am trying to get all item ids currently added in cart. Here is what I have done so far. public function __construct( \Magento\Checkout\Model\Cart $cart ) { $this->_cart = $cart; } ...
1 vote
3 answers
3k views

Get Cross sell items in cart page Programmatically in magento2

I am trying to get cross sell products in cart page programmatically. Below code i have used in layout/checkout_cart_index.xml <referenceContainer name="content"> <block class="...
1 vote
1 answer
5k views

Magento 2 : How to Get Selected Bundle Option Product Details in Cart Page

I need to get details of selected product of a bundled product. I tried following code in cart page. But it's not working. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $cart =...
1 vote
2 answers
2k views

Show discount including tax, calculate discount excluding tax

I want to display the discount amount including tax on cart overview page (totals summary). Magento 2.1.8 Relevant settings: Catalog prices: Excluding tax Apply Customer Tax: After discount Apply ...
0 votes
1 answer
1k views

Best approach to limit the backorder Qty in Magento2?

This question or similar have been asked in here and here nevertheless none of the provided answers offer the result I am trying to achieve. Lets say you want to limit the backorder qty. You create ...
1 vote
1 answer
1k views

Prevent abandoned cart and guest cart merge

I have made Observer on event "sales_quote_merge_before" to remove abandoned cart items when customer logs in (from Go to Checkout). After login Minicart shows only guest cart items (no items from ...
0 votes
2 answers
2k views

"Shipping address is not set" error when saving cart

I have a simple code, where i add a simple product to the cart $cart = $obj->get('\Magento\Checkout\Model\Cart'); $cart->addProduct(5, 3); $cart->save(); but the last row, returns this ...
3 votes
1 answer
2k views

How to show all cart items in phtml file Magento 2?

What is the best way to show all the items/products that are in checkout/cart in a PHTML page? I have added a custom phtml page that shows some products, and also have a phtml page that want to ...
0 votes
1 answer
2k views

Magento 2.4.2 GraphQL not get uid from customerCart and cart query

I installed Magento 2.4.2 According to Magento GraphQL DevDocs updateCartItems mutation cart_item_id is Deprecated. Use cart_item_uid instead. The unique ID assigned when a customer places an item in ...
3 votes
1 answer
2k views

Modifying the redirect after editing a product in the cart

I have a problem modifying a redirect in magento CE 1.9.2. Let's say a customer has a configurable product in the cart, and would like to edit that product (ie. changing color or size or something). ...
0 votes
1 answer
41 views

How to remove or disable empty cart button confirmation popup in Magento2 - 2.4.5

We've recently updated a customer Magento2 to 2.4.5-p5, now the cart page added a confirmation popup when clicking the empty cart button: Magento_Checkout/js/shopping-cart.js _confirmClearCart:...

1
2 3 4 5
45