I need to override Price.php Model with plugin. I've created PricePlugin inside Plugin folder.
<vendor>/<module>/Plugin/Product/View/Options/PricePlugin.php
PricePlugin.php :
<?php
namespace <vendor>\<module>\Plugin\Product\View\Options;
use \Magento\Catalog\Model\Config\Source\Product\Options\Price;
/**
* Class AbstractOptions
* @package <vendor>\<module>\Plugin\Product\View\Options
*/
class PricePlugin
{
const VALUE_FIXED = 'fixed';
const VALUE_PERCENT = 'percent';
/**
* @param Price $price
* @return array
*/
public function toOptionArray(Price $price)
{
return [
['value' => self::VALUE_FIXED, 'label' => __('Fixed')],
['value' => self::VALUE_FIXED, 'label' => __('Per Character')],
['value' => self::VALUE_PERCENT, 'label' => __('Percent')],
];
}
}
di.xml
<type name="Magento\Catalog\Model\Config\Source\Product\Options\Price">
<plugin name="VENDOR_MODULE_Model_Price" type="<Vendor>\<Module>\Plugin\Product\View\Options\PricePlugin" sortOrder="1" />
</type>