Jump to content

Update Product Features via PHP


Recommended Posts



how can i update the value from the custom featurs (Product Features) in php?


With product-fields its simple:

$productObj = new Product($produktId);
$productObj->ean13 = "johndoo";

BUT how can i update the product features?

Does anyone have an idea?



Link to comment
Share on other sites

If you want to do this in Object Oriented way as you mentioned, the best solution (in my opition) would be creating a new class called for example FeatureProduct.php.


It has to extend ObjectModel class, have variables with names from ps_feature_product table and have defined array $definition.


Check how does it look in

Link to comment
Share on other sites

I solved this Problem with:


$id_feature_value = (int)FeatureValue::addFeatureValueImport
  1 // $custom
    $produktId, (int)$feature['id_feature'], $id_feature_value
# Clean both tables with cleanPositions();

Do you have an idea what $custom stands for? Which value does it contain?


Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...