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
45 votes
5 answers
121k views

How to get all items in cart currently?

I want to get a collection of all the items in cart currently. How can I do this ? Any suggestions will be appreciated.
Sukeshini's user avatar
  • 9,955
33 votes
7 answers
15k views

Questions to expect in an interview for a Junior Magento Developer Position

Firstly I would like to say that I hope I am not posting in the wrong place with this question and if I am please advice me of where (if anywhere in the stackexchange world is appropriate) I should ...
develophper's user avatar
  • 2,214
32 votes
4 answers
20k views

Modify tax rate on cart quote items and recalculate

I have a category of products which (legally) need to have their tax rate changed when you are ordering more than a certain quantity. I have extended the various tax models to get this working when ...
McNab's user avatar
  • 1,078
32 votes
2 answers
5k views

Magento 2 - Why is Magento\Checkout\Model\Cart deprecated?

Since Magento 2.1, Cart has a @deprecated tag. Nevertheless, it is still used by Magento itself to store products when shopping. Is the deprecation intended, and if so, and what should we use instead?
Patrick van Bergen's user avatar
30 votes
5 answers
101k views

Magento 2 - How to get all items in cart?

At checkout page (chekout/cart) I want to edit the checkout button url destination based on cart items (link.phtml). How can I get all items in cart? I want to do this without using the API. Thanks.
lalokuyo's user avatar
  • 401
30 votes
6 answers
42k views

Magento 2 remove "Estimate shipping costs and tax" from cart

I want to get rid of the "Estimate Shipping costs and Tax" block in the cart. The devdocs tell Disabling a component is the way to go, so I tried the following: <body> <referenceBlock ...
Timon de Groot's user avatar
27 votes
8 answers
31k views

Cart dropping all items / cart session clears

A site I manage suddenly (potentially 2 weeks ago - from GA stats, and only reported now) started dropping the cart items when you view the cart, or go to checkout. The top 'mini-cart' shows the ...
ProxiBlue's user avatar
  • 9,926
18 votes
6 answers
9k views

How to allow only one product in a cart?

We have a requirement, wherein a customer will be allowed to add only one product to the cart at a time. However he/she can add any quantity of that product. How can I prevent a product from adding ...
Shathish's user avatar
  • 2,689
16 votes
4 answers
2k views

EE 1.14.2 / CE 1.9.2: Quote items not merged correctly on login (duplicate products in cart)

I found a weird bug in Magento EE 1.14.2 (also affects CE 1.9.2) with the cart. Steps to reproduce: Log in as customer A Add product X to the cart Switch to a different browser Add product X to the ...
Fabian Schmengler's user avatar
15 votes
6 answers
17k views

Pop up minicart when I add a product to the cart magento 2

I'm using magento 2.0.7, and what I'm trying to do is to popup the cart(the top right cart ajax minicart) when I add a product to it, Basically trigger it. I have tried to add the "showcart" class to ...
alexcr's user avatar
  • 1,477
15 votes
2 answers
11k views

Creating Custom option and prize to just added product to cart using observer

