It is possible to pass shipearly instructions through the shopify cart. These instructions can be used to automatically select a specific retailer and/or delivery method for a customer. To use this feature, You must add data the the shopify cartsattributes
fields. This can be done with Shopify's Ajax API.
Pre-Select a Retailer
To preselect a retailer set theshipearly_preselect_retailer
attribute the the ID of the desired retailer.
Pre-Select a Delivery Method
To preselect a delivery option, set theshipearly_preselect_deliveryOption
attribute to the desired delivery options. Valid delivery options are:in_store
, local_install
, local_delivery
, ship_from_store
, sell_direct
. In the case that invalid delivery options are provided, and invalid Retailer ID is provided, or there are no retailers available for the products in the cart that match the provided preselection criteria, the consumer will be redirected to the regular checkout.
Example: Setting the preselected Retailer ID & Delivery Method
jQuery.post(window.Shopify.routes.root + 'cart/update.js', {
'attributes': {
'shipearly_preselect_retailerId': 25,
'shipearly_preselect_deliveryOption': 'in_store'
}
});
Comments
0 comments
Article is closed for comments.