0

In product ID 192, the product has a color option, and I have translated it for 3 different store view / languages

enter image description here

In FR

enter image description here

In product ID 191 i will the same custom options like in product 192. I click on import options in Customizable Options in default store view, and import it all, then save. enter image description here enter image description here enter image description here

Now change store view to French store, the value should be in French, but all covered by default value.

enter image description here

I tried to import it in French store view, but the value also be covered by default value.

enter image description here

So, how to import it for different store view?

  • I have the same issue with magento 2.2.6. This modification dont change anything! Impossible to import custom option for diferent store view.. Please i need help ! – Romstach Mar 20 at 22:38
0

I have the same issue, that not able to save the custom option price store view wise in magento2.2.1 version.

I have checked the core files code and came to know that on product save they are saving the value for only default store view, its not taking the current switched store id.

Change the following file

/vendor/magento/module-catalog/Model/ResourceModel/Product/Option/Value.php

In protected function _saveValuePrices(\Magento\Framework\Model\AbstractModel $object)

change from \Magento\Store\Model\Store::DEFAULT_STORE_ID," to "$object->getStoreId()

line 112
)->where(
                'store_id = ?',
                \Magento\Store\Model\Store::DEFAULT_STORE_ID
            );
To 
)->where(
                'store_id = ?',
                $object->getStoreId()
            );

line 121

$where = [
                        'option_type_id = ?' => $optionTypeId,
                        'store_id = ?' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
                    ];
To 

$where = [
                        'option_type_id = ?' => $optionTypeId,
                        'store_id = ?' => $object->getStoreId(),
                    ];

line 129

$bind = [
                    'option_type_id' => (int)$object->getId(),
                    'store_id' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
                    'price' => $price,
                    'price_type' => $priceType,
                ];

To 

$bind = [
                    'option_type_id' => (int)$object->getId(),
                    'store_id' => $object->getStoreId(),
                    'price' => $price,
                    'price_type' => $priceType,
                ];

Hope this will help you.

Note: Its not good idea to edit the core file, you can override the file or take backup before editing core file.

Thank you

  • Thanks for your answer, I have changed the file as you shown, but looks it not works, the options' title and value still be covered by default value. – Chris Mar 1 '18 at 7:52
  • @Chris just like saveValuePrices there is a function for saveValueTitles , you need to apply similar changes there – Reena Parekh Apr 16 at 10:58

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.