matzee
matzee

Reputation: 11

Magento: Same item, different prices in quote/order

I would like to create an order in magento with the same product, added twice to the cart, but with different prices. For example;

3 pcs of product A @ 0 USD
12 pcs of product A @ 15 USD
10 pcs of product B @ 15 USD,

etc.

But, (when using Adminhtml_Model_Sales_Order_Create), if I first add the "free" products, they are overwritten the second 12 products.

Is it possible to add the same SKU to an order twice? If so, how?

Cheers, MO

Upvotes: 0

Views: 2561

Answers (2)

witrin
witrin

Reputation: 3763

You can also add custom options dynamically, without storing them permanently in the products, that they will be only used in the quote item:

// load the products
$a = Mage::getModel('catalog/product')->load('A');
$b = Mage::getModel('catalog/product')->load('B');

// add the default products
$quote->addProduct($a, 12);
$quote->addProduct($b, 10);

// customize the product a 
$a->addCustomOption('code', serialize('value'));
// add the customized product
$item = $quote->addProduct($a, 3);
// customize the price
$item->setCustomPrice(0);
$item->setOriginalCustomPrice(0);
$item->getProduct()->setIsSuperMode(true);
// set a custom message
$item->setMessage('This is a gift!');

Upvotes: 4

Nasaralla
Nasaralla

Reputation: 1839

Add and extra product option and make sure you have different option value for your different price types. Then it will show those products seperately.

You can add product options from you magento backend, Manage Products and in Custom options tab.

Upvotes: 0

Related Questions