Skip to main content

Hooks

Customizing Behavior via Hooks

The default behavior of Simpler Checkout is to exactly match the behavior of your PrestaShop. This affects coupons, discounts and/or available shipping methods.

If you want to modify the checkout behavior only for the customers using Simpler Checkout you can use the programmatic hooks offered by our plugin to dynamically update the behavior of the Simpler Checkout form.

Customizing available shipping methods

The actionFilterDeliveryOptionList action hook allows you to modify the shipping rates & methods available to customers using Simpler Checkout. It accepts the resolved delivery option list for the cart and should return the modified ones.

Example: Removing a shipping rate from Simpler

<?php
class MyCarrierConditionDisablerModule extends Module
{

public function install()
{
return parent::install() && $this->registerHook('actionFilterDeliveryOptionList');
}

public function hookActionFilterDeliveryOptionList($params)
{
$deliveryOptionList = $params['delivery_option_list'];

if(0 == date('w') || 6 == date('w')){ // sundays or saturdays
// find carrier in $deliveryOptionList, and remove it
}
}
}