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

Main Menu

Override product_override_price via plugin

Started by sandomatyas, March 14, 2016, 08:58:56 AM

Previous topic - Next topic


I have products in my store which have override price. Obviously this is the final price which the customer has to pay for the product.
But I want to write a calculation plugin which can override this price.
I checked the structure of vmcalculation plugins but as far as I can see it can't override the overrided price. I know it sounds weird but this is exactly what I need to do.

My guess would be triggering a vmcustom method at the very end of the calculationHelper.getProductPrices function just before return $this->productPrices;
Something like this:

$dispatcher = JDispatcher::getInstance();
$this->productPrices = $dispatcher->trigger('plgOverrideFinalPricesOrSomething', array($this->productPrices));

It would be some final intervention point after all the calculation rules. In my case it would be great and I suppose other developers would also appreciate an extra layer of possibilities.