News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to modify override price in vmCustomPlugin?

Started by MikUrrey, December 06, 2014, 18:00:40 PM

Previous topic - Next topic

MikUrrey

Hi all!
This is calculation method in my custom plugin:

public function plgVmCalculateCustomVariant($product, &$productCustomsPrice,$selected){
if ($productCustomsPrice->custom_element !==$this->_name) return ;
$customVariant = $this->getCustomVariant($product, $productCustomsPrice, $selected);
if (!empty($productCustomsPrice->custom_price)) {
if (empty($customVariant)) {
$productCustomsPrice->custom_price = 0.0;
}
}
return true;
}

If product has override price this method not works, because calculationHelper::getProductPrices not allows this.
I try to write this:

if (isset($product->product_override_price))
$product->product_override_price += $productCustomsPrice->custom_price;

before method return but this code not works correctly.
What to do?