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
119k 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.
user avatar
  • 9,847
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 ...
user avatar
  • 2,154
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 ...
user avatar
  • 1,078
32 votes
2 answers
4k 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?
user avatar
29 votes
5 answers
37k 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 ...
user avatar
28 votes
4 answers
84k 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.
user avatar
  • 381
27 votes
8 answers
30k 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 ...
user avatar
  • 9,796
18 votes
6 answers
8k 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 ...
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 ...
user avatar
15 votes
6 answers
15k 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 ...
user avatar
  • 1,427
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(...
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','...
user avatar
  • 1,257
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) ...
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 ...
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 ...
user avatar
  • 3,685
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) ...
user avatar
  • 141
13 votes
3 answers
39k 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 ...
user avatar
  • 794
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')->...
user avatar
  • 3,036
12 votes
5 answers
19k 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 ...
user avatar
12 votes
5 answers
16k 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 ...
user avatar
  • 1,474
12 votes
2 answers
1k 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 ...
user avatar
  • 887
11 votes
4 answers
22k 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->...
user avatar
  • 1,451
11 votes
3 answers
12k 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 ...
user avatar
11 votes
1 answer
2k 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 ...
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/...
user avatar
10 votes
2 answers
21k 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 ...
user avatar
  • 1,177
10 votes
1 answer
199 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 ...
user avatar
  • 498
9 votes
6 answers
1k 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 ...
user avatar
9 votes
1 answer
18k 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()->...
user avatar
  • 387
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 ...
user avatar
  • 4,632
8 votes
2 answers
10k 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 ...
user avatar
8 votes
3 answers
15k 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 &...
user avatar
  • 319
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 ...
user avatar
  • 1,187
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 ...
user avatar
8 votes
1 answer
17k 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 ...
user avatar
  • 1,857
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 ...
user avatar
  • 1,778
8 votes
2 answers
7k 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()->...
user avatar
8 votes
3 answers
469 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 = $...
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 ...
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.
user avatar
  • 2,164
8 votes
1 answer
904 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')->...
user avatar
  • 1,474
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 ...
user avatar
  • 123
7 votes
1 answer
7k 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/...
user avatar
7 votes
3 answers
13k 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 ...
user avatar
  • 273
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 ...
user avatar
7 votes
3 answers
11k 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 ...
user avatar
7 votes
2 answers
25k 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 ...
user avatar
  • 9,499
7 votes
2 answers
13k views

Magento 2 - Set custom attribute value on cart page

In Magento 1.x I have created following function in Namespace/Modulename/Model/Observer.php public function salesQuoteItemSetCustomAttribute($observer){ $quoteItem = $observer->...
user avatar
7 votes
2 answers
8k views

How to add "Buy Now" button in Magento 2.1 Product detail page along with add to cart? [closed]

How to add "Buy Now" button in Magento 2.1 Product detail page along with add to cart? so the users can directly buy the product without adding into the cart.
user avatar
7 votes
4 answers
17k views

Grand total without tax

i want and need in cart display Grand Total price without include tax, but tax price should be display in different line. How i can do this? where i can modify file? Thanks
user avatar
  • 251

1
2 3 4 5
45