frontend_order_cart_add_before

Triggered before a service is enabled for a product on the in-cart checkout page.

Shop-Script

Input (passed by reference)

$params array Parameters.
$params['new_item'] array Added service’s data.
$params['errors'] array Error messages. A plugin may add its own error messages.
… your plugin code …

Output

Shop-Script

Plugin code example

PHP

public function frontendOrderCartAddBefore($params)
{
    waLog::dump($params, 'shop/myplugin/frontend-order-cart-add-before.log');
    $params['errors'][] = 'error message from plugin';
}