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
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
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
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
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
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
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
4 votes
2 answers
11k views

Share cart in magento 2 multistore

I have a magento 2 website where we want to have 3 different stores on 3 different domains. We want to share cart and customer session on the different websites. Each website/store will have different ...
user avatar
  • 1,183
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
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
6 votes
2 answers
7k views

How to Increase the Number of Crosssell Items in Cart?

I want to increase the number of cross sell items appearing in cart. The max item count is 4 in defined at app/code/core/Mage/Checkout/Block/Cart/Crossell.php class Mage_Checkout_Block_Cart_Crosssell ...
user avatar
  • 529
1 vote
3 answers
5k views

How to copy one quote (only cart items) to other quote (only items )

i want to copy one quote (only cart items) to other quote (only items ). Only want to copy cart products to other new quote. Suppose: i have old quote,which id is 5,have 4 items i have another ...
user avatar
  • 75.6k
7 votes
3 answers
4k 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 ...
user avatar
  • 91
6 votes
3 answers
14k views

Magento display tiered pricing for each product on cart page

I am having an issue getting the tierPriceHtml to display for each item on the cart page. This is what I have inside checkout/cart/item/default.phtml: $custom = Mage::getModel('catalog/product')->...
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
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
1 vote
2 answers
3k views

Disable merging of cart positions?

Is it possible to disable the merging of same products into one position in the cart? So when someone adds Product ABC with Qty 1 to the cart, continues shopping and adds the same product again with ...
user avatar
  • 926
6 votes
3 answers
13k views

How to update cart qty using ajax Magento 2

How to update cart qty using ajax magento 2 I want to change qty on cart page. I don't want to use the update button. It should be update automatically without reloading the page.
user avatar
4 votes
3 answers
9k views

How to add multiple product to magento cart from outside of magento?

I have to add multiple items into magento cart from out side of magento (external website), through /path/to/app/checkout/cart/add?product=[id]&qty=[qty] this method I can add one product to the ...
user avatar
  • 479
3 votes
1 answer
3k views

Does Persistent Shopping Cart work for guest (unlogged) visitors?

I'm wondering if the settings described under persistent shopping cart work for guest (unlogged) visitors. I.e. can I set them so that when a visitor comes in, adds things to cart, closes the browser, ...
user avatar
3 votes
0 answers
723 views

How to add a additional field in Summary Section magento 2.3

My Actual Screen look like I Expexted Result look like How to Display Total Savings like above mentioned screenshot. I need to print Sum of total added product savings amount in summary section
user avatar
  • 1,372
2 votes
3 answers
11k views

How to update minicart view using AJAX?

Is there any way to update the mini cart view? Now I'm using: require([ 'Magento_Customer/js/customer-data' ], function (customerData) { alert("hola"); ...
user avatar
  • 529
2 votes
2 answers
3k views

Move Cart to Header In Magento 1.8.1

TOPIC: Looking to move Shopping Cart to Header-Right in Magento 1.8.1 ATTEMPTS + OTHER POSTS: How to add a Cart Icon to header? Move Cart to Header in Magento 1.7 Any contribution is greatly ...
user avatar
  • 144
1 vote
0 answers
1k views

Magento 2: Admin price changes are not refreshing minicart immediately till checkout

I have added 1 product with it's price in Cart. It's value is 100 USD. Now from backend I'm enabling Special Price & set it to 50 USD. How can I directly apply that price in Cart? I know we can ...
user avatar
  • 9,473
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
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
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
3 votes
1 answer
4k views

how to add a new customizable product option

I want to add a new custom option that has a special datepicker. So basically I just need the type text with a new template, that template x-magento-init a js-file and this template gets passed some ...
user avatar
  • 1,582
6 votes
2 answers
1k views

How to exclude products being added to cart based on products attributes?

How can i set a condition, if pre-ordered products are purchased, no other products can be added to cart? How can I set a condition like, if some of the "non-pre-order" products is in the cart, ...
user avatar
4 votes
3 answers
3k views

Get all orders of customer using customer's token in Magento 2 API

