Skip to content

Instantly share code, notes, and snippets.

@jackfranklin
Created April 24, 2018 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackfranklin/e5ab55c3529bfea9b7cd88672b4eea70 to your computer and use it in GitHub Desktop.
Save jackfranklin/e5ab55c3529bfea9b7cd88672b4eea70 to your computer and use it in GitHub Desktop.
function setup_click_and_collect() {
var api_key = $collect_plus_widget.data('api-key');
// parcelpoint is the provided collect plus widget
parcelpoint.Store.init({
apiKey: api_key,
country: {
name: 'United Kingdom',
code: 'uk',
},
targetDiv: $collect_plus_widget,
// more options here, left out
});
parcelpoint.Store.display(display_opts);
parcelpoint.Property.onChange(['storeDetails'], function(_, newDetails) {
// deal with the user picking a new store
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment