Questions tagged [addtocart]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
21 views

Magento 2 how to show another text if price is > 2000?

I want to show custom text instead of the price if the product price is > 20000. if price > 20000 then I want to show "contact for price" instead of price. Also, I need to hide the add to cart ...
0
votes
0answers
14 views

Magento 2 - JS Duplicated Add To Cart button

Because of reasons I'm having to duplicate some content on the productpage via JS. The duplication works fine, but the Add To Cart buttons don't fire anymore. Does anyone have any idea how to get the ...
0
votes
2answers
41 views

Add each product items separately to a shopping cart

I want to make adding to the shopping cart as a separate item on every action of clicking to a button Add to Cart. If the customer clicks Add to Cart a couple of times he/she should see different ...
-1
votes
0answers
24 views

Customer and admin login not working in magento 2.3.2

I have get client staging server code and database. Project is running but customer login, customer create account, admin login is not working. When I login just page refresh and nothing happen. ...
0
votes
1answer
35 views

Magento 2 Add product to cart fails

Constatly these errors get logged: Request validation failed for action "Magento\Checkout\Controller\Cart\Add\Interceptor" URI '/checkout/cart/add{removed form keys etc..} cannot be accessed with ...
0
votes
1answer
23 views

Magento 1.9 does available stock/qty change when product is added to cart?

I have a store where I selle unique products, so every product has a quantity of 1. When the order is placed, the quantity is decreased to 0 and the product changes to out of stock and it's no longer ...
0
votes
0answers
21 views

Property “RemoveTag” does not have accessor method “getRemoveTag” in class “Magento\GiftMessage\Api\Data\MessageInterface”

I am working on an extension attribute in cart page. I need to add a text box (remove_tag) along with the other text boxes for gift messages. On clicking on update button i am getting the following ...
0
votes
0answers
25 views

How to redirect the Magento 2 controller into post page

When I click on add to cart button from my custom page. If products are avaiable it goes to the Cart page and if not they are redirected to the Post page, but it redirects to the Index page. Can ...
0
votes
2answers
20 views

Magento 1.9 - How to add multiple products to cart at a time through add to cart Rest Api

