Hooks

Update Cart

Extensibility tag: update_external_cart Hooks will receive the following payload:

 [ 'key' => $key, // unique key 'value' => $value, // I'm not sure what this does 'cart_model' => $cart_model // An instance of TulipCartModel \]

Create Cart

Extensibility tag: create_external_cart Hooks will receive the following payload:

 [ 'customer_id' => 123, 'store_id' => 1, 'attributes' => array('name' => 'value', ...) //optional 'discounts' => array() //optional \]

Create Cart Item

Extensibility tag: create_external_cart_item Hooks will receive the following payload:

 [ 'id' => 1212, 'product_id' => 1234, 'variant_id' => 2345, //optional, 'cart_id' => 1235, 'quantity' => 10, //optional -- defaults to 1 'fulfilment_store_id' => 1, 'ref_num' => r123, //optional -- external id of the item 'attributes' => array('name' => 'value', ...) //optional 'discounts' => array('applied' => array('id' => '1', 'amount' => '2.22')) 'item_taxes' => array() ]

updateExternalCartItem

Extensibility tag: update_external_cart_item Hooks will receive the following payload:

 [ 'cart_item_id' => 1111, (actually 'id') 'product_id' => 1234, 'quantity' => 10, 'attributes' => array('name' => 'value', ...) //deletes all attributes if no attributes are passed 'discounts' => array('applied' => array('id' => '1', 'amount' => '2.22')) ]

deleteCartItem

Extensibility tag: delete_external_cart_item Hooks will receive the following payload:

 [ 'item_id' => 1, ]

calculateTax

Extensibility tag: calculate_tax Hooks will receive the following payload:

 [ 'cart_item' => $cart_item; // instance of CartItemModel ]