Changeset 2897079
- Timestamp:
- 04/11/2023 10:00:53 AM (3 years ago)
- Location:
- flowhippo-abandoned-cart-recovery/tags
- Files:
-
- 9 added
- 1 edited
-
1.1.0/facr_script.js (modified) (6 diffs)
-
1.1.2 (added)
-
1.1.2/assets (added)
-
1.1.2/assets/screenshot-1.png (added)
-
1.1.2/assets/screenshot-2.png (added)
-
1.1.2/facr_script.js (added)
-
1.1.2/flowhippo.php (added)
-
1.1.2/globals.php (added)
-
1.1.2/readme.txt (added)
-
1.1.2/script.php (added)
Legend:
- Unmodified
- Added
- Removed
-
flowhippo-abandoned-cart-recovery/tags/1.1.0/facr_script.js
r2897049 r2897079 2 2 var $ = $ || window.jQuery; 3 3 var facr_data = window.facr_data; 4 if (!facr_data) {4 if (!facr_data) { 5 5 return; 6 6 } 7 $(document).on('change', 'input#billing_phone,input#billing_email,input#shipping_phone,input#shipping_email', function () {7 $(document).on('change', 'input#billing_phone,input#billing_email,input#shipping_phone,input#shipping_email', function () { 8 8 sendData('checkout-updated', $(this)); 9 9 }); … … 11 11 sendData('checkout-page-loaded'); 12 12 } else { 13 $(document).ready(function () {13 $(document).ready(function () { 14 14 sendData('checkout-page-loaded'); 15 15 }); 16 16 } 17 function sendData (event, thisObj) {17 function sendData(event, thisObj) { 18 18 var billingFields = {} 19 19 var shippingFields = {} … … 21 21 $('form input').each(function (e) { 22 22 var id = $(this).attr('id'); 23 if (id && id.indexOf('billing_') !== -1) {23 if (id && id.indexOf('billing_') !== -1) { 24 24 id = id.replace('billing_', ''); 25 25 billingFields[id] = $(this).val(); 26 } else if (id && id.includes('shipping')) {26 } else if (id && id.includes('shipping')) { 27 27 id = id.replace('shipping_', ''); 28 28 shippingFields[id] = $(this).val(); … … 38 38 id: $(thisObj).attr('id'), 39 39 name: $(thisObj).attr('name'), 40 label: $('[for=' + $(thisObj).attr('id')+']').text(),40 label: $('[for=' + $(thisObj).attr('id') + ']').text(), 41 41 } 42 42 } … … 96 96 }); 97 97 } 98 function mapCartData (_cartData) {98 function mapCartData(_cartData) { 99 99 var cartData = []; 100 100 Object.keys(_cartData).map(function (key, index) { … … 113 113 }) 114 114 return cartData; 115 } 115 } 116 116 } 117 facr_initialize(true); 117 if (!$ && !window.jQuery) { 118 var script = document.createElement('script'); 119 script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js'; 120 script.type = 'text/javascript'; 121 script.onload = function () { 122 var $ = window.jQuery; 123 facr_initialize(false); 124 }; 125 document.getElementsByTagName('head')[0].appendChild(script); 126 } else { 127 facr_initialize(true); 128 }
Note: See TracChangeset
for help on using the changeset viewer.