0

I have created a custom product attribute named 'product_custom_label' on Magento ver. 2.1 which I been showing on product listing page. For updating its values I have provided the client with the CSV upload sheet like so:

sku | product_custom_label
d-12  new arrival
d-13  discounted

Updating the values is fine , but what I faced a problem is when I have to empty these values .

If I just remove the values from product_custom_label in the CSV, the attribute values are not emptied. I have already prepared a script to remove these values programatically but I wonder is not there a Magento way to remove/empty the values that we upload through csv?

The same problem is faced when I update the special price of the product.

So, is there any Magento way to empty out the value from a specific custom product attribute, or we just have to rely on mass edit functionality?

5
  • which magento2 version you are using? Nov 15, 2019 at 7:35
  • as specifed in the question i am using magento 2.1 Nov 15, 2019 at 9:19
  • In magento 2.1 this is empty functionality not available by default. Nov 15, 2019 at 9:22
  • @RakeshVarma , so what should be informed to client in such case , the mass edit option ? Nov 15, 2019 at 9:23
  • Yes, that is the only option as now. Nov 15, 2019 at 9:49

1 Answer 1

1

Only Available in 2.3.x

You can unset the value of an attribute by passing __EMPTY__VALUE__ in your column name. You can change the value define in Empty attribute value constant

See the screenshot. enter image description here

2
  • i do not see any option like this in our magento setup , it must be something new introduced in latest version , i have checked in magento 2.1 and magento 2.2 . Nov 15, 2019 at 9:21
  • Very very helpful. Thank you friend!
    – ItsJhonny
    Jan 22, 2021 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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