1$(function() { 2 $('.product-list-core-commerce-product-search-add-option').click( 3 function () { 4 $(this).closest('form').find('.product-list-search-field-base').show(); 5 } 6 ); 7 $('.product-list-search-field-base select').change( 8 function () { 9 var val = $(this).val(); 10 $(this).closest('form').find('#product-list-core-commerce-product-search-field-set'+val).show(); 11 $(this).closest('form').find('#product-list-core-commerce-product-search-field-set'+val+' .product-list-core-commerce-product-selected-field').val(val); 12 $(this).val(''); 13 $(this).closest('form').find('.product-list-search-field-base').hide(); 14 } 15 ); 16 $('.product-list-search-remove-option').click( 17 function () { 18 $(this).closest('.product-list-search-field').find('.product-list-core-commerce-product-selected-field').val(''); 19 $(this).closest('.product-list-search-field').hide(); 20 } 21 ); 22 $('.product-list-sort-select').change( 23 function () { 24 document.location = $(this).val(); 25 } 26 ); 27 $('.product-list-add-to-cart-form').each( 28 function () { 29 ccm_coreCommerceRegisterAddToCart(this.id); 30 //e.preventDefault(); 31 } 32 ); 33 34 $(".ccm-core-commerce-product-list-results .ccm-core-commerce-add-to-cart form").submit(function(){ 35 var pID='pitem_'+$('#productID',this).val(); 36 item_var=window[pID]; 37 dataLayer.push({ ecommerce: null }); 38 if($('#quantity',this).val()== undefined ){ 39 item_var.quantity=1; 40 }else{ 41 item_var.quantity=$('#quantity',this).val(); 42 } 43 44 dataLayer.push({ 45 event: "add_to_cart", 46 ecommerce: { 47 currency: item_currency, 48 value: item_var.price, 49 items: [ 50 { 51 item_id: item_var.item_id, 52 item_name: item_var.item_name, 53 index: 0, 54 item_brand: item_var.item_brand, 55 item_category:item_var.item_category, 56 item_list_id: item_var.item_list_id, 57 item_list_name: item_var.item_list_name, 58 price:item_var.price, 59 quantity: item_var.quantity 60 } 61 ] 62 } 63 }); 64 65 }); 66 67});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.