Magento – Custom option price changes after product edit Magento 2

admin-panelbackendcustom-optionsmagento2products

I have big issue in magento 2 backend. When editing product which has custom options with different prices.
After saving the product custom options price is changing automaticaly:

Example

"custom option 1" price is 1500.00

After save:

Expected result:

custom option price should be 1500.00

Actual result:

custom option price is 1.00

Is there any solution for this issiue?

Best Answer

I also encountered this issue few days back. Yes, its known issue with Magento 2 but you can fix it temporarily. Please visit \vendor\magento\module-catalog\Ui\DataProvider\Product\Form\Modifier\CustomOptions.php

and update the below funciton

protected function formatPrice($value)
    {
        if (!is_numeric($value)) {
            return null;
        }

        $store = $this->storeManager->getStore();
        $currency = $this->getLocaleCurrency()->getCurrency($store->getBaseCurrencyCode());
        $value = $currency->toCurrency($value, ['display' => \Magento\Framework\Currency::NO_SYMBOL]);
        // Remove comma from value:
        $value = str_replace(",","",$value); //here is the trick
        return $value;
    }
Related Topic