Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
211 views

Magento2 sort Cart items with Name

I am working on of Mageto2.4.0 projects and currenly there is requirement to sort cart items with name e.g suppose that we have some items in cart "Argus All-Weather Tank" ,"Hero Hoodie&...
akgola's user avatar
  • 2,967
5 votes
2 answers
5k views

Magento 2 - How to programmatically add a product to cart multiple times but with different options?

How to add multiple items (same product ID) with different options to cart ? Following code is working for one product or different products. But, with two items of same product ID, with different ...
DependencyHell's user avatar
1 vote
2 answers
3k views

Magento : Update Cart Grand Total and Subtotal

I have 4 main products in cart, Each item is having different price. I want to update cart's total price as $40 without considering each line item price. I want to show $40 as combined price for all 4 ...
Nitz's user avatar
  • 449
30 votes
5 answers
103k 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
4 votes
1 answer
7k views

Removing item from cart on Observer method

This is triggered on the checkout_cart_add_product_complete event. Firstly the code in the if($itemCount > 1) statement works absolutely fine and as expected (it removes the last item/item just ...
Matt's user avatar
  • 101
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
3 votes
4 answers
2k views

Change item options in cart : last item not saved

I would like to change some options of the items present in the cart. On the checkout_cart_add_product_complete. I launch the following function: public function TreatShipConflicts($observer) { ...
Alexglvr's user avatar
  • 1,675
0 votes
1 answer
552 views

Create and save duplicate item (with custom option) in cart [closed]

In fact just copy and save existing cart item. Programmatically course. In cart we have item - "A" with custom option, need clone "A" -> to (create) "B" "B" full double "A" besides id.
Ratio's user avatar
  • 87