We have the following custom business logic to implement in our aggregation module.
Customers (mostly departments, affiliates, ...) can place orders and together they can lower the price of an item by using a "global" tier pricing setup.
So the final price of an item should be based on the total quantity available in the cart - as implemented right now by this package - plus the quantities already ordered by other customers.
We are using the latest tagged version v2.1.0, where the methods in the observer are defined as private
. In the master branch, however, they already seem to be defined as protected
.
So we could already rewrite _calcConfigProductTierPricing
and implement our own logic. Even better, imo, would be to extract the quantity calculation to its own method.
This way we could implement our logic in a very DRY way...
class Rewrite_ConfigurableTierPrices_Model_Observer extends Spranks_ConfigurableTierPrices_Model_Observer
{
protected _calculateProductQuantity($product)
{
$quantity = parent::_calculateProductQuantity($product);
return $quantity + $totalQuantityOfAllOrdersCustomValue;
}
}
Wdyt?
Would you accept a pull request that implements this?