features_save

Triggered on saving product features settings.

Shop-Script

Input (passed by reference)

$params array Properties of a product feature saved by user.
$params[feature_id]['name'] string Feature name.
$params[feature_id]['types'] array IDs of product types selected in feature properties.
$params[feature_id]['values'] array Feature values.
$params[feature_id]['selectable'] bool Whether a feature allows selection from a list of values.
$params[feature_id]['multiple'] bool Whether a feature allows selection of multiple values from a list.
$params[feature_id]['status'] string Feature visibility status; 'public': visible in the storefront, 'private': visible only in backend.
$params[feature_id]['code'] string Feature code.
$params[feature_id]['type'] string Feature values type: 'color', 'dimension', 'double', 'range', 'text', or 'varchar'.
$params[feature_id]['id'] int Feature ID.
$params[feature_id]['type_name'] string Localized name of feature type displayed in backend.
$params[feature_id]['sort'] array Feature sorting values for each of product types; array keys are product type IDs, array values are sorting values.
$params[feature_id]['sort_json'] string Feature sorting values for each of product types, in JSON format.
… your plugin code …

Output

Shop-Script

Plugin code example

PHP

public function featuresSave($params)
{
    // get feature's data from params array
    $feature = reset($params);
    
    //do something with features's data
    shopMyPluginHelper::processFeature($feature);
}