I want to change the special price when it get displayed on the frontend.
so, if the special price is $25 then I want it to show $(100+25). How can I achieve this. I created a plugin which update the afterGetPrice()
(works for regular price only).
Is there any way to change the special Price/tier price on the frontend only. (It must checkout with the updated price-- $125)
my di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Model\Product">
<plugin name="change_product" type="vendor\module\Plugin\Model\Product" sortOrder="1" />
</type>
</config>
and Plugin/Model/Product.php
<?php
namespace vendor\module\Plugin\Model;
class Product
{
public function afterGetPrice(\Magento\Catalog\Model\Product $subject, $result)
{
return $result * 2.25;
}
}
which display the product with the wanted price but this piece of code does not work if product has special price..I want to do the same for all price types.