I want all orders of customer using customer's Token in Magento API. Which gives the list of all previous orders of the customer. This API provides me the cart products of specific customer using ...
user avatar
  • 7,399
3 votes
1 answer
673 views

How to find Customer cart overall weight?

How can I find customer cart overall weight?
user avatar
  • 95
3 votes
2 answers
14k views

magento programatically create order with php code

i wrote a code that does below 1: created customer if customer not there --> this part works fine 2: logs in customer add product to carts and do checkout --> this does not works below is code, ...
user avatar
3 votes
2 answers
5k views

Dropdown for add to cart qty in Magento 2

Rather than having input box, I would like to place dropdown for product qty to add to cart. So to do this, I've done the following: In my \app\design\...
user avatar
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
4 votes
1 answer
5k views

Magento2: How to get Cart items collection on Product view page?

I want to get Cart items collection on product page. customer-data.js define([ 'jquery', 'ko', 'uiComponent', 'Magento_Customer/js/customer-data' ], function ($, ko, Component, ...
user avatar
  • 1,127
4 votes
2 answers
11k views

Get all abandoned carts in Magento

How could I get all the abandoned carts with customer's email (programatically)? What does Magento consider as being abandoned? Not updated in the last day?
user avatar
4 votes
2 answers
5k views

Magento 2: How to hide quantity box for certain products which has only quantity?

I have certain products, which customers can buy only one. So whether needs to remove Qty box for that products only or can be managed from settings?
user avatar
  • 9,473
2 votes
2 answers
613 views

Magento 2 how to display shipping methods sort order by price?

Hi we would like to sort and display the shipping methods by price Low to High on checkout page. For example: $31.72 Express Saver Federal Express $37.50 2 DayFederal Express $80.47 Standard ...
user avatar
1 vote
2 answers
10k views

Magento 2 : How to Update cart after cart update event (checkout_cart_update_items_after)

I am trying tho again update cart after update cart action(when cart qty is updated from cart page Or from miniCart) and change the qty if some cases $mappedProductSkus= $this->_helperData->...
user avatar
1 vote
3 answers
5k views

Remove Shipping Estimate Block From Cart Summary

I am having trouble removing the block-shipping from the cart summary in Magento2. This block allows users to obtain a shipping estimate on the cart page. The rest of the summary contents should ...
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 ...
user avatar
  • 1,778
4 votes
1 answer
2k views

Magento2: how to remove all cart's items from controller?

Please, how can i remove all cart's items from controller? namespace Demo\Demo\Controller\Demo; class Demo extends \Magento\Framework\App\Action\Action { public function execute() { ...
user avatar
3 votes
1 answer
2k views

How to create Mouseover Shopping Cart Icon in right header?

GOAL: Add a SHOPPING CART ICON to Magento 1.8.1 - Ideal Cart will look like this: http://www.cctvhotdeals.com/ And contain the features such as # of items, mouseover to show items, etc. To Clarify ...
user avatar
  • 144
1 vote
4 answers
915 views

Why does getSize() does not match cart collection size?

Question popped up here: Filter collection on checkout/cart Why does a filtered $collection->getSize() returns correct value, but iterating over collection has more items? three items are in cart ...
user avatar
  • 11.5k
1 vote
2 answers
7k views

Programmatically add items to cart and assign to guest user

I got the code working for creating quote object and quote item object, and I'm able to create quote successfully which I could confirm it by checking the database, I also created cookie named front-...
user avatar
  • 121
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
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
3 votes
3 answers
33k views

Terms and condition on checkout page

I am new in magento. I want to have terms and condition checkbox on cart page where proceed to checkout button is there. I have enabled terms and condition but it is on the last of the all process. ...
user avatar
  • 359
6 votes
1 answer
5k views

Magento 2 - How to show tax and shipping costs in mini-cart pop up

How to show tax and shipping costs in mini cart popup in Magento 2?
user avatar
  • 2,184
6 votes
3 answers
3k views

How to add link in Success message?

I want to add link in cart added message Make shopping Cart as link In checkout cart add controller i am changing message like this $message = __( 'You added %1 to your <a ...
user avatar
  • 5,051

1
2 3 4 5