Can someone explain why a custom option of type percent
is calculated using the final item price on a quote?
See here:
# File: app/code/core/Mage/Catalog/Model/Product/Option/Value.php
public function getPrice($flag=false)
{
if ($flag && $this->getPriceType() == 'percent') {
$basePrice = $this->getOption()->getProduct()->getFinalPrice();
$price = $basePrice*($this->_getData('price')/100);
return $price;
}
return $this->_getData('price');
}
It doesn't seem to make sense to do this. Here's an example to illustrate the problem:
Laptop Computer
---
Price: 500.00
Custom Options
---
1-YR Warranty: 20%
As I attempt to add this item to my cart along with the warranty option, my total cost as shown on the product view page will be 600.00
. That looks good, because 20%
is applied to the final price of 600.00
at that moment (100.00
).
But what happens in the cart if this method is called, after the option has already been applied to the item?
According to the getPrice
method above, it will show as 120.00
(20%
of 600.00
) ... clearly this is not right. And curiously, a stock installation of CE 1.x does not render custom option prices in the cart (only row totals).
Has anybody encountered this before? Or maybe more likely, what am I not understanding correctly here?