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']]) != ''){ $newproduct->setProductDiscountCode($discounts[$prod[$fields['SOPDiscountCode']]]); }else{ $newproduct->setProductDiscountCode(0); } I'm not sure of the correct way to remove the value:
$newproduct->setProductDiscountCode(''); or
$newproduct->setProductDiscountCode(); for example?