I want to add a "custom Price" which have been generated on the Product-Site to the product Price on the cart.
With the actual code it is only the value (price) of the hidden field which is delivered to the cart - without the product price.
Code with checkout_cart_product_add_after
:
public function change_price(Varient_Event_Observer $observer) {
$item = $observer->getQuoteItem();
if ($item->getParentItem()) {
$item = $item->getParentItem();
}
$newpricetest = Mage::app()->getRequest()->getPost('priceInput');
$new_price = $item->getOriginalPrice() + $newpricetest;
$item->setCustomPrice($new_price);
$item->setOriginalCustomPrice($new_price);
$item->getProduct()->setIsSuperMode(true);
}
What's wrong?
Mage::log('123');
in various places and different values. Make sure you have logging enabled from admin.