A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
6answers
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 ...
45
votes
5answers
113k 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.
20
votes
3answers
22k 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 ...
23
votes
4answers
47k 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.
27
votes
8answers
29k 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 ...
15
votes
2answers
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(...
4
votes
2answers
6k 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 ...
15
votes
5answers
11k 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 ...
31
votes
4answers
17k 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 ...
6
votes
2answers
6k 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 ...
1
vote
3answers
4k 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 ...
1
vote
2answers
2k 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 ...
6
votes
3answers
13k 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')->...
7
votes
3answers
2k 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 ...
7
votes
2answers
5k views

How to add “Buy Now” button in Magento 2.1? [closed]

I need help to add "Buy Now" button on the product detail page. Thanks.
4
votes
3answers
8k 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 ...
3
votes
0answers
231 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
3
votes
1answer
2k 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, ...
2
votes
2answers
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 ...
1
vote
0answers
894 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 ...
33
votes
8answers
14k 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 ...
7
votes
5answers
27k 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 ...
9
votes
2answers
11k 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 ...
5
votes
2answers
13k 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 ...
5
votes
2answers
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, ...
3
votes
1answer
451 views

How to find Customer cart overall weight?

How can I find customer cart overall weight?
4
votes
2answers
10k 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?
3
votes
2answers
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, ...
8
votes
2answers
3k 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 ...
4
votes
1answer
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() { ...
3
votes
1answer
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 ...
1
vote
4answers
572 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 ...
1
vote
2answers
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-...
8
votes
4answers
14k 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 ...
5
votes
1answer
11k 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 ...
3
votes
3answers
30k 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. ...
1
vote
1answer
2k 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 ...
6
votes
3answers
2k 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 ...
3
votes
3answers
2k 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 ...
2
votes
3answers
5k 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.
2
votes
1answer
3k views

How do I add a custom field to the cart in magento 2?

I am a little new to magento 2 and am looking to add a custom field to the cart to display how many dollars the customer has left to get free shipping. It's basically something like: <div> <...
1
vote
1answer
3k views

Add to Cart Button Next To Each Grouped Item?

I have a grouped product with a large amount of simple products. I want the quantity of the simple product to default to the maximum stock available. Issue with this that the current "Add To Cart" ...
8
votes
3answers
14k 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 &...
4
votes
4answers
9k views

Magento place order redirects to shopping cart empty

I just changed my server, all the files and database are the same i had previously. Now all of sudden i am having this issue. I add item to cart, go to checkout page, click on place order and magento ...
4
votes
1answer
1k views

Update cart quantity for a grouped product - grouped products not properly supported in magento core code

I'm going mad on this one Scenario: my simple products all hidden. what the visitor sees are grouped products with the simple products associated. I can add to the cart programatically: $params['...
3
votes
1answer
1k views

Cart items not updating properly in Magento 2

As per functionality product have different Tier Prices and customers have different Customer Groups. When customer adding product to cart we need to add product of the first Tier Price. Example: ...
3
votes
1answer
670 views

Hide State/Province from Estimate and shipping tax from cart page magento2

How to remove State/Province field from the cart page? I tried using jquery to remove it, that didn't work for me. <script> require(['jquery', 'jquery/ui'], function($){ $(document)....
2
votes
1answer
6k views

Magento 2 - Show custom Block on Cart Page

Namespacee/Modulename/Block/Productpoint.php <?php namespace Namespace\Modulename\Block; class Productpoint extends \Magento\Framework\View\Element\Template { public function __construct( ...
1
vote
2answers
3k 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 ...
1
vote
2answers
6k views

Create a Shopping Cart Rule - To offer 5% discount for two products or more

I am trying to create shopping cart rule: Two or more DIFFERENT products should be added to a cart Include Products only from categories "6 & 8" Apply 5% discount Any help appreciated. Thanks