I need to forcefully add product Y to cart if product X is add to cart. Both X and Y are individual simple products. The following is what i have done to achieve this: try{ $quote->...
0
votes
0answers
8 views

Magento 2 Product page seprate Custom Option, swatch color and Add to cart product page

I have a requirement of customization of product layout page. I created custom options on configurable product page which have also swatch color option.Now I want to move these blocks on bottom ...
2
votes
2answers
60 views

Magento:2.3.2: Add to cart is not working after element moved

I tried to move an element to above add-to-cart block at category page. Please check the following attachments. I need as the following: For product availability, I am using an extension. The name ...
1
vote
0answers
9 views

What is replacement of this function for converting order item to quote item

As magento/module-checkout/Model/Cart class is deprecated /** * Shopping cart model * * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @deprecated 100.1.0 Use \Magento\Quote\Model\...
2
votes
0answers
19 views

Magento2 : Add to cart is not working on enable FPC

On my magento2 store add to cart is not working when enabling FPC. /Checkout/cart/add ajax returning 302 error on click on add to cart button - When FPC disable then all works fine, /checkout/cart/...
1
vote
2answers
39 views

Magento 2: how to put extra text / drop down for decimal qty

I need to customize the addtocart.phtml in order to add an extra field for decimal qty. I want to use the actual input text for quantities in order to use ONLY unit and I need to create another drop ...
0
votes
1answer
60 views

Error “Your session has expired” when click on add to cart in magento 2.3

I am new in magento, I am creating website in magento 2.3 and I have installed FreeGo theme in my magento website. But when i click on product's add to cart then it's giving me error--> Your ...
1
vote
1answer
33 views

How to redirect on checkout page, after add to cart click on bundle product?

I need to integrate small stuff. When I will click add to cart ( bundle product ) then only product added successfully in cart page and then redirect into the checkout page. So please let me help. ...
0
votes
1answer
28 views

Error when add product to cart in magento 1

I installed a module ajax add to cart and when click add to cart, it show error Refused to execute script from 'http://.../ajaxcartsuper/ajaxcart/delete/id/...' because its MIME type ('text/html') ...
0
votes
0answers
8 views

Configurable product not redirecting to checkout page after clicking buy now button

Configurable product not redirecting to checkout page after clicking buy now button. After checkout page it comes to this url http://localhost/magento/checkout/noroute/ For simple product it is ...
1
vote
2answers
27 views

Magento2: existing quote doesn't load through a cron job

I want to get an existing quote through a cron job, but it returns null. Want get through this $this->quoteFactory->create()->loadByCustomer($custoemrId) or $this->quoteFactory->...
6
votes
0answers
235 views

Error in add or update a cart in magento 2?

Error in add or update a cart in magento 2? In magento2 , when create a new cart_price_rule in admin after update or add a product to cart its shows a error In admin, i was create a new ...
2
votes
2answers
32 views

Magento 2: Disable add to cart button for certain products in category page

I am doing a custom module and now I want to hide the 'add to cart' button for certain products. I have followed the https://magenticians.com/magento-2-disable-add-to-cart-button/ documentation and i ...
0
votes
2answers
43 views

Magetno 2: update custom column values for quote item during add to cart

I am calling ajax request and performing add to cart functionality. Here is my controller code, use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\...
1
vote
2answers
53 views

How to add out of stock product to cart programmatically in Magento 2.3

I'm using Magento v2.3, I want to add out of stock products to cart without changing any configuration from backend. I'm using following function to add product to cart addProduct($productInfo, $...
0
votes
1answer
40 views

Magento 2: Add to cart button on phtml file inside Magento

I have a Magento 2.2.9 based website and a cms page created that called in a phtml file. In that phtml file, I am wanting to have an add to cart button for a specific product. However, clicking the ...
0
votes
1answer
49 views

Magento 2: Override Product description and cart functionality

Want to change price-option calculation on the custom option. For eg: If customer selects cotton as material, width and height Cotton is 10$ Width : 12 Height :20 Base Price : 75$ Current ...
0
votes
0answers
37 views

Magento 1.9: Check Cart contains only selected category of products

My observer condition based on Cart products, how to check Cart contains only selected category of products? What event do I need to use?
1
vote
2answers
146 views

Magento2: How to restrict customer to require login for add to cart in whole website?

I need to integrate a functionality where when a user clicks add to cart it should check whether he is a logged in customer or not. If he is a logged in customer the product should be added in cart. ...
0
votes
1answer
29 views

Magento 1.9: Simple Product is not adding To Cart programmatically

When I try to add the product to cart programmatically then give an error The product could not be found. Here is my code for product add to cart programmatically. $productId = 2783; $cart = ...
0
votes
1answer
50 views

Update Product prices after adding to cart

I am trying to update product prices after adding to cart but the change on prices don't apply on it. I have created an event on checkout_cart_product_add_after while on observer I have written code ...
0
votes
1answer
58 views

Error Exception message: The product's required option(s) weren't entered. Make sure the options are entered and try again. Magento 2

Hi @all actually i am facing Error Exception message: The product's required option(s) weren't entered. Make sure the options are entered and try again. Magento 2 error while Products addToCart ...
3
votes
1answer
43 views

Magento 2: After adding products to cart programmatically, cart is not refreshing until reloading page

Hello Magento 2 Friends. I have an ajax call to an controller, which adds some new products to the cart programmatically. This works fine, but the problem is that the cart and the mini cart are only ...
2
votes
1answer
74 views

Magento 2: Add multiple products to cart programmatically does not work if cart is empty!

I have the same problem as mentioned in this Question: Magento 2: Add multiple products to cart programmatically But it was never answered. This is my Controller.php: <?php namespace MassiveArt\...
0
votes
1answer
19 views

Magento 2 limit max length in Qty field

I wan't to know how to set a max length for the Qty field that is when you click a product (I guess it's product View) I tried to override the following template and set maxlength = "4" but did not ...
1
vote
1answer
83 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
37 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
27 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
77 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
19 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
30 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
36 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
40 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
16 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
84 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
83 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
37 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
16 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
29 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
19 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
154 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 ...