Questions tagged [addtocart]

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

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

Adding to cart from external site (for non existing customers)

I have heard that you can use the Magento 2 REST API to add to cart: https://devdocs.magento.com/guides/v2.4/rest/tutorials/orders/order-add-items.html But is it possible for a brand new customer that ...
user avatar
0 votes
2 answers
13 views

Can not add2cart grouped product when 1 input field is diabled

I need to disable the input field when customergroup = 0 or 1 and quantity is < 0 but when I add the argument 'disabled' to the input, the add2cart button does not put the other available items in ...
user avatar
0 votes
2 answers
26 views

magento 2.4 add to cart multiple simple products with options

I'm trying to add to cart multiple simple products with different custom options at once. So far, I've overridden the checkout/add controller and replaced the line $this->cart->addProduct($...
user avatar
  • 129
0 votes
1 answer
23 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" ...
user avatar
  • 3,069
0 votes
0 answers
20 views

Can i show separate product in cart if has custom options?

I have simple product with custom option in backend. I have added 2 add to cart buttons in product page . one will add with custom options and one will add product without custom options. If customer ...
user avatar
  • 3,069
1 vote
1 answer
35 views

Incorrect items' quantity and total sum in cart when adding more than 1 item

I've just noticed a very strange issue-if I try to add more than one item to cart, then total quantity is always -1 to real quantity and Total sum consist of doubled prices of every added item apart ...
user avatar
0 votes
0 answers
11 views

Add to cart error customization

how can i edi popup error message to my own customize message on adding to cart due to expired session of a customer (You cannot add "Product A" to the cart.) I want to change this to (You ...
user avatar
  • 1
0 votes
1 answer
27 views

Add To Cart Problem with Grouped Products

Most of my products are Grouped. The problem I have is that on the Category Pages when the Add To Cart button is clicked, it goes through to the Product page and immediately has the warning message at ...
user avatar
  • 172
0 votes
1 answer
17 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 ...
user avatar
  • 197
0 votes
0 answers
11 views

Installation and Varnish Error marketplace magento

I have submit extension on marketplace. Marketplace giving error Installation and Varnishacache Log file content: HTTP/1.1 404 Not Found returned for "https://magento2.docker/simple-product-11....
user avatar
1 vote
0 answers
50 views

GraphQL Magento 2.4.4 How to add "Additional Options" add to cart

We need to add additional data in cart items like code, label, value, etc. from graphql add to cart. We have reviewed the Magento docs block "CustomizableFieldOption" but not work with my ...
user avatar
4 votes
0 answers
82 views

How to add "Additional Options" to product while add to cart using GraphQL

I am using magento's default add to cart graphql to add product in cart. mutation { addSimpleProductsToCart(input: {cart_id: "aIvRj9FfJvQr3qcAECmFfZlVbxcwQ1G6", cart_items: ...
user avatar
0 votes
0 answers
55 views

add to cart success message shows up only one time

the problem is client wants to fadeout the success message after few seconds by clicking add to cart button. i have made a change in addCartSuccessMessage.phtml file like this: <?php /** * ...
user avatar
  • 1
0 votes
0 answers
30 views

Missing field 'uid' while computing key fields when used react mutation graphq

Help me! Not add product with mitation, always show this error. thank you
user avatar
1 vote
2 answers
21 views

ADD TO CART BUTTON DOESN'T APPEAR

In both catalog and product page the "add to cart" button doesn't load. I get an infinite loader instead of the "add to cart" button. Does anyone know what this could be?? I have ...
user avatar
0 votes
0 answers
10 views

How to get custom attribute and how i can set condition for add to cart on category page in magento2?

I created two custom attribute named season_start and season_end which type is date,i want when season_start date and season_end date is set to future from admin,So the cart button should not visible ...
user avatar
  • 13
1 vote
0 answers
16 views

Magento 2 add buy now button on product page & mini cart

I am using Magento 2.4. I am trying to add a "buy now" button on the product & cart page, but unfortunately, when I click on the button it adds the product into the cart. Instead of this,...
user avatar
0 votes
1 answer
10 views

add "add to cart" button in popup containing attribute information

in catalog page, there is a tool tip next to each product,once we click on it a popup, that contain attribute detail and add to cart button, should appear. my question is how to add 'add to cart' ...
user avatar
0 votes
1 answer
203 views

Understanding data bind at minicart in magento 2

I am using magento 2 in mini cart, I am trying to get the event during which product is being added and removed, a specific item not by cart shown is the item that exists in mini cart, I want that ...
user avatar
0 votes
0 answers
14 views

Magento 2 product page show backorder insteed of add to cart

Hope there is one that can help me out with this problem. I made it years back for M1 but can remember how and now I need it for my M2 website. On the productpage I want to show backorder insteed of ...
user avatar
1 vote
1 answer
37 views

Magento 2 : Disabled product is removed from the cart

I want to set a message when a disabled product is removed from the cart. Does anyone have any idea about it?
user avatar
0 votes
0 answers
28 views

Add Multiple Products in Cart Through Magento 2 REST API

How can I add multiple products in Add to Cart Using Magento 2 REST API? It's working perfectly for one item: Endpoint: https://store_domain.com/rest/V1/guest-carts/5dffy5BvEeuqZ3lLSAEPWD7SGJkvO2cY/...
user avatar
0 votes
0 answers
23 views

Magento 2:Add to cart performance issue detect in newrelic

I have noticed that when I add to cart it takes time to add product. When I jumped into codes and new relic report, I found out weird thing in my new relic report. Here I have an attached screenshot ...
user avatar
0 votes
0 answers
12 views

Restrict Adding Products in Magento 2 Not Working

I have used event observer to restrict adding products based on condition but it is not executing. Event name= controller_action_predispatch_checkout_cart_add Vendor/Module/etc/events.xml <?xml ...
user avatar
  • 121
0 votes
0 answers
13 views

Get Category, Brand and Product Attribute From Cart Subscribe Javascript When User Add or Remove Product From Cart

I am using magento 2.3.5-p2 I am required to get details of product attribute during user add/remove product in cart the details include :- Product name Product Sku Product Price Product Brand ( ...
user avatar
0 votes
2 answers
105 views

product add to cart after loading the product ajax call

How to trigger add to cart function After loading product by Ajax call. this above product loaded by ajax call I have to found solution if I click add to cart button, then add to cart function ...
user avatar
0 votes
1 answer
31 views

Magento 2: Create order without cart

I have a requirement to implement Google Pay in PDP. Like Buy with GPay in PDP. So once user click Buy Now with GPay button then we are adding that product to cart and once payment is done then we are ...
user avatar
0 votes
2 answers
25 views

How we can save varition of configurable dynamically

How we can save variation of configurable dynamically PLease Help me protected $_cart; protected $productRepository; public function __construct( \Magento\Checkout\Model\Cart $cart, \Magento\...
user avatar
  • 13
0 votes
1 answer
17 views

How to prevent certain items from being added to the cart first in magento1

As for the title, I would like to disable the prioritization of certain items from being added to the cart In Magento 1. For example, I want to treat a product with a price of 0 as not being able to ...
user avatar
0 votes
1 answer
82 views

Observe requisition list add to cart event

I have an event observer listening on checkout_cart_product_add_after which works when adding products to the cart from the product, category, and wishlist pages, but when adding products to the cart ...
user avatar
  • 123
0 votes
2 answers
70 views

magento2 before add to cart open popup how to?

submitForm: function (form) { //this.ajaxSubmit(form); var popup = $('<div class="add-to-cart-modal-popup"/>').html($('.page-title span').text() + '<span> ...
user avatar
2 votes
2 answers
54 views

How can I Disable "Add To Cart Button" in Magento 2?

Any help would be greatly appreciated.
user avatar
0 votes
1 answer
73 views

Magento2.4 How to add product to cart with a customizable option?

I am trying to add a product to cart with a customizable option. I can add simple products, but I have not successfully been able to add a product with an option. The product will eventually be added ...
user avatar
1 vote
0 answers
49 views

AddProductsToCart Mutation Custom Option Upload File Magento 2.4

I am struggling to understand the correct way to get a custom option that is an uploaded file to attach correctly when adding a product to cart via graphql. I have tried using entered_options: [ {uid: ...
user avatar
0 votes
1 answer
32 views

Overriding the addtocart button for third-party api

I am new to Magento2 and currently working on a project where some products can be custom-designed via a separate API. So when the add-to-cart button is clicked, instead of adding the product to the ...
user avatar
  • 13
0 votes
1 answer
28 views

How to add item to cart?

How to add product to cart with price 0. It is something like an free product add to cart programmatic ally without any cart rule?
user avatar
  • 35
1 vote
0 answers
25 views

Highlight the products added in the cart

I am trying to make functionality on the category page in which the product which is in the cart shows a right mark beside the product name. I am able to achieve it for the norma add to cart but I am ...
user avatar
  • 183
0 votes
0 answers
97 views

Magento 2 : Update the product name while adding into the cart

I want to add something with the product name dynamically while adding to the cart. Each product have different concatenation with product name. And that product name should be updated on everywhere ...
user avatar
  • 12
0 votes
0 answers
20 views

Add to cart not working magento 2

I have m2 store up and running, Due to some requirement I have to change my website to run on http instead of https, So from the backend I have changed base url to http instead of https and change ...
user avatar
0 votes
0 answers
81 views

Magento2: Add Dynamic Custom option on add to cart using rest api

Hope you all are doing good!!! I am not creating any custom option for products but need to add custom options to any simple products while adding to cart with rest api so can you please assist me how ...
user avatar
2 votes
1 answer
453 views

After upgrade Magento 2.3 to 2.4 can not add product to cart

After click button ADD TO CART , it's error Cannot read properties of undefined (reading 'remove') and mini cart is empty too
user avatar
0 votes
0 answers
33 views

Adding product with textfield customisable option programatically via route not showing option value in admin

I've got a magento store with some products which have a text field customisable option, and there's a module to add these products to the cart via a URL - where the product ID and option value are ...
user avatar
  • 1
0 votes
0 answers
16 views

Qty and Add to Cart Not Aligned Properly For Configurable Products

I am using the default theme of Magento 2.4.2p1, and the Qty input and Add to Cart button do not align properly. They appear to be inline with the last attribute of the product options and move when ...
user avatar
  • 1
0 votes
2 answers
119 views

Ajax Add to Cart validation - When customer add more products to cart than the stock quantity is available in Product

When user is adding/increasing quantity than how to we can restrict him ? He can't add/increase quantity more than available saleable quantity. How to we can apply validation for display error message ...
user avatar
0 votes
1 answer
27 views

I want to select multiple products using a checkbox and add to the cart all in a single click

Is there anything out in the marketplace like this already? I'm willing to put in the work to build the solution but thought I'd check here for some pre-existing module or partial code I could use.
user avatar
0 votes
0 answers
30 views

How to add bundle product to cart using Magento\Quote\Model\Quote\ItemFactory

I want to add bundle products to the cart using \Magento\Quote\Model\Quote\ItemFactory. I have tried the below code and it is working fine. /** @var \Magento\Quote\Model\Quote\Item $quoteItem */ $...
user avatar
0 votes
0 answers
20 views

Magento 2 add to cart of custom Product type

I have created a custom product type like a bundle product. The parent product has associated with some child products. Everything works fine except for one cart issue. If I add the parent product ...
user avatar
0 votes
1 answer
55 views

How to add additional fee to subtotal of checkout/cart using events and observers? magento 2

Basically, I am trying to add additional fees to the subtotal of checkout/cart based on product_type. Here is what I tried but I am not able to get print_r($item->getBasePrice()); because I want to ...
user avatar
  • 109
0 votes
0 answers
19 views

Facebook Pixel issue in Magento 2

I am facing an issue of Facebook Pixel in Magento 2. Add to cart showing warning same as Page Views. How to i can figure-out this issue ?
user avatar
0 votes
0 answers
27 views

Add product to downloadable/customer/products/

<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $FormKey = $objectManager->get('Magento\Framework\Data\Form\FormKey'); ?> <form action="http:localhost:...
user avatar
  • 57

1
2 3 4 5
22