Skip to content

Instantly share code, notes, and snippets.

@nickmealey
Last active May 29, 2018 17:47
Show Gist options
  • Save nickmealey/51e75c99ae68e72373a3526a5685c2f6 to your computer and use it in GitHub Desktop.
Save nickmealey/51e75c99ae68e72373a3526a5685c2f6 to your computer and use it in GitHub Desktop.
var Customr = {
baseUrl: "https://customr.heliumdev.com",
{% if customer %}
shopifyCustomer: {
id: {{ customer.id }},
token: {{ customer.metafields.customr_auth.token | json }}
},
{% endif %}
ready: function() {
// Fires when all the proper data has been loaded in
},
beforeValidate: function() {
// Fires before form validation
},
afterValidate: function(errors) {
// Fires after form validation
},
beforeRedirect: function() {
// Fires before the browser is redirected to /account (or setting from admin)
// Halt the redirect by returning `false`
},
beforeLoginUser: function() {
// Fires before customer login is submitted after successful register
},
beforeFormUpdate: function() {
// Fires before the form fields are filled with customer data
},
afterFormUpdate: function(customer) {
// Fires after the form fields are filled with customer data
},
beforeSave: function() {
// Fires before form is submitted
},
afterSave: function(response) {
// Fires after form is submitted, regardless of errors
},
afterSaveSuccess: function(customer) {
// Fires after form is submitted successfully
},
afterSaveError: function(errors) {
// Fires after form is submitted with errors
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment