Questions tagged [cart]
Question related to the shopping cart: adding/removing products, shoping cart price rules, the appearance of the shopping cart page.
2,211
questions
0
votes
1
answer
22
views
Get cart items in Magento 2.4 blocks
I'm trying to get access to all items in the shopping cart in a block, but I can't seem to get them. If I try the code below to construct and $items = $this->_cart->getQuote()->...
0
votes
1
answer
33
views
How can I set discount in price at product order by a customer programmatically
If a customer places an order for 5 Qty of a product, then a 10% discount would be given.
How can I do in Magento2 programmatically
0
votes
1
answer
29
views
Add new tab in cart page with form in Magento 2.4.4
I want to add a new Tab on the cart page with a custom form.
Thank You.
0
votes
0
answers
18
views
Magento2 - Product in cart with final price
At the moment when I add the product to the cart Magento takes the tier price of the product if it feels it is different from NULL. Otherwise it takes its normal price.
So I would like to do is create ...
0
votes
1
answer
59
views
Place order button is missing in the checkout
I don't know how did that happened but I'm using onepagecheckout
Website: https://femascu.net/
Product to add to cart: https://femascu.net/femascu-leather-watch-8401.html
0
votes
0
answers
41
views
Add discount on each product based on product price
I have 100 products in my store and each product has different price. I want to add discount on each product based on specific price.
For example, If a product is added into the cart and it has 100usd ...
1
vote
2
answers
54
views
I have added a new column in quote item table and I want to add data against this custom field when i add any item in cart through cart API
I have added a new column in quote_item table and want to add this field as a parameter in cart API payload but I don't how this will happen.
This is what I get when i try to hit add to cart api.
...
0
votes
2
answers
26
views
How to override CartItemInterface class in in my custom model?
I have to add 2 new methods getter and setter in CartItemInterface but i am facing issues.
Basically I have added a new column in quote item table and now I want to add this column in cart api.
Please ...
0
votes
0
answers
8
views
Fixed shoppingcart discount based on a product in the cart
We have a discount action on our webshop where customers get 1 free "Product B" for every "product A" they have in the cart.
We don't have a free gift module and right now aren't ...
0
votes
0
answers
7
views
Bundle product added to cart does not have url but clicking gives 404
When I add a bundled product(s) which are not visible on their own to cart, the simples show in the cart without a link. But clicking on them, it tries to go to the url {{BaseUrl}}/undefined and gets ...
0
votes
1
answer
14
views
How to multiply the quantity of the added product by 2 by clicking the add to cart button through the plugin?
How to multiply the quantity of the added product by 2 by clicking the add to cart button through the before plugin?
0
votes
2
answers
58
views
How can i remove object manager from my code of Magento 2
I don't want to use object manager, how can i change my code?
In the past, i have used method cart $cart but it is deprecated
<?php
namespace Custom\ShippingMethod\Model\Carrier;
use ...
0
votes
0
answers
21
views
New product not showing up as cart item in customer's cart
We are using Magento Commerce, on 2.4.3-p2. We recently added a new product to our catalog, with settings that seem to match all of our other products. However, when a customer goes to add the new ...
0
votes
1
answer
16
views
Get coupon / Discount object
In (themePath)/Magento_Checkout/templates/cart/item/default.phtml, i want get the coupon / Discount object.
I use this code :
@var \Magento\Framework\View\Element\AbstractBlock $block
[...]
var_dump($...
1
vote
0
answers
37
views
Why creating an empty cart via REST API requires parameters for quote address for this customer account?
I'm using Magento 2.3.3. Normally, calling this endpoint will return customer's quote ID. But for this specific user, I got this error as a response:
{
"message": "One or more input ...
1
vote
0
answers
56
views
Magento 2 - Go to checkout button is not clickable
Site was working fine and then suddenly "Go to checkout" buttons in minicart and shopping cart are not clickable. Can't seems to find the reason behind it. Does anyone has any idea why this ...
1
vote
1
answer
55
views
Duplicate cart items
community!
Bumped into an issue - duplicate items in a cart.
In the quote table, I have multiple quotes for the same customer. Items_count is increased like an exponent, eg 2, 3, 6, 178, 192. In the ...
2
votes
1
answer
79
views
How to set Shipping Method on product add to cart and show total including shipping cost in mini cart?
I want to set shipping method when product is added to cart and want to change shipping method based on products added to cart.I have tried multiple way but unable to set and change shipping method ...
0
votes
0
answers
11
views
How to add product to customer`s cart by admin restApi
I know only admin token, customer Id, and product Id. How can I add this product to customer`s cart using RestApi?
0
votes
2
answers
66
views
What is wrong in my ajax url?
I have written the following code
the js
$.ajax({
showLoader: true,
cache: false,
url: url.build('multiplecustomer/account/Logout'),
type: "POST",
}).done(function (data) {
...
1
vote
2
answers
110
views
Remove multiple items from your cart with just one click
In the Magento 2 cart when you click on the basket you can only remove one product from the cart. What I would like to do is to be able to remove multiple items from the cart at the same time as soon ...
0
votes
0
answers
16
views
Magento 1.9: How to put custom fee before tax in cart totals
Need help in Magento 1.9.
I made custom fee and I need to redener it before tax on cheeckout cart totals.
I tried to do this with (code bellow) but I am not successfull. Please help.
<...
0
votes
0
answers
34
views
Allow special product only to be purchased alone, not mixed with other products
My Magento 2 store has special products, which shouldn't be bought mixed with other products. How would I achieve the following:
Don't allow other products in cart if special product in cart
already.
...
1
vote
1
answer
128
views
how to change the required field of lastname in the checkout billing address form Magento 2
Good day people,
I have been trying to change the required field of lastname as not required in the form in the billing address of the checkout page:
As you can see the field of lastname is out and I ...
1
vote
0
answers
16
views
Unable to remove item from customer shopping cart from admin panel
I am using magento 2.3.5p2 Community Edition ( open source one )
I encountered this issue in which when trying to remove an item from a customer cart via admin panel, an error as below appear
Fatal ...
0
votes
1
answer
115
views
Cannot create property 'cart' on string '{}lax'
I have a very annoying problem: randomly our customers get the next javascript error, which hangs the shopping process, it also appears in the cart view.
Has anyone had this problem? what's happening ...
0
votes
0
answers
26
views
Create a Magento store Checkout url via Magento REST API
I have a marketing website and a separate Magento store for ecommerce.
Can I use Magento Rest API to:
Create a cart on magento store with the specific product
Generate a Magento Checkout url?
The ...
0
votes
1
answer
66
views
Minimum order amount by customer segment
I would like to be able to create the conditions for the cart:
Minimum quantity
Minimum amount
According to customer segments.
Each customer segment will have a different cart condition
Example: ...
0
votes
1
answer
191
views
messages disappear too fast when updating quantities via an ajax request
I'm trying to update quantities in the shopping cart in Magento 2.3.2 via an ajax request but I'm confused about the error messages.
In my code after the ajax request has completed I execute the ...
0
votes
0
answers
12
views
no-route-2 custom module magento 1.9 (anonymous page access)
Good afternoon guys, I'm creating a module to add a product to the magento 1.9 cart, which is outside the site, on an external site. When sending the information from an external server via POST, ...
0
votes
1
answer
77
views
REST Api to get cart of anonymous user
As you know you can add products to the cart even if you're not logged in.
I need to retrieve what a user has added to the cart in a given browsing session. Then i need to edit it (add/remove to/from ...
0
votes
1
answer
52
views
Link from cart item to product page
When you add a product to your cart, it's showing on your minicart.
When you click on that item it's bringing back to the product page.
I'm looking to find how this link is made...looks like there is ...
1
vote
0
answers
38
views
Load shipping rates on click instead of page load on cart page
One of my website's cart page is slow and after some digging up I found that the shipping-rates.html is taking up time to load. Is there any way, through which instead of implicitly loading I can load ...
0
votes
1
answer
85
views
move shipping field to below shipping methods
I have a block that display in shipping-address-fieldset and i have try to move it using layout but i'm failing. i want it to be displayed below Shipping Methods. please help
Below is the layout file
&...
0
votes
0
answers
59
views
Magento 2.4.0 = How to I can apply Cart Price Rule Condition in this coupon Code?
I want to Add Cart price rule condition in my custom auto generated Coupon Code. If email is equal to test@gmail.com. How to i'll do this. Please check my code. This code is working Perfectly i just ...
0
votes
1
answer
22
views
Unable to retrieve the qty updated product value in the cart using Observer
I am trying to get the cart item value once the qty updated in the Cart page for the specific Item. Have used the below code to get the value, But the event triggered still its showing the old value.
...
0
votes
0
answers
15
views
How to notify customer when a product item increases or decreases in Magento 2 Cart Page
As you can see in the image I have added custom functionality so that the customer can increase or decrease the item quantity
Now I have to show a message that as soon as the customer increases or ...
2
votes
1
answer
108
views
Show a Text if attribute is set to "yes"
I want to display "it working" on default.phtml if the product is assigned to attribute [Franke] with "yes".
Please help. I have tried the below code, but it doesn't work
...
0
votes
1
answer
34
views
Add custom option Programmatically in cart its not increasing quantity in cart
I am adding custom option programatically in below observer.
<event name="checkout_cart_product_add_after">
<observer name="mymodule_checkout_cart_product_add_after" ...
0
votes
0
answers
16
views
Separate carts by store group
I've been operating a multi store group website for the past two years (Magento 2.4.1). Each store group has 2 store views (one in our native language and another in english).
Store Group 1
-- Store ...
0
votes
0
answers
191
views
Cart Tax rate Calculation Issue
I am using Magento 2.4.1.
I have created a tax rule of reduced 2.5 % on a product basis.
I have added a product having a price of 1 and quantity of 10, normally tax rule should calculate 0.25 as tax ...
0
votes
1
answer
57
views
How to add add to cart with ajax to custom phtml
I have to add add to cart button on homepage. I have custom phtml in my own module. I would like this button to work with ajax. Could someone please suggest something?
0
votes
1
answer
122
views
Magento 2: How to show price in decimal (Instead rounding) in cart items & cart summary?
In above image showing product price KWD0.245 but Summary section Subtotal showing KWD0.250 (Automatic roundup) , how to avoid subtotal automatic roundup. I want to show subtotal as KWD0.245.
Thank ...
0
votes
1
answer
123
views
Setting a custom item subtotal when adding product to cart?
Magento 2.4
I already have my observer in place, but setting a custom subtotal for my item does not work. I am listening to the checkout_cart_product_add_after event. This is my observer code:
$item = ...
0
votes
1
answer
24
views
how to get the name of the category that the user used to add the product to the cart. Magento 1.9
I need to get at cart what category the product came from. The problem is that the product is added to several different categories, and I need the category in which the user accessed to add the ...
0
votes
0
answers
68
views
Magento 1.9 add to cart slow when cached
We have been experiencing an odd issue on some of our sites since moving from Magento 1.7 to 1.9. When a sites cache hasn't been cleared for a while add to cart is extremely slow. This also affect the ...
0
votes
0
answers
61
views
why update cart on checkout doesn't work properly?
I'm in Magento 2.4.3 and when I try to update the cart quantity and click on Update Cart in the right corner, the quantity I've setted is gone (so if I wrote 2, it comes back to default 1).
Here's the ...
0
votes
1
answer
185
views
Multiple shipping method for single order
I wanted to build a functionality where user can choose or select shipping method per cart item.
For example I have 3 items in my cart as below-
Item-1
Item-2
Item-3
On cart page all the available ...
0
votes
0
answers
8
views
Cart, incl. tax not calculated ye
On my cart, do you know why my tax calculation is not "calculated yet"?
I used to see the tax value but now I see "Not calculated yet" do you know what do I need to change to see ...
0
votes
0
answers
28
views
disable shared cart between stores of 1 website in magento 2
I have 1 website and 3 stores. I want to disable cart sharing between stores. eg: If I have a product in a cart of 1st store then it should not display in 2nd store.
I have applied this solution:
In ...