I'm trying to create a plugin where if the final price is 0, instead of showing a price is should say "please call for pricing".
I created a plugin like this, But I don't see any change.
<?php
namespace <Vendor>\<name>\Plugins;
class Product
{
public function aftergetCatalogPrice(\Magento\Catalog\Model\Product $product, $finalPrice)
{
$price = $product->getData('price');
if ($price === 0) {
$finalPrice = "Please call for pricing";
} else {
return $finalPrice;
}
return $finalPrice;
}
}
I have a plugin that does call for pricing, but I don't see anything that could be overriding the price.
How can I figure out where the price is being set so I can override it?
Thanks