Setting up Arrow AB Test on Shopify store

For customers who already have accounts on merchant's Shopify online store, Arrow can port over checkout information automatically such as shipping address, as long as customer is logged in on Shopify store.

Simply include the code below while calling the arrow_checkout_clicked() function (for cart-based checkout) or buy() function (for product page checkout):

{% if customer %}

  var customerPhone = "{{ customer.phone }}";
   if (customerPhone === "") {
     customerPhone = "{{ customer.default_address.phone }}";
   } 

   arrowOrder.extraData['estoreSource'] = 'shopify';
   arrowOrder.extraData['customerFirstName'] = "{{ customer.first_name }}";
   arrowOrder.extraData['customerLastName'] = "{{ customer.last_name }}";
   arrowOrder.extraData['customerEmail'] = "{{ customer.email }}";
   arrowOrder.extraData['customerPhone'] = customerPhone;
   arrowOrder.extraData['customerAddress1'] = "{{ customer.default_address.address1 }}";
   arrowOrder.extraData['customerAddress2'] = "{{ customer.default_address.address2 }}";
   arrowOrder.extraData['customerCity'] = "{{ customer.default_address.city }}";
   arrowOrder.extraData['customerProvince'] = "{{ customer.default_address.province }}";
   arrowOrder.extraData['customerCountry'] = "{{ customer.default_address.country }}";
   arrowOrder.extraData['customerZip'] = "{{ customer.default_address.zip }}";
 
{% endif %}