Skip to content

Instantly share code, notes, and snippets.

@oarashi
Last active July 28, 2016 10:22
Show Gist options
  • Save oarashi/482784a3e4f34669b2056ca73bf57e21 to your computer and use it in GitHub Desktop.
Save oarashi/482784a3e4f34669b2056ca73bf57e21 to your computer and use it in GitHub Desktop.
<script>
var order = App.getOrder({version: 'v1'});
var talkable_subtotal = 0;
if (order.subtotal > 0){ talkable_subtotal = order.subtotal / 100; }
var _talkable_data = {
purchase: {
order_number: order.number,
email: order.buyer.email,
first_name: order.buyer.first_name,
last_name: order.buyer.last_name,
subtotal: talkable_subtotal,
coupon_code: order.discount_code
}
};
window._talkableq = window._talkableq || [];
window._talkableq.push(["register_purchase", _talkable_data]);
</script>
<script src="//d2jjzw81hqbuqv.cloudfront.net/integration/clients/blink.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment