public array
event_onPreProcessProductCustomData(string $cart_name,
Shop_Product $product, integer $quantity, array $options, array $extra_options, array $bundle_data, array $master_bundle_data, $master_bundle_data)
The event allows you to modify custom (API) product parameters before product is added to the cart.
The event is triggered before product is placed to the cart and before the
shop:onBeforeAddToCart
event is triggered. Please read
this article to
learn about customizing products on the Product Details page. Usage example:
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onPreProcessProductCustomData', $this, 'preprocess_custom_data');
}
public function preprocess_custom_data($cart_name, $product, $quantity, $options, $extra_options, $custom_data, $bundle_data, $master_bundle_data)
{
$result = array();
if (!isset($custom_data['x_engraving_text']))
$result['x_engraving_text'] = 'Yahoo!';
return $result;
}