I was trying to remove the price which Magento adds to the options in a Select field but can't seem to get rid of the price. From what I could find on the internet it should be edited on the following location: app\code\Magento\Catalog\Block\Product\View\Options\Type\Select.php
At rule 62
$_value->getTitle() . ' ' . strip_tags($priceStr) . '',
And the following bit at rule 170 – 173
$_value->getTitle() .
'</span> ' .
$priceStr .
'</label>';
I changed these but the price still shows up in the select field as can be seen on the Image below.
Does anyone know where I can change this?
Best Answer
This is an update for Magento 2.2 and 2.3 --- the proper way to remove this is to override a JavaScript file into the active theme, and remove a section of code
The culprit is
Commenting out the above code block will remove the price increase without the need to add an additional binding onto the page.
Full article here: https://www.cadence-labs.com/2019/07/magento-2-remove-price-from-select-dropdown-on/
EDIT - 8th June 2020: The lines to comment out for Magento 2.3.5 are lines 460 - 466.