Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<script src="https://cdn.apps.bonify.io/customer_fields/public/live/CustomerFieldsApp_Manual-min.js"></script>
<script>
if (typeof CustomerFieldsApp_Manual !== 'undefined') {
CustomerFieldsApp_Manual.init("#create_customer", {
base_url: "https://apps.bonify.io/",
site_id: "{{ shop.metafields.cf_app.internal_site_id }}",
shop_domain: "{{ shop.permanent_domain }}",
{% if customer %}
customer_id: "{{ customer.id }}",
customer_token: "{{ customer.metafields.cf_app.api_token }}",
{% endif %}
// Callback when new customer creation fails.
onNewCustomerFailure: function (data){
// @todo: Exists for demo purposes only, remove if not needed.
console.log(data.result.responseJSON.errors);
},
// Callback when updating a customer fails.
onUpdateCustomerFailure: function (data){
// @todo: Exists for demo purposes only, remove if not needed.
console.log(data.result.responseJSON.errors);
},
// Callback whenever a message should be displayed to the user.
onDisplayMessage: function(data){
// @todo: Exists for demo purposes only, remove if not needed.
console.log(data);
},
// Callback when a field has an error.
onFieldError: function (error){
// @todo: Exists for demo purposes only, remove if not needed.
console.log(error);
}
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.