I've programmaticaly allowed the customer to edit the price of a product.
the problem is when i add product with 400$ and adding again the same product with 500$, in the shopping cart page it displays the product -| qty=2 -| total price=1000$
so this is not logic the total price must be 900$ and it should not set qty to 2
i know the problem is in the SKU is there a solution for this i don't wanna modify the SKU?
the issue for me is :
it should be like this :
this is working for custom price :
/**
* @param Varien_Event_Observer $observer
*/
public function applyCustomPrice(Varien_Event_Observer $observer) {
/* @var $item Mage_Sales_Model_Quote_Item */
$item = $observer->getQuoteItem();
if ($item->getParentItem()) {
$item = $item->getParentItem();
}
Mage::app()->getRequest()->getPost();
$customPrice = Mage::app()->getRequest()->getParam('custom_price');
$defaultCp = $item->getProduct()->getData('min_price');
$product = $observer->getEvent()->getProduct();
//$product_id = Mage::registry('current_product')->getId();
$product->addCustomOption('testpricez', '1078');
if($customPrice >= $defaultCp){
$item->setCustomPrice($customPrice);
$item->setOriginalCustomPrice($customPrice);
$item->getProduct()->setIsSuperMode(true);
}
}
i've done many search but without result
how to do this with the observer ?