checkout_prepared_region
Triggered before the call of the preliminary method prepare() of the in-cart checkout step “shipping address”.
Shop-Script
Input (passed by reference)
$params['step_id'] string Checkout step ID.
$params['prepare_result'] array Execution result of the preliminary method prepare() of the checkout step class. Can be modified by plugins.
$params['result'] array Values to be passed on to the JavaScript code and the corresponding template file templates/actions/frontend/order/form/region.html. Can be modified by plugins.
$params['data'] array Data passed to the checkout step class instance. Can be modified by plugins.
$params['data']['origin'] string Origin of the checkout class call — 'form' (complete generation of the checkout form), 'calculate' (background updating of individual parts of the form while a customer is changing values in it), or 'create' (final creation of an order after the confirmation).
$params['data']['order'] shopOrder Order properties object.
$params['data']['contact'] waContact Authorized customer properties object.
$params['data']['input'] array Data received from a POST request, session, or another source.
$params['error_step_id'] string ID of a checkout step where an error has occurred. Can be modified by plugins.
$params['errors'] array Error messages. Can be modified by plugins.
$params['errors'][]['text'] string Error message text.
$params['prepare_result'] array Execution result of the preliminary method prepare() of the checkout step class. Can be modified by plugins.
$params['result'] array Values to be passed on to the JavaScript code and the corresponding template file templates/actions/frontend/order/form/region.html. Can be modified by plugins.
$params['data'] array Data passed to the checkout step class instance. Can be modified by plugins.
$params['data']['origin'] string Origin of the checkout class call — 'form' (complete generation of the checkout form), 'calculate' (background updating of individual parts of the form while a customer is changing values in it), or 'create' (final creation of an order after the confirmation).
$params['data']['order'] shopOrder Order properties object.
$params['data']['contact'] waContact Authorized customer properties object.
$params['data']['input'] array Data received from a POST request, session, or another source.
$params['error_step_id'] string ID of a checkout step where an error has occurred. Can be modified by plugins.
$params['errors'] array Error messages. Can be modified by plugins.
$params['errors'][]['text'] string Error message text.
… your plugin code …
Output
Shop-Script
Plugin code example
PHP
public function checkoutPreparedRegion($params) { waLog::log( _wp('Checkout prepared region event registered.'), 'shop/plugins/' . $this->id . '/checkout-prepared-region.log' ); }