Questions tagged [addtocart]

Questions related to the functionality of adding product to shopping cart in Magento.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Magento 2.3.X : Display error message when user add more products to cart than the stock quantity in

Thank you for reading my question. I am working on a Magento 2.3 version and facing an issue which is When I add the product to cart more than the available stock it doesn't show the error ...
0
votes
1answer
12 views

Tier prices are not applied on adding to cart

I have set tier prices on products. while adding to cart the price should be like attached screenshot. Normal price is 30 while for 2 it will become 29.5 but after adding to cart it still shows 30 for ...
0
votes
0answers
15 views

Add to cart very slow after install amasty full page cache

I installed Amasty full page cache(1.8.21) to speed up my site(magento 1.9.4.1 porto theme). everything is fine but after a few hours adding products to the cart is very slow. but when i flush caches, ...
0
votes
0answers
7 views

How to preserve product form values if validation fails when adding to cart?

We have some configurable products in our store with 3 configurable attributes and 3 customizable options. All of these attributes and options are required. When a customer is on the product page, ...
1
vote
0answers
18 views

Magento 2: Rest API throws error “The consumer isn't authorized to access %resources”

Working in to the rest API and checking with the postman storeConfigs, storeViews, currency etc... API working fine but i am workign on Add to Cart API and it's throwing in below response. "message": ...
0
votes
0answers
17 views

Cart edit page deletes all the previous saved data

I have added some of the products to the cart and then want to edit it. So, I have clicked the edit button, but after clicking edit button it deletes all the previously added products. How can I ...
0
votes
0answers
26 views

How to Restrict product add-to-cart if cart has specified category of products?

If my cart consists category id = 4 products, no other products eligible to add-to-cart, how to restrict by using anything, i tried using observer it not work.Please any one help.
0
votes
1answer
32 views

Magento 2 cart keeps loading

I have a weird bug. Every time I add a product to my cart it shows as if it were loading. However, it adds the product to the cart, if I switch to another page or reload the loading disappears and ...
0
votes
1answer
34 views

Add configurable products to cart display waring message instead of redirecting

In magento 2, by default, if I try to add configurable products to cart when not selecting any swatch values, I will be redirect to product page. How can I prevent this and display a message like in ...
0
votes
0answers
14 views

How to highlight simple product associated to grouped product , which is added to cart on pdp page

I have a grouped product page where I need to highlight the simple product added to cart. When someone adds an simple product to cart I need to change the colour of the simple product div on product ...
0
votes
2answers
71 views

Restrict products to purchase using Observer not trigger

Condition: I have restricted category of products [category id = 680, 894, 895], this category of products should be purchase alone, not mixed with other products. Workout: Case 1: If cart had other ...
0
votes
0answers
35 views

Magento 2 Dropdown for Quantity instead of text box

I tried this solution it worked perfectly for me on my Magento 2.2.9. I just wish to extend it with the below functionality - Quantities for the drop-down to pick up from the Tier Prices for the ...
0
votes
1answer
29 views

Magento 2 Move delivery time below add-to-cart-button

I want delivery time shown after add-to-cart-button. I have already have custom catalog_product_view.xml with this entries: <referenceBlock name="product.info.overview" remove="true"/> <...
0
votes
0answers
13 views

Quote Items are showing only if flush cache - Magento 2

