I have some product that has custom prices. Depending on the option selected, there is a formula applied that add fees to the product, so the price is never the same. The problem I have is that when you reorder, the price of the reordered product is always 0.
In sales/controllers/OrderController , in the function reorder,there is this :
$order = Mage::registry('current_order');
$items = $order->getItemsCollection();
foreach ($items as $item) {
try {
$cart->addOrderItem($item);
...
If I add these lines , I’m able to retrieve the custom price, but I can’t find a way to edit the item so that is the price being added in the reorder.
$options = $item->getProductOptions();
$options = $options['info_buyRequest'];
$customPrice = $options['custom_price'];
There is what I have tried (in the loop, before $cart->addOrderItem($item) ), without success.
$item->setSpecialPrice($customPrice);
$item->setCustomPrice($customPrice);
$item->setOriginalPrice($customPrice);
$item->setBaseOriginalPrice($customPrice);
$item->setBaseCost($customPrice);
$item->setBaseRowInvoiced($customPrice);
$item->setRowInvoiced($customPrice);
$item->save();
Any help?
Several possibilities. I’d try an event observer for the
checkout_cart_product_add_afterevent.