promo_save
Triggered upon saving of promo properties to the database.
Shop-Script
Input (passed by reference)
$params['promo_id'] int Promo ID.
$params['is_new'] bool Whether a new promo has been saved which did not exist before.
$params['promo_data'] array Promo’s properties.
$params['storefronts_data'] array List of storefronts selected in a promo’s properties.
$params['delete_rule_ids'] array IDs of promo tools which a user has selected to delete from a promo.
$params['rules'] array Promo tools’ properties.
$params['edited_rules'] array Promo tools modified by a user.
$params['new_rules'] array Promo tools added by a user.
$params['old_rules'] array Promo tools not modified by a user.
$params['is_new'] bool Whether a new promo has been saved which did not exist before.
$params['promo_data'] array Promo’s properties.
$params['storefronts_data'] array List of storefronts selected in a promo’s properties.
$params['delete_rule_ids'] array IDs of promo tools which a user has selected to delete from a promo.
$params['rules'] array Promo tools’ properties.
$params['edited_rules'] array Promo tools modified by a user.
$params['new_rules'] array Promo tools added by a user.
$params['old_rules'] array Promo tools not modified by a user.
… your plugin code …
Output
Shop-Script
Plugin code example
PHP
public function promoSave($params) { waLog::log( sprintf(_wp('Promo “%s” has been saved.'), $params['promo_data']['name']), 'shop/plugins/' . $this->id . '/promo-save.log' ); }