Questions tagged [addtocart]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
18 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
16 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
  • 177
0 votes
0 answers
9 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
34 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
2 votes
0 answers
41 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
14 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
16 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
20 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
8 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
69 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
13 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
33 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
19 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
22 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
9 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
1 answer
53 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
27 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
16 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
55 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
58 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
41 views

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

Any help would be greatly appreciated.
user avatar
0 votes
1 answer
62 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
0 votes
0 answers
39 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
29 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
23 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
19 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
59 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
17 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
62 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
379 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
32 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
14 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
89 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
17 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
22 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
19 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
49 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
16 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
0 votes
0 answers
32 views

Add product to cart by url in magento 2

On the configuration page, I define the product id, now I need to call the URL: http://localhost: 3000/custom point/secret/addprizeproduct in the browser and add this product to the cart - this is ...
user avatar
  • 57
0 votes
0 answers
75 views

Add product to cart refresh when an exception thrown

I have a requirement to prevent a user from adding a product when a certain condition is not met. I created a beforeAddProduct plugin. At the beginning of the plugin i have this code: if(!$condition){ ...
user avatar
0 votes
0 answers
15 views

Add product to cart via phtml template

I have a separate product - id 2256, I would like to make it possible to add it through ajax in the template - i.e. there should be a separate button on the page - what is the best way to do this, ...
user avatar
  • 57
0 votes
0 answers
26 views

Notify Customer on Product/category page that this item already in cart

I have to notify the customer that this product is already in the cart on the product page and category page too before Add to cart Button like product page For Category Page I have tried to get ...
user avatar
0 votes
0 answers
7 views

How to keep 'In stock' even though the qty is 0 after a csv file import

We are currently running a cron job to import sku, qty, and price every 30 min. If the qty for a product becomes 0, the stock status changes from 'In stock' to 'Out of stock' automatically, 'Add to ...
user avatar
  • 23
0 votes
0 answers
31 views

Minicart and add to cart success message is not showing after product added to cart in Magento 2.3.3

Hello, I am facing an issue during add to cart. When a product added to cart then minicart is not loading also flash message is not showing. This is my product details page url "http://127.0.0.1/...
user avatar
  • 1
0 votes
1 answer
32 views

Fill HTML space while KnockoutJS renders

I'm doing an extension for the shopping cart which consists on adding and removing quantities using + and - buttons without reloading the whole page. Thus I'm using Ajax for sending the request and ...
user avatar

1
2 3 4 5
22