Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions related to the functionality of adding product to shopping cart in Magento.
3
votes
Accepted
Adding multiple products to cart failing
Try
...
$params_one = array(
'product_id' => $prod_one->getId(),
//^__change to product id
'qty' => 1
);
$params_two = array(
'product_id' => $prod_two->getId(),
//^__change to p …
2
votes
How to add a simple product with more than 1 option to Cart?
Assuming that you are using magento v1.7.*, then to add simple product with more than 1 option to Cart try
$product_id = 165;
$option_id1 = 424;
$option_val1 = 6699;
$option_id2 = 433;
$option_val2 …
1
vote
Accepted
Dont allow two specific products to be in cart at the same time
Take a look at Stop add to cart and supply message to user in Magento
<controller_action_predispatch_checkout_cart_add>
<observers>
<aquait_aquait_name>
<type>sing …
0
votes
Accepted
Add to Cart via AJAX - should I add a configurable product with options or a simple product?
You can use either type, see Adding a product to the cart via querystring
To add a simple product with custom options simply add options[id]=[value] to the end. The basic structure is:
/path/to/m …
3
votes
How to add particular product into cart programmatically at admin side
Assuming that these item are simple products
Take a look at Programmatically create admin order with pre-populated basket & customer
Create a module with a admin controller
protected function _getS …
1
vote
Multiple Add to Cart Button from External php site using product id
This is no longer possible as of magento v1.8 which check to make sure you have a valid form key.
But you could always create a custom module to by pass this see
Magento - Add a product to the cart …
0
votes
magento 2.4 add to cart multiple simple products with options
Try
namespace MagePal\CustomCart\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Checkout\Model\Cart;
use Magento\Catalog\Model\Product …
0
votes
Redirect to Category Page after “Add to Cart”
You could try
Add a hidden form field in
In app/design/frontend/default/OURTHEME/template/catalog/category/view.phtml
<input type="hidden" name="current_category_id" value=<?php $_category->getId( …
0
votes
Add product and coupon to cart together
You could customize your add to cart button to use the querystring method
See magento: URL querystring for adding product and applying discount coupon to cart
http://www.example.com/checkout/cart/a …
0
votes
How to set userid for products added to cart in magento?
Try
....
$cart->addProduct($product, $params);
$cart->save();
$customer_id = Mage::getSingleton('customer/session')->getCustomerId();
$quote = $cart->getQuote();
$quote->setCustomerId($customer_id); …
0
votes
Whenever a product is added to cart an additional qty of same product should be added to car...
See Whenever a product is added to cart an additional qty of same product should be added to cart
Option 1 - (Don't recommend)
You can create a preference for
Magento\Checkout\Controller\Cart\Add
and …
2
votes
Is there an event for apply coupon action in cart
class NameSpace_Module_Model_Observer
{
$productId = 1;
$couponId = 'xyz';
public function yourObserverMethod($observer)
{
$quote = $event->getQuote();
$item = $event->getIt …
2
votes
How to change product name in quote item dynamically
Take a look at Magento change product name adding to cart
Use event sales_quote_item_set_product
class Mynamespace_Samples_Model_Observer
{
public function salesQuoteItemSetProduct(Varien_Event_ …
0
votes
Magento 1 : How to disable product price update on the front-end when changing a product Qty
You could try
A coupon rule - e.g Buy one get one free
Change the unit cost dynamically (cost = item price / qty) - e.g Update price of item before adding to cart!
Setup tier price rule in admin
Cr …
24
votes
Accepted
How to "add to cart" a product with custom input field and save it to Database?
To accomplish this you could use Magento built-in "additional_options" functionality so that you don't have to edit email template, admin order view, customer order view (etc) to display your custom o …