Sylv Posted September 13, 2013 Share Posted September 13, 2013 Hello, does somebody know how to add new feature (I don't want to use an id, but a value) when adding product via the API ? Many thanks ! 1 Link to comment Share on other sites More sharing options...
jgullstr Posted September 13, 2013 Share Posted September 13, 2013 Here's a snippet that might help: $feature = array( 'key' => 'Size', 'value' => 'humongous', ); $id_feature = Feature::addFeatureImport($feature['key']); $id_feature_value = FeatureValue::addFeatureValueImport($id_feature, $feature['value']); $feature_value = new FeatureValue($id_feature_value); $feature_value->custom = 0; $feature_value->update(); Product::addFeatureProductImport((int) $product->id, $id_feature, $id_feature_value); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now