After searching for examples using "magento add attribute to product programmatically" I keep getting copious results on adding or removing ATTRIBUTES programmatically.
I want to programmatically add attribute values to a specific product - both the product and the attribute (and options) will have already been created previously. Something like:
function addAttributeToProduct($product, $attribute, $option_value, $scope='global'){ ...
Where $product
could be the object or could be the product SKU, $attribute
could be the attribute object or the attribute name, etc. with $option_value
.
How would I do this?