I want to add custom option to quoteitem using observer which observer checkoutCartProductAddAfter event and fires after product added to cart. public function checkoutCartProductAddAfter(...
Keyur Patel's user avatar
15 votes
2 answers
2k views

Magento 1 - sorting cart items by 'updated_at'

This is how i'm getting the cart items: $quote = Mage::getModel('checkout/cart')->getQuote(); $items=$quote->getAllitems(); I'd like to do something like this: $items->sortBy('updated_at','...
easymoden00b's user avatar
  • 1,277
15 votes
4 answers
5k views

Adding multiple items with different attributes to cart programmatically

I'm making a bulk add to cart system. Please note : i want it to works for simple products with with custom options -> Where custom option are like color(red , green , blue) or Size(Xl, M , S) ...
user1799722's user avatar
15 votes
2 answers
2k views

How to update Shipping rates using Ajax when cart item is deleted on Checkout-Cart page?

My Shipping rates are calculated based on item present in cart and now on deletion of item on Checkout/Cart page, I need to update the Shipping rates. As of now, Remove Item on Checkout/Cart page ...
Rizwan Dhuka's user avatar
15 votes
3 answers
3k views

magento 2 remove mini cart item page reload?

How can I reload the page when I remove mini cart item ? I know it's Magento 2 bug. On the checkout cart page there are many products In mini cart as well as In checkout cart page when I remove In ...
Pratik's user avatar
  • 3,805
14 votes
1 answer
9k views

Customization of total order and additional infos

When want to have the following style of totals on checkout/cart: Discount Subtotal Shipping fee OR Info Text: "excl. shipping" Additional text: "free shipping from 30EUR" (display always) ...
MariaK's user avatar
  • 141
13 votes
5 answers
22k views

Magento2 Correct Way to get Order items

I am working on M2 Payment Extension our merchant need us to send items details along with order Everything works fine but $order->getAllItems(); or $order->getAllVisibleItems(); returning ...
Sajid Unar's user avatar
13 votes
3 answers
40k views

Getting quote (cart) items programatically shows duplicate SKUs for both the configurable and simple product

I'm getting the shopping cart using: $cart = Mage::getSingleton('checkout/session')->getQuote(); And then iterating through it using: foreach ($cart->getAllItems() as $item) { } But it seems ...
Pat's user avatar
  • 794
13 votes
1 answer
3k views

Multiple Cart or Split Quote in Magento2

I want to show two cart for normal products and vendor products. I don't think it possible to create multiple cart either by splitting quote or creating multiple quote. Because Magento 2 separate ...
Krishnan Daiva's user avatar
12 votes
2 answers
18k views

difference between cart getItemsCount() and getSummaryCount()

I am displaying the total items present in the cart at header. I am able to display the count of items. But I am bit confused between two methods of cart 1. Mage::helper('checkout/cart')->...
Charlie's user avatar
  • 3,136
12 votes
5 answers
17k views

Auto update cart quantity when change quantity

In the default cart of Magento, when the customer edit the quantity, he/she needs to press the button to update the quantity. Is there a way that the cart update the quantity automatically when the ...
JGeer's user avatar
  • 1,418
12 votes
2 answers
2k views

Magento2: Minicart is full while Cart is Empty

A lot of our customers are complaining that they add stuff to the cart & then when they proceed to checkout they are redirected to an empty cart. We thought that it might be a result of too short ...
Pini's user avatar
  • 917
11 votes
4 answers
23k views

Magento 2 Get Cart Quote Total in minicart.phtml

I'm trying to get the cart quote total in minicart.phtml, but I'm having no luck. I'm injecting Magento\Checkout\Model\Cart. Here's my code: $this->cart = $cart; $cartQuote= $this->cart->...
Paul's user avatar
  • 1,501
11 votes
3 answers
16k views

Magento 2 : Add Custom Tax Amount In Cart Programatically

I want to add custom tax amount to checkout cart programmatically. Here is the example. Cart Old Tax = 4.21 Custom Tax = 2 New Tax = 4.21 + 2 = 6 Check the screenshot below. I need this done ...
Dhiren Vasoya's user avatar
11 votes
1 answer
2k views

Magento 1.9.3 : How to display custom options price (separately) on cart and checkout page?

I want to display custom option price on cart and checkout page. I follow this URL but its display error "Fatal error: Call to a member function getValue() on a non-object " on app/design/frontend/...
Chandra Bhushan's user avatar
10 votes
2 answers
25k views

Magento 2 : Updating quote item

I am trying to update quote item in magento2. But every time i am saving the item its creating a new item with the same quote id rather than updating it. Here is my code public function ...
Kingshuk Deb's user avatar
  • 1,204
10 votes
1 answer
294 views

Persistence Lifetime not working in Magento 2

I have configured Persistence Lifetime on Magento 2 but it's not working as expected. I have configured 60 seconds cookie lifetime but it's not affecting the same. I have checked with default Magento ...
Ashna's user avatar
  • 518
9 votes
1 answer
19k views

Get Shipping Price From Quote

I am trying to get the shipping price from the quote on the cart page for the entire order. I have tried multiple things including: Mage::getModel("checkout/session")->getQuote()->...
djames's user avatar
  • 387
9 votes
6 answers
2k views

Magento 2: Changing Price of Product in Controller doesn't work at the moment!

I tried to change the Price of my Products like this: Controller.php: [EDIT] <?php namespace MassiveArt\ShoppingCart\Controller\Index; use Magento\Catalog\Model\ProductFactory; use ...
Felix Schönherr's user avatar
9 votes
1 answer
3k views

Role of is_active in sales_flat_quote?

Can anyone shade some light on the real usage of is_active field in sales_flat_quote table? AFAIK, is_active field is used in the following cases: is_active is always 1 for cart/quote created by web ...
MagePsycho's user avatar
  • 4,752
8 votes
2 answers
12k views

Disable entire cart functionality & checkout in Magento 2

From the admin side I can disable the one step checkout, but still users can add products to the cart. I want to display only products without checkout. Is there any extension there? I mean disable ...
Siva Kumar Koduru's user avatar
8 votes
3 answers
5k views

How to remove Guam, Palau, and other US Territories from address State dropdown - Magento 2 [duplicate]

How can I remove Guam, Puerto Rico, Palau, and all other US Territories from the "State" (or "Region") dropdown list on both the cart page and checkout pages? I only want to ship to the 48 contiguous ...
Tim K.'s user avatar
  • 101
8 votes
3 answers
16k views

Disable redirect after product add to basket

When I add something from the category to the basket/cart it redirects me to the basket/cart. After searching I found that I could turn this functionality of in the admin system via Configuration &...
user9252's user avatar
  • 329
8 votes
4 answers
15k views

How to update product custom options on Cart Page?

I have a simple product with custom options. When someone select any option and click on add to cart the product with the option goes to the cart where the product and selected option is shown. Now ...
Sarvagya's user avatar
  • 1,217
8 votes
1 answer
20k views

Magento 2 - How to add custom discount in cart programmatically?

I want to apply custom discount amount to cart programmatically. I have tried doing it in following 2 ways, none of which work: METHOD 1: I tried following the default way in which Magento2 applies ...
Reena Parekh's user avatar
  • 1,917
8 votes
5 answers
5k views

"Stop Further Rules Processing" not applying to all items

There appears to be a bug with "Stop Further Rules Processing" in Magento CE1.9 / EE1.13 where only the first item in your cart recieves the discount. I would expect: If I have multiple shopping cart ...
Joseph McDermott's user avatar
8 votes
2 answers
4k views

How to remove the old cart product after customer login

Customer visit website and add the product, then customer login. if customer already have cart items, its removed old items, newly added items only showing Example: Customer already have 5 ...
VijayS91's user avatar
  • 1,788
8 votes
2 answers
8k views

Modifying custom options of an item when adding it to the cart?

I am listening to the sales_quote_save_before event to notice when an item is added to the cart. Once its fired, I iterate through the items options like this: $quote = $observer->getEvent()->...
user1638055's user avatar
8 votes
3 answers
706 views

Getting Value of product attribute on cart page even not assigned to that particular product Magento 2

I am getting the product attribute from quote. It seems there is wrong value comes. Please check my below code. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $cart = $...
Sunny Rahevar's user avatar
8 votes
3 answers
5k views

Mini-Cart displaying Parent Product Image instead of Product Image

I've got code that will display a product in the mini-cart using ajax, when a customer clicks on Add to Cart. The issue is that it is not displaying the child product image until I do a refresh of ...
Stuart Shields's user avatar
8 votes
1 answer
2k views

Difference between Minicart and Cart in Magento 2

I want to know the difference between Mini cart and Cart in details.
Sanjay Gohil's user avatar
  • 2,200
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 ...
Howliee's user avatar
  • 153
8 votes
1 answer
938 views

Please specify the product's required option(s) Custom Option type file

I got only one custom option, which is file type, I tried to add product to cart programmatically like this: $logoSku = 'lg-brnd01'; $productLogo = Mage::getModel('catalog/product')->...
Hunter's user avatar
  • 1,484
7 votes
5 answers
28k views

programmatically adding product to cart returns empty price

i have been trying to programmatically add a product to cart using following lines of code, it seems to work and successfully adds product but for some reason, the price of newly added product always ...
ehmad11's user avatar
  • 123
7 votes
4 answers
10k views

How to override module-checkout/.../cart/item/default.phtml?

I want to customize the cart page. I'm trying to override it using module. I created module which is working fine. I created layout: checkout_cart_item_renderers.xml <?xml version="1.0"?> &...
P S's user avatar
  • 1,983
7 votes
2 answers
4k views

Cart Summary expanded

On our checkout page we have the product list and the shipping options within a collapsible menu. I can not seem to get it expanded. I found the relevant passage in the _cart.less. Is anyone able to ...
Thomas Meier's user avatar
7 votes
1 answer
8k views

How do I load JavaScript function inside KnockoutJS html?

I am making changes to my Magento 2 cart. I want to run a particular JavaScript function once the registration.html file is loaded My file: /app/design/frontend/mytheme/default/Magento_Checkout/...
TheBlackBenzKid's user avatar
7 votes
3 answers
14k views

magento 2 order confirmation email sending before payment gatway redirection

I am new to magento2 and developing a custom payment module for ccavenue.I am facing a problem regarding order confirmation email. The order confirmation email is sending once the customer ...
Renjith R's user avatar
  • 273
7 votes
3 answers
12k views

Is it possible to share the cart contents between multi-store websites?

I have a client who needs a multi-store setup. They require the contents of the cart to be shared between websites. Also when the customer switches between websites, the cart item(s) price may be ...
Paul Donnelly's user avatar
7 votes
3 answers
29k views

remove items from cart in controller - magento2

I need to remove all the items from cart, below method remove the items in chenckout/cart/index page but header minicart section still dispaly the items even after refresh page too. I have try this ...
Bilal Usean's user avatar
  • 9,977

1
2 3 4 5
45