I am trying to get cart quote items by the following code: File: app/code/Essence/Fcf/view/frontend/templates/packages.phtml I called this file in my cms page by following code: {{block class="...
0
votes
0answers
22 views

How to pass the configurable product options in magento2 add to cart Url

How to pass the configurable product custom options to magento2 add to cart url. Thanks
0
votes
0answers
18 views

Products QTY and Add to Card in Admin

I need to create a Custom Module for update fast QTY (increase or decrease) in stock. My customer don't want to open each product and go to inventory and type the current stock and save. For this I ...
0
votes
1answer
31 views

Scroll to Top after Adding Product to Cart?

I'd like the user to be scrolled to the top of the product page upon successfully adding a product to their cart, so that they can see the success message. What would be the best way to accomplish ...
0
votes
0answers
14 views

Ajax call on product view page and that ajax calls on page load in magenro 2

I have different ajax call on product view page and that ajax calls on page load. when I try to do add to cart it waits for that ajax calls to be completed first before process the add to cart. so ...
0
votes
1answer
16 views

Logged-in Customer Cannot Add Products to Cart

We're currently on an instance of Magento 2.2.7 (most products and customers have been migrated from Magento 1). We have a strange issue where a small number of our customers are trying to order some ...
2
votes
0answers
19 views

Magento 2 - Add to cart not working after products loaded by ajax

I have loaded products collection using ajax. My controller URL is something like this: www.example.com/whoboughtthisproduct/index/getproducts Now products are loading properly, but when user click ...
0
votes
1answer
30 views

Override or Change Add to Card Button Text Without Backend Code (With Admin Panel)

I want to Override or Change the text of Add to cart Button, With my Admin Panel. Don't Want to change in back end Code. I find some method that add some xml code in particular page in content ...
0
votes
0answers
23 views

Add product with customized option in the cart through API

I'm having a problem adding a product with custom options in the Magento cart 2.3.1. After defining a custom option as multiple selection, I tried to add the product to the cart with the following ...
0
votes
1answer
16 views

Magento 2: How to rename “add to cart” text on catalog page only

I'd like to rename the "Add to cart" button to "View now" on the catalog page and homepage only. However on the product view it should still state "Add to cart". Which js files do I have to edit in ...
2
votes
1answer
38 views

If script is includeed from default_head_blocks.xml error is noticed

I am developing a site in magento 2.3 flurys.digifrizz.com If script is included through default_head_blocks.xml there are lots of require js error noticed <page xmlns:xsi="http://www.w3.org/2001/...
2
votes
1answer
30 views

Magento add to cart not working after cache

flurys.digifrizz.com is the site. In home page magento add to cart not working after cached. here is the custom_home.xml <?xml version="1.0" encoding="UTF-8"?> <page xmlns:xsi="http://www....
1
vote
0answers
25 views

Magento2: How to fix add to cart not showing in product details page

When I click on product details page not showing add to cart But when I search in inspector it's there but not showing on site console error: Error: Missing required parameters: site key How ...
0
votes
1answer
28 views

how to send variable from js to phtml magento 2

i want to pass the value of qty from js to my phtml file so how to proceed here is my code: $("#qty").change(function () { var value = Number($("#qty").val()); ...
0
votes
1answer
26 views

Add to Cart button not working for me, but working for other users

I just upgraded Magento from 2.3.1 to 2.3.2. Now I'm having a weird problem where when I click "Add to Cart" for a product, the "Add to Cart" button gets disabled for a second as it's processing, but ...
0
votes
0answers
12 views

Magento 2: Add to cart button in category page with pre-selected attributes of configurable child

I want to create an add to cart button for a child of a configurable product in the category page. I'm trying with this code where I add the super_attribute hidden fields with the values of the ...
1
vote
0answers
19 views

Add or remove option in quote item

I had to create a controller that added or removed an option from a quote item. I succeeded but did not convince the solution. It seems strange to me that I have to manage the correct populating of ...
0
votes
2answers
47 views

How to call observer before checkout page in magento2

I am working with magento2, and now I want open popup modal box when the user clicks on checkout link. Instead of the open checkout page, it should open my custom pop box with the module in magento2. ...
7
votes
2answers
239 views

Magento Custom Module for add-to-cart Not Working - Observer Triggered

Created module like No other products add to cart if restricted product available in cart and vice versa. My Module : app/etc/modules/Brst_Test.xml <?xml version="1.0"?> <config> &...
1
vote
1answer
38 views

How to add condition in add-to-cart button function? Magento 1.9

How to Add PHP script in add-to-cart function like if other products are trying to add add-to-cart, supposed selected id based products[restricted products] already available in add-to-cart here ...
4
votes
0answers
35 views

Unable to add multiple Products to cart in magento2

I have used below code in my controller. use Magento\Framework\Controller\ResultFactory; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; class Addtocart extends \...
1
vote
0answers
68 views

How to do selected single product should be purchase alone?

I have one restricted product, here how to do selected single product should be purchased alone? No other products are eligible to add add-to-cart if this product available in the add-to-cart, same if ...
0
votes
0answers
25 views

How to add additional custom price at the time of adding the product into cart in Magento 2?

I am using Magento 2.3.0 I have groped products on my website and all associated products of the grouped products are having tier prices and I displayed these tier prices in the product page in the ...
0
votes
0answers
17 views

Magento 2 : Add Params using add to cart API

I want to add a custom parameter in add to cart product api billing_period & subscription_start_date. I have tried with Magento's /V1/carts/mine/items API with below request data. { "cartItem"...
0
votes
0answers
27 views

Magento 2 add to cart performance issue

In my Magento 2 website adding to cart takes about 10 sec. Caching is OK. Redis is configured. Merging/minimizing for CSS/JS is enabled. I'm noticed that after first adding an item to the cart, adding ...
0
votes
2answers
51 views

Magento addtocart formkey 404

I've been struggling with this issue for a few hours now and thought to see if anyone else has any ideas on why it could be happening. When I try to add a product to the cart, I get a 404 error with ...
0
votes
1answer
24 views

How to customize Add to cart functionality based on product categories in Magento 2?

I am using Magento 2.3.0 I have some products in my website which allows custom printing and these products are assigned in category "Printing Products". Now I want to customize add to cart ...
3
votes
1answer
78 views

Restrict product add to cart in magento 2

i am using magento 2.1.5, and i have two tax classes. and i want to add only one tax class product in cart at a time. if customer try to add another tax class product, it will throw the massage. for ...
0
votes
0answers
35 views

$_product->isSaleable() shows different value in list page and view page magento 2

Issue: Out of stock set at admin side. On product list page display "Out of stock" while detail page shows "Add to cart" button. I have print the $_product->isSaleable() function on list.phtml as ...
0
votes
0answers
66 views

Magento2.3.1 getting issue when update qty

How to solve below error when trying to update qty in cart? "Something went wrong while saving the page. Please refresh the page and try again."
0
votes
0answers
49 views

Update custom option value of item in cart Magento 2

I have custom option for one of my product. I am able to save it's value in cart programatically using below code: $params = array( 'form_key' => $this->formKey->getFormKey(), ...
0
votes
1answer
40 views

Add Product to cart error: invalid request for adding product to quote

I have a plugin and i want to add a product to the actual cart. This is my code: $productId = 2; $params = array( 'form_key' => $this->formKey->...
0
votes
0answers
64 views

Magento 2.3.1 getting error “Your session has expired” while product added to basket

The strange thing is that this is only happenings on listing pages and not on PDP. I get a 404 on the following js files: pageCache.js addToWishlist.js amazonCore.js I'm running Magento 2.3.1 ...
0
votes
2answers
45 views

Magento 2 add to cart programmatically not working

Here am have a custom api at that API call am trying to add a product to cart but am not getting it. namespace Vendor\Cart\Model; use Magento\Framework\Data\Form\FormKey; use Vendor\Cart\Api\...
0
votes
1answer
13 views

Order “non-existant” product

I have my products repository externally and only use Magento 2 to actually order these items. Similar to this question here but unfortunaly that does not have an answer or specifics about ...
0
votes
0answers
13 views

Replace add to cart button [duplicate]

Hello I find module to replace text in button add to card and this is no working. Please help this is code Magenticians/Mymodule/view/frontend/layout/catalog_product_view.xml <?xml version="1.0"...
1
vote
0answers
54 views

Magento 2 customer is saved as guest even if he logged-in in quote table

We have an issue that if a customer is logged-in and add product to cart, in quote table we have a column as customer_is_guest, it is saving as 1, even if the customer is logged-in, it is showing as ...