I have a custom product attribute that gets populated from a csv import. If the relevant field has a value, that value is applied to the product's attribute. However if that field is empty, the value should be removed. This is what I currently have, but it's not removing the value:

if (trim($prod[$fields['SOPDiscountCode']]) != ''){

I'm not sure of the correct way to remove the value:




for example?

1 Answer 1






One of those should do the trick.

Your Answer

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

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