I am not able to hide the custom price (+$10.00) in Magento 2.1.7. I am using Mageworx Extension for custom option. How can I achieve this, its my client requirement, as I am not able to hide this.
1 Answer
Refer to link to see magento add price in custom options when rendering in front end.
So you can create a after plugin for method afterGetFormatedPrice()
and return an empty string your price will not be displayed.
Example
Di.xml File
<type name="Magento\Catalog\Block\Product\View\Options\AbstractOptions">
<plugin name="hide_custom_option_price" type="Vendor\ModuleName\Plugin\AbstractOptions"/>
</type>
AbstractOptions.php
<?php
namespace Vendor\ModuleName\Plugin;
class AbstractOptions
{
public function afterGetFormatedPrice(
$subject,
$result
) {
return '';
}
}