all can you help me how to override a product's special price? I want to unset Special Price if that product does not meet my condition.
I was able to override Price to my custom value, but if there is any special price exists for that product, then the special price is showing so I can't set my custom price for that product.
Best Answer
First Create ‘Module.xml’ file at below location using following code. It will help to override our custom layout file. Path:
app\code\OSCP\ModuleName\etc\module.xml
Now it’s time to create our own custom layout at following path using this code. Path:
app\code\OSCP\ModuleName\view\base\layout\catalog_product_prices.xml
Lastly, we have to create one more file ‘default.phtml’ with our logic of overriding default price. Path:
app\code\OSCP\ModuleName\view\base\templates\catalog\product\price\amount\default.phtml
You can change $finalprice as per your requirement of price. Also, you can manipulate with these codes according to your needs.