Questions tagged [addtocart]
Questions related to the functionality of adding product to shopping cart in Magento.
1,098
questions
2
votes
2
answers
8k
views
Magento2 catch ajax complete, add to cart
I'm building an custom mini-cart. I want it to update itself when an article is added to the cart. I'm trying to do this by jQuery with catching the ajax complete, but can't get it to work. Can anyone ...
2
votes
2
answers
13k
views
I want to use ADD TO CART via URL in Magento 1.8 but don't know which files to change
I have seen some suggested changes to make to call the FORM KEY to allow the ADD TO CART FROM URL to work.
<?php
$formKey = Mage::getSingleton('core/session')->getFormKey();?>
<form ...
2
votes
1
answer
4k
views
Magento 1.9 How to add buy now button in product page?
I am using magento 1.9, I want to add BUY NOW button on product details page, Buy now button redirect to checkout page. I tried many solution already solved in this forum, But all the solutions are ...
2
votes
2
answers
2k
views
How to get Product Submit Url on Category page?
On product page the product form has given action = <?php echo $this->getSubmitUrl($_product) ?>. I want to get this submit url on category page for each product but on category page it ...
2
votes
2
answers
656
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 ...
2
votes
1
answer
5k
views
Magento2 Change bundle item price in cart
I would like to change the price of the bundle product items after its has been added to cart and recalculate the bundle product price and changing the bundle item price.
I was thinking of using the ...
2
votes
2
answers
8k
views
How to create and add 'buy now' button along with add to cart button on each product?
I am new to Magento, using Magento 1.9. with a custom theme. I successfully created buy now button on addtocart.phtml by the following codes
<button type="button" title="Buy Now" class="button btn-...
2
votes
2
answers
5k
views
Add product to cart from email link
I am running a promotion and would like to make it very easy for customers to add three items to their shopping carts.
The research I have done around URL querystrings no longer seems to work on ...
2
votes
3
answers
5k
views
Add multiple items to cart in Magento2
I am implementing add to cart functionality from ajax using product id.
This is my code of template file
<tr class="border_bottom child-items selected">
<td >...
2
votes
3
answers
8k
views
"Add to Cart" button on CMS Page - non product page
So, I am seeking a way to give my customers the ability to add a product to the Magento shopping cart directly from a standard non-product page (i.e. CMS). I am using Community Edition 1.9 and from ...
2
votes
1
answer
9k
views
Magento 1.9 cart not updating
I have been trying add products to cart via ajax call by following the procedure given in http://excellencemagentoblog.com/magento-add-product-to-cart-ajax and I have successfully added products to ...
2
votes
1
answer
1k
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\...
2
votes
1
answer
2k
views
Add existing custom option to cart item if the option was not included initially
I can update existing cart values:
$item = $quote->getItemById($itemId);
$item->getOptionByCode('option_code')->setValue($value);
$item->saveItemOptions();
But this only works if the ...
2
votes
2
answers
2k
views
Cart & Checkout blank Magento 2.3 after trying to add product to cart
In Magento 2.3 I am attempting to add an item to cart, however the cart shows empty and if I 'proceed to checkout' the checkout page is blank with just the loading gif icon.
If I go to 'checkout/cart'...
2
votes
2
answers
814
views
Remove block from layout depends on condition
I want to remove block product.info.addtocart from layout depends on some conditions
2
votes
1
answer
5k
views
Magento 2 : I need to change add to cart success message after adding product into cart through plugin
I need to change add to cart success message after adding product into cart through plugin.
Currently i have used below code for override cart method and its working fine.
<preference for="...
2
votes
2
answers
5k
views
Add to cart configurable product programatically magento2
I tried with add to cart configurable product but getting error when run the custom code using observer but same code when run from controller than it's working fine. you can see below code for bundle ...
2
votes
1
answer
4k
views
Magento 2 - Quantity Field on Related Products Listing
I'm trying to add a quantity field to the related products section on my product page. I'm overriding module-catalog/view/frontend/templates/product/list/items.phtml in my theme. So far, here is my '...
2
votes
1
answer
5k
views
Magento2 Add to Cart from homepage not working
I've set up a Magento v2.0.6 installation Running Luma theme. I've created a own template based on the Luma with some minor changes (removing links, adding custom CSS etc.) at least nothing big.
I'm ...
2
votes
1
answer
979
views
magento2 addtocart not working in chrome and extremely slow
I have magento2 installed on local machine the addto cart works in mozilla on product page how ever its extremely slow and on chrome it shows adding after addto cart but it does not add at all, there ...
2
votes
3
answers
6k
views
Magento 2: How I can add Configurable products to cart from category view with selected options
Currently simple products added to cart works from category view. I want same it for configurable products with selected options should be add to cart from category view page.
Currently when I select ...
2
votes
1
answer
2k
views
Add to cart configurable products using magento soap api V1
Trying to add configurable product in magento cart using magento soap api V1 but not able to add the products. can anyone please let me know the way how to do it.
Any help would be appreciated.
2
votes
2
answers
603
views
How to add multiple products to cart programatically in Magento 2
This is the code snippet that I am using
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$quote = $objectManager->get('\Magento\Checkout\Model\Cart');
$_product = $...
2
votes
1
answer
2k
views
Magento 2 - Check if static block is enabled
On my Magento 2 store I have a static block that outputs a message to inform customers that the prices are not currently available. On my template files I'd like to wrap the prices and Add to Cart ...
2
votes
2
answers
1k
views
Before add to cart, how to get the simple product of configurable product which would be added?
Before add to cart, how to get the simple product of configurable product which would be added?
Notice the Before, because I need compare the simple product attribute with products already in cart to ...
2
votes
2
answers
703
views
Magento 2, Add Product in Cart in loop
i have written a small functionality, where i need to get data from XML or CSV and populate the data in the cart.
I am able to read the data from the file and create an array of the items
foreach ($...
2
votes
2
answers
357
views
want to move the extra images section below the main image in all product pages [closed]
I am building an ecommerce website named "bookslab.in". I want to move the extra images of product down below the main image of the product. I am attaching the screenshot of where i want to move the ...
2
votes
2
answers
1k
views
magento1.9 : Check if the customer already exist or not?
How to check whether the customer is already registered user or new user.
If they are a new user the product add to cart logic should be different, If they are a registered user the product add to ...
2
votes
2
answers
207
views
Want to make zipcode text field as a "required" field on my product page of magento site [closed]
My website bookslab.in is almost ready. I am selling the books online. Now i am stuck on this problem. I want to make the zipcode field on my product page as a "required" field before users add the ...
2
votes
1
answer
516
views
Magento Buy Now Button for Configurable Products
I Need Add a Buy Now Button For Direct Checkout.
I Have Coded But Not Working For Configurable Products.
If There Are Any Extension For That Please Suggest Me.
2
votes
1
answer
2k
views
Adding items to order as order is placed
I am trying to add a zero cost product to all shopping carts at time of placing order. So far I have my observer setup and working as
<events>
<sales_order_place_before>
<...
2
votes
1
answer
2k
views
Product specifications add [closed]
I just install magento. When I try to product add there already have many input field.
I need some multiple extra field that's can be some time one entry some time multiple entry
like
extra option ...
2
votes
1
answer
1k
views
How to add particular product into cart programmatically at admin side
Many a times you have heard or seen about how to add particular product into shopping cart programmatically at frontend side. But I want to do the same at admin side.
Suppose, I have product 'SLR ...
2
votes
2
answers
9k
views
Add to cart with custom option
I need help in adding cart with the additional custom option included on it
I've looked around stackoverflow and stackexchange for the answer but sadly it failed and they only add product simply, and ...
2
votes
3
answers
4k
views
How to get available quantity of product?
I am adding products in cart programmatically. But whenever I enter quantity more than available, it gives me a 503 error. e.g. Lets say a product has 7 quantity saved in admin and out of 7, 3 is ...
2
votes
3
answers
4k
views
Add to Cart from Wishlist not working
Maybe something is amiss with my Theme - but when I go into Wishlist and choose "add to cart" next to the item in the wishlist, nothing happens. No error or anything like that. You just click it and ...
2
votes
2
answers
3k
views
Adding a Product to the Cart via Querystring using SKU
I know that we can adding a product to cart via querystring.
but how do we add sku to cart via querystring in url without including product id
like this : domain/checkout/cart/add?sku=ABC or domain/...
2
votes
1
answer
3k
views
Adding multiple products to cart failing
Assuming I want to create a link for the customer to click on that automatically adds some items to cart and redirects them to the cart.
I created a controller that adds two items to cart, problem is,...
2
votes
3
answers
5k
views
add to cart button on featured products is not working [closed]
please visit this link : on home page, "add to cart button" on featured products is not working.
2
votes
1
answer
43
views
Magento 2 change the addtocart button text on detail page based on the product increment
I am doing customisation on PDP page as per my client requirement, For my requirement i am using the grouped product, also added a option to increase/decrease each product quantity count, when ...
2
votes
2
answers
401
views
How to change the Product NAME and SKU permanently in quote_item table when it is added to cart?
How to do this? I am using checkout_cart_product_add_after event.
EDIT:
After I did it like this
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
2
votes
2
answers
276
views
How can I Disable "Add To Cart Button" in Magento 2?
Any help would be greatly appreciated.
2
votes
1
answer
1k
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
2
votes
1
answer
111
views
How to move "addtocart" button to the left side in category view?
I'm pretty new to Magento2 and I'm trying to move elements inside category view.
I would move my add to cart button to the right of the screen in category view, and my quantity box too.
I've created ...
2
votes
2
answers
605
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 ...
2
votes
1
answer
56
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....
2
votes
3
answers
2k
views
Get productinfo from Observer controller_action_predispatch_checkout_cart_add
In Magento 2:
I have created the event observer:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...
2
votes
1
answer
767
views
How to implement ajax based toast notification for add to cart, wishlist and compare?
Is there any way to show toaster notification using jQuery for add to cart and wishlist and compare from product list page and detail page.
Want to show some of the below toast notification after ...
2
votes
1
answer
156
views
after magento upgrade 1.7.0.2 to 1.9.3.9 add to cart after blank screen open
URL like generate https://domain.com/stage/checkout/cart/add/uenc/
how to solve it this issue
Thank you in advance!
2
votes
2
answers
3k
views
Magento2 - duplicate quote item to new row and new price
Is it possible to add the same product (with same configurable options) with different price based on some custom values present in the product page to the shopping cart, but have it appear as ...