products_set_categories.before

Triggered before adding a group of products to categories.

Shop-Script

Input (passed by reference)

$params array Parameters.
$params['category_ids'] array IDs of categories to which products will be added.
$params['new_category_id'] int ID of a new category, to which products will be added, if the new set was created via the products-to-categories-adding dialog.
$params['hash'] string Hash in the URL of a page in “Products” section if all products on the current page will be added to selected categories.
$params['products_id'] array IDs of individually selected products.
… your plugin code …

Output

Shop-Script

Plugin code example

PHP

public function productsSetCategoriesBefore(&$params)
{
    shopMyPluginHelper::updateProductsCategories($params);
}