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? Commented Nov 15, 2019 at 7:35
  • as specifed in the question i am using magento 2.1 Commented Nov 15, 2019 at 9:19
  • In magento 2.1 this is empty functionality not available by default. Commented Nov 15, 2019 at 9:22
  • @RakeshVarma , so what should be informed to client in such case , the mass edit option ? Commented Nov 15, 2019 at 9:23
  • Yes, that is the only option as now. Commented Nov 15, 2019 at 9:49

1 Answer 1

2

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 . Commented Nov 15, 2019 at 9:21
  • Very very helpful. Thank you friend! Commented Jan 22, 2021 at 11:28

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.