1

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?

  • This is a known issue with Magento 2 currently under investigation, refer to this: github.com/magento/magento2/issues/6342 I'm having the same issue and currently the only 'painful' solution is to go back in to the product and adjust the custom option price and then save. – Nick Gulino Sep 26 '16 at 21:47
1

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;
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.