1'use strict';(function($){var $gallery=null;var gallery_loading=false;$(function(){if($('.wooco-wrap').length){wooco_init_selector();$('.wooco-wrap').each(function(){wooco_init($(this),'loaded');});}});$(document).on('woosq_loaded',function(){if($('#woosq-popup .wooco-wrap').length){wooco_init_selector();wooco_init($('#woosq-popup .wooco-wrap'),'woosq_loaded');}});$(document).on('wooco_save_ids',function(e,ids,$wrap,context,$selected){const block_ui_params={message:null,overlayCSS:{background:'#fff',opacity:0.6,},};if((wooco_vars.change_image==='yes')&&(context==='loaded'||context==='on_select'||context==='on_click')){var product_id=$wrap.data('id');var $all_gallery=$(wooco_vars.gallery_selector);var $main_gallery=$(wooco_vars.main_gallery_selector);if($all_gallery.length&&$main_gallery.length){if(!ids.length){$(document).find('.woocommerce-product-gallery--wooco').unblock().hide();$main_gallery.unblock().show();}else{var key=btoa(ids.toString()).replace(/[^a-zA-Z0-9]/g,'');var $key_gallery=$('.woocommerce-product-gallery--wooco-'+key);if($key_gallery.length){$all_gallery.unblock().hide();$key_gallery.unblock().show();if($selected){var selected_image=$selected.data('image_gallery');var $gallery_nav=$key_gallery.find('.flex-control-nav');if($gallery_nav.length&&(selected_image!==undefined)&&(selected_image!=='')){var $scroll_image=$gallery_nav.find('li img[src="'+selected_image+'"]');if($scroll_image.length){window.setTimeout(function(){$scroll_image.trigger('click');$(window).trigger('resize');},100);}}}}else{$all_gallery.block(block_ui_params);if(gallery_loading&&($gallery!=null)){$gallery.abort();} 2var data={action:'wooco_load_gallery',nonce:wooco_vars.nonce,product_id:product_id,key:key,ids:ids,};gallery_loading=true;$gallery=$.post(wooco_vars.wc_ajax_url.toString().replace('%%endpoint%%','wooco_load_gallery'),data,function(response){if(response.gallery){var $wooco_gallery=$(response.gallery);$all_gallery.unblock().hide();$wooco_gallery.insertAfter($main_gallery);$(document).trigger('wooco_gallery_loaded',product_id,key,ids);$wooco_gallery.imagesLoaded(function(){$wooco_gallery.wc_product_gallery();if($selected){var selected_image=$selected.data('image_gallery');var $gallery_nav=$wooco_gallery.find('.flex-control-nav');if($gallery_nav.length&&(selected_image!==undefined)&&(selected_image!=='')){var $scroll_image=$gallery_nav.find('li img[src="'+selected_image+'"]');if($scroll_image.length){window.setTimeout(function(){$scroll_image.trigger('click');$(window).trigger('resize');},100);}}} 3$(document).trigger('wooco_gallery_images_loaded',product_id,key,ids);});}else{$all_gallery.unblock();} 4gallery_loading=false;});}}}}});$(document).on('click touch','.single_add_to_cart_button',function(e){if($(this).hasClass('wooco-disabled')){if(wooco_vars.show_alert==='change'){wooco_show_alert($(this).closest('.wooco-wrap'));} 5e.preventDefault();}});$(document).on('click touch','.wooco-plus, .wooco-minus',function(){var $qty=$(this).closest('.wooco-qty-wrap').find('.wooco_qty').length?$(this).closest('.wooco-qty-wrap').find('.wooco_qty'):$(this).closest('.wooco-qty-wrap').find('.qty'),val=parseFloat($qty.val()),max=parseFloat($qty.attr('max')),min=parseFloat($qty.attr('min')),step=$qty.attr('step');if(!val||val===''||val==='NaN'){val=0;} 6if(max===''||max==='NaN'){max='';} 7if(min===''||min==='NaN'){min=0;} 8if(step==='any'||step===''||step===undefined||parseFloat(step)==='NaN'){step=1;}else{step=parseFloat(step);} 9if($(this).is('.wooco-plus')){if(max&&(val>=max)){$qty.val(max);}else{$qty.val((val+step).toFixed(wooco_decimal_places(step)));}}else{if(min&&(val<=min)){$qty.val(min);}else if(val>0){$qty.val((val-step).toFixed(wooco_decimal_places(step)));}} 10$qty.trigger('change');});$(document).on('keyup change','.wooco_qty',function(){var $this=$(this);var $wrap=$this.closest('.wooco-wrap');var val=parseFloat($this.val());var min=parseFloat($this.attr('min'));var max=parseFloat($this.attr('max'));if((val<min)||isNaN(val)){val=min;$this.val(val);} 11if(val>max){val=max;$this.val(val);} 12$this.closest('.wooco_component_product_selection_item').attr('data-qty',val);$this.closest('.wooco_component_product').attr('data-qty',val);wooco_init($wrap,'update_qty');});$(document).on('change','.wooco-checkbox',function(){var $wrap=$(this).closest('.wooco-wrap');wooco_init($wrap,'checked');});$(document).on('change','.wooco_component_product_select',function(){var $this=$(this);var $selection=$this.closest('.wooco_component_product_selection');var $component=$this.closest('.wooco_component_product');var $wrap=$this.closest('.wooco-wrap');var $selected=$('option:selected',this);wooco_selected($selected,$selection,$component);wooco_init($wrap,'on_select',$selected);});$(document).on('click touch','.wooco_component_product_selection_item',function(e){if($(e.target).closest('.wooco_component_product_selection_item_qt
12y').length===0&&!$(e.target).is('a, a *')){var $this=$(this);var $selection=$this.closest('.wooco_component_product_selection');var $component=$this.closest('.wooco_component_product');var $wrap=$this.closest('.wooco-wrap');if($component.attr('data-multiple')==='yes'){if($this.hasClass('wooco_item_selected')){$this.removeClass('wooco_item_selected');wooco_deselect($this,$selection,$component);}else{$this.addClass('wooco_item_selected');wooco_selected($this,$selection,$component);}}else{if($this.hasClass('wooco_item_selected')){$component.attr('data-id','-1');$component.attr('data-price','');$component.attr('data-price-html','');$component.attr('data-regular-price','');$this.removeClass('wooco_item_selected');wooco_deselect($this,$selection,$component);}else{$selection.find('.wooco_component_product_selection_item').removeClass('wooco_item_selected');$this.addClass('wooco_item_selected');wooco_selected($this,$selection,$component);}} 13wooco_init($wrap,'on_click',$this);}});$(document).on('select2:select','.wooco_component_product_select',function(e){var $this=$(this);var $selection=$this.closest('.wooco_component_product_selection');var $component=$this.closest('.wooco_component_product');var $wrap=$this.closest('.wooco-wrap');var $selected=$(e.params.data.element);wooco_selected($selected,$selection,$component);wooco_init($wrap,'on_select',$selected);});})(jQuery);function wooco_init($wrap,context=null,$selected=null){if(context==='loaded'||context==='woosq_loaded'){if($wrap.find('.wooco_qty').length){$wrap.find('.wooco_qty').trigger('change');}else{$wrap.find('.qty').trigger('change');}} 14wooco_check_ready($wrap,context,$selected);wooco_save_ids($wrap,context,$selected);if(context===null||context==='on_select'||context===wooco_vars.show_alert){wooco_show_alert($wrap,context,$selected);} 15if((context==='on_select'||context==='on_click'||context==='update_qty')&&wooco_vars.show_selected==='yes'){wooco_step_update_selected($wrap);} 16if((context==='loaded'||context==='woosq_loaded'||context==='selected')&&wooco_vars.show_selected==='yes'){wooco_step_update_selected($wrap);} 17jQuery(document).trigger('wooco_init',[$wrap,context,$selected]);} 18function wooco_check_ready($wrap,context=null,$selected=null){var wid=$wrap.attr('data-id');var $components=$wrap.find('.wooco-components');var $ids=jQuery('.wooco-ids-'+wid);var $btn=$ids.closest('form.cart').find('.single_add_to_cart_button');var $alert=$wrap.find('.wooco-alert');var is_selection=false;var c_name='';var is_min=false;var is_max=false;var is_m_min=false;var is_m_max=false;var is_same=false;var is_total_min=false;var is_total_max=false;var is_count=false;var selected_products=[];var allow_same=$components.attr('data-same');var qty=0;var m_min=0;var m_max=10000;var qty_min=parseFloat($components.attr('data-min'));var qty_max=parseFloat($components.attr('data-max'));var total_min=parseFloat($components.attr('data-total-min'));var total_max=parseFloat($components.attr('data-total-max'));var $total=$wrap.find('.wooco-total');var $count=$wrap.find('.wooco-count');var $price=jQuery('.wooco-price-'+wid);var $woobt=jQuery('.woobt-wrap-'+wid);var pricing=$components.attr('data-pricing');var price=wooco_format_number($components.attr('data-price'));var regular_price=wooco_format_number($components.attr('data-regular-price'));var percent=wooco_format_number($components.attr('data-percent'));var total=0;var total_regular=0;if(!$components.length||!$components.find('.wooco_component_product').length){return;} 19if(pricing==='only'){total=price;total_regular=regular_price;}else{$components.find('.wooco_component_product').each(function(){var $this=jQuery(this);var $checkbox=$this.find('.wooco-checkbox');var _price=wooco_format_number($this.attr('data-price'));var _regular_price=wooco_format_number($this.attr('data-regular-price'));var _qty=wooco_format_number($this.attr('data-qty'));var _multiple=$this.attr('data-multiple');if($checkbox.length&&!$checkbox.prop('checked')){return;} 20if(_multiple==='yes'){$this.find('.wooco_item_selected').each(function(){var $_this=jQuery(this);var __price=wooco_format_number($_this.attr('data-price'));var __regular_price=wooco_format_number($_this.attr('data-regular-price'));var __qty=wooco_format_number($_this.attr('data-qty'));if((__price>0)&&(__qty>0)){total+=__price*__qty;} 21if((__regular_price>0)&&(__qty>0)){total_regular+=__regular_price*__qty;}});}else{if((_price>0)&&(_qty>0)){total+=_price*_qty;} 22if((_regular_price>0)&&(_qty>0)){total_regular+=_regular_price*_qty;}}});if((percent>0)&&(percent<100)){total=total*(100-percent)/100;} 23if(pricing==='include'){total+=price;total_regular+=regular_price;}} 24var total_html=wooco_price_html(total_regular,total);if((pricing!=='only')&&(percent>0)&&(percent<100)){total_html+=' <small class="woocommerce-price-suffix">'+wooco_vars.saved_text.replace('[d]',percent+'%')+'</small>';} 25$total.html(wooco_vars.total_text+' '+total_html).slideDown();if((wooco_vars.change_price!=='no')&&(pricing!=='only')){if((wooco_vars.change_price==='yes_custom')&&(wooco_vars.price_selector!==null)&&(wooco_vars.price_selector!=='')){$price=jQuery(wooco_vars.price_selector);} 26$price.html(total_html);} 27if($woobt.length){$woobt.find('.woobt-products').attr('data-product-price-html',total_html);$woobt.find('.woobt-product-this').attr('data-price',total).attr('data-regular-price',total_regular);woobt_init($woobt);} 28jQuery(document).trigger('wooco_calc_price',[total,total_regular,total_html,$wrap,context,$selected]);$components.find('.wooco_component_product').each(function(){var $this=jQuery(this);var $checkbox=$this.find('.wooco-checkbox');var _selected=false;var _name=$this.attr('data-name');var _id=parseInt($this.attr('data-id'));var _qty=parseFloat($this.attr('data-qty'));var _required=$this.attr('data-required');var _multiple=$this.attr('data-multiple');var _custom_qty=$this.attr('data-custom-qty');if($checkbox.length&&!$checkbox.prop('checked')){return;} 29if(_custom_qty==='yes'||_multiple==='yes'){is_count=true;} 30if(_multiple==='yes'){var _m_qty=0;var _m_min=parseFloat($this.attr('data-m-min'));var _m_max=parseFloat($this.attr('data-m-max'));$this.find('.wooco_item_selected').each(function(){var $_this=jQuery(this);var __id=parseInt($_this.attr('data-id'));var __qty=parseFloat($_this.attr('data-qty'));if(__id>0){qty+=__qty;_m_qty+=__qty;_selected=true;} 31if(allow_same==='no'){if(selected_products.includes(__id)){is_same=true;}else{if(__id>0){selected_products.push(__id);}}}});if(_m_qty<_m_min){is_m_min=true;m_min=_m_min;if(c_name===''){c_name=_name;}} 32if(_m_qty>_m_max){is_m_max=true;m_max=_m_max;if(c_name===''){c_name=_name;}}}else{if(_id>0){qty+=_qty;_selected=true;} 33if(allow_same==='no'){if(selected_products.includes(_id)){is_same=true;}else{if(_id>0){selected_products.push(_id);}}}} 34if(!_selected&&(_required==='yes')){is_selection=true;if(c_name===''){c_name=_name;}}});if(is_count){$count.html('<span class="wooco-count-label">
34'+wooco_vars.selected_text+'</span> <span class="wooco-count-value">'+qty+'</span>').slideDown();jQuery(document).trigger('wooco_change_count',[$count,qty,qty_min,qty_max]);} 35if(qty<qty_min){is_min=true;} 36if(qty>qty_max){is_max=true;} 37if((pricing!=='only')){if(total_min>0&&total<total_min){is_total_min=true;} 38if(total_max>0&&total>total_max){is_total_max=true;}} 39if(is_selection||is_min||is_max||is_m_min||is_m_max||is_same||is_total_min||is_total_max){$btn.addClass('wooco-disabled');$alert.addClass('alert-active');if(is_selection){$alert.addClass('alert-selection').html(wooco_vars.alert_selection.replace('[name]','<strong>'+c_name+'</strong>'));}else if(is_m_min){$alert.addClass('alert-min').html(wooco_vars.alert_m_min.replace('[min]',m_min).replace('[name]','<strong>'+c_name+'</strong>'));}else if(is_m_max){$alert.addClass('alert-max').html(wooco_vars.alert_m_max.replace('[max]',m_max).replace('[name]','<strong>'+c_name+'</strong>'));}else if(is_min){$alert.addClass('alert-min').html(wooco_vars.alert_min.replace('[min]',qty_min));}else if(is_max){$alert.addClass('alert-max').html(wooco_vars.alert_max.replace('[max]',qty_max));}else if(is_same){$alert.addClass('alert-same').html(wooco_vars.alert_same);}else if(is_total_min){$alert.addClass('alert-total-min').html(wooco_vars.alert_total_min.replace('[min]',wooco_format_price(total_min)).replace('[total]',wooco_format_price(total)));}else if(is_total_max){$alert.addClass('alert-total-max').html(wooco_vars.alert_total_max.replace('[max]',wooco_format_price(total_max)).replace('[total]',wooco_format_price(total)));} 40$alert.slideDown();jQuery(document).trigger('wooco_check_ready',[false,is_selection,is_same,is_min,is_max,$wrap,context,$selected]);}else{$alert.removeClass('alert-active alert-selection alert-min alert-max alert-total-min alert-total-max').slideUp(300,function(){$alert.html('');});$btn.removeClass('wooco-disabled');jQuery(document).trigger('wooco_check_ready',[true,is_selection,is_same,is_min,is_max,$wrap,context,$selected]);}} 41function wooco_save_ids($wrap,context=null,$selected=null){var wid=$wrap.attr('data-id');var $components=$wrap.find('.wooco-components');var $ids=jQuery('.wooco-ids-'+wid);var ids=Array();$components.find('.wooco_component_product').each(function(){var $this=jQuery(this);var $checkbox=$this.find('.wooco-checkbox');var key=$this.data('key');if($checkbox.length&&!$checkbox.prop('checked')){return;} 42if($this.attr('data-multiple')==='yes'){$this.find('.wooco_item_selected').each(function(){var $_this=jQuery(this);if(($_this.attr('data-id')>0)&&($_this.attr('data-qty')>0)){ids.push($_this.attr('data-id')+'/'+$_this.attr('data-qty')+'/'+key);}});}else{if(($this.attr('data-id')>0)&&($this.attr('data-qty')>0)){ids.push($this.attr('data-id')+'/'+$this.attr('data-qty')+'/'+key);}}});$ids.val(ids.join(','));jQuery(document).trigger('wooco_save_ids',[ids,$wrap,context,$selected]);} 43function wooco_show_alert($wrap,context=null,$selected=null){var $alert=$wrap.find('.wooco-alert');if($alert.hasClass('alert-active')){$alert.slideDown();}else{$alert.slideUp();} 44jQuery(document).trigger('wooco_show_alert',[$wrap,context,$selected]);} 45function wooco_init_selector(){if(wooco_vars.selector==='ddslick'){jQuery('.wooco_component_product_select').each(function(){var $this=jQuery(this);var $selection=$this.closest('.wooco_component_product_selection');var $component=$this.closest('.wooco_component_product');var $wrap=$this.closest('.wooco-wrap');$selection.data('select',0);$this.ddslick({width:'100%',onSelected:function(data){var _select=$selection.data('select');var $selected=jQuery(data.original[0].children[data.selectedIndex]);if(data.selectedData.value=='-1'){if(!$selection.find('.dd-selected .dd-desc').length){$selection.find('.dd-selected').addClass('dd-option-without-desc');$selection.find('.dd-option-selected').addClass('dd-option-without-desc');}else{$selection.find('.dd-selected').removeClass('dd-option-without-desc');$selection.find('.dd-option-selected').removeClass('dd-option-without-desc');}} 46if(!$selection.hasClass('wooco-ddslick-checked-desc')){$selection.find('.dd-selected, .dd-option').each(function(){if(!jQuery(this).find('.dd-desc').length){jQuery(this).addClass('dd-option-without-desc');}else{jQuery(this).removeClass('dd-option-without-desc');}});$selection.addClass('wooco-ddslick-checked-desc');} 47if(!$selection.hasClass('wooco-ddslick-checked-disabled')){$selection.find('.dd-selected, .dd-option').each(function(){if(parseInt(j
47Query(this).find('.dd-option-value').val())===0){jQuery(this).addClass('dd-option-disabled');}else{jQuery(this).removeClass('dd-option-disabled');}});$selection.addClass('wooco-ddslick-checked-disabled');} 48wooco_selected($selected,$selection,$component);if(_select>0){wooco_init($wrap,'on_select',$selected);}else{wooco_init($wrap,'selected',$selected);} 49$selection.data('select',_select+1);},});});}else if(wooco_vars.selector==='select2'){jQuery('.wooco_component_product_select').each(function(){var $this=jQuery(this);var $selection=$this.closest('.wooco_component_product_selection');var $component=$this.closest('.wooco_component_product');var $wrap=$this.closest('.wooco-wrap');if($this.val()!==''){var $default=jQuery('option:selected',this);wooco_selected($default,$selection,$component);wooco_init($wrap,'selected',$default);} 50$this.select2({templateResult:wooco_select2_state,width:'100%',containerCssClass:'wpc-select2-container',dropdownCssClass:'wpc-select2-dropdown',});});}else{jQuery('.wooco_component_product_select').each(function(){var $this=jQuery(this);var $selection=$this.closest('.wooco_component_product_selection');var $component=$this.closest('.wooco_component_product');var $wrap=$this.closest('.wooco-wrap');var $selected=jQuery('option:selected',this);wooco_selected($selected,$selection,$component);wooco_init($wrap,'selected',$selected);});} 51jQuery('.wooco_component_product_selection_item.wooco_item_selected').each(function(){var $this=jQuery(this);var $selection=$this.closest('.wooco_component_product_selection');var $component=$this.closest('.wooco_component_product');var $wrap=$this.closest('.wooco-wrap');wooco_selected($this,$selection,$component);wooco_init($wrap,'selected',$this);});} 52function wooco_selected($selected,$selection,$component){var id=$selected.attr('data-id');var pid=$selected.attr('data-pid');var price=$selected.attr('data-price');var purchasable=$selected.attr('data-purchasable');var regular_price=$selected.attr('data-regular-price');var link=$selected.attr('data-link');var image='<img src="'+$selected.attr('data-imagesrc')+'"/>';var price_html=$selected.attr('data-price-html');var availability=$selected.attr('data-availability');var custom_qty=$component.attr('data-custom-qty');var qid=id;if(purchasable==='yes'){$component.attr('data-id',id);}else{$component.attr('data-id',0);} 53var selectedName=jQuery.trim($selected.attr('data-name')||$selected.text()||'');$component.attr('data-selected-name',selectedName);$component.attr('data-price',price);$component.attr('data-price-html',price_html);$component.attr('data-regular-price',regular_price);if(custom_qty==='yes'){if($selected.find('.wooco_qty').length){$component.attr('data-qty',$selected.find('.wooco_qty').val());}else if($selected.find('.qty').length){$component.attr('data-qty',$selected.find('.qty').val());}} 54if((wooco_vars.quickview_variation==='parent')&&pid){qid=pid;} 55if(wooco_vars.product_link!=='no'){$selection.find('.wooco_component_product_link').remove();if(link!==''){if(wooco_vars.product_link==='yes_popup'){$selection.append('<a class="wooco_component_product_link woosq-link" data-id="'+qid+'" data-context="wooco" href="'+link+'" target="_blank"> </a>');}else{$selection.append('<a class="wooco_component_product_link" href="'+link+'" target="_blank"> </a>');}}} 56$component.find('.wooco_component_product_image').html(image);$component.find('.wooco_component_product_price').html(price_html);$component.find('.wooco_component_product_availability').html(availability);jQuery(document).trigger('wooco_selected',[$selected,$selection,$component]);} 57function wooco_deselect($selected,$selection,$component){jQuery(document).trigger('wooco_deselected',[$selected,$selection,$component]);} 58function wooco_select2_state(state){if(!state.id){return state.text;} 59var $state={};if(jQuery(state.element).attr('data-imagesrc')!==''){$state=jQuery('<span class="image"><img src="'+jQuery(state.element).attr('data-imagesrc')+'"/></span><span class="info"><span class="name">'+state.text+'</span> <span class="desc">'+jQuery(state.element).attr('data-description')+'</span></span>');}else{$state=jQuery('<span class="info"><span class="name">
59'+state.text+'</span> <span class="desc">'+jQuery(state.element).attr('data-description')+'</span></span>');} 60return $state;} 61function wooco_round(value){return Number(Math.round(value+'e'+wooco_vars.price_decimals)+'e-'+wooco_vars.price_decimals);} 62function wooco_decimal_places(num){var match=(''+num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);if(!match){return 0;} 63return Math.max(0,(match[1]?match[1].length:0) 64-(match[2]?+match[2]:0));} 65function wooco_format_money(number,places,symbol,thousand,decimal){number=number||0;places=!isNaN(places=Math.abs(places))?places:2;symbol=symbol!==undefined?symbol:'$';thousand=thousand||'';decimal=decimal||'';var negative=number<0?'-':'',i=parseInt(number=Math.abs(+number||0).toFixed(places),10)+'',j=0;if(i.length>3){j=i.length%3;} 66if(wooco_vars.trim_zeros==='1'){return symbol+negative+(j?i.substr(0,j)+thousand:'')+i.substr(j).replace(/(\d{3})(?=\d)/g,'$1'+thousand)+(places&&(parseFloat(number)>parseFloat(i))?decimal+Math.abs(number-i).toFixed(places).slice(2).replace(/(\d*?[1-9])0+$/g,'$1'):'');}else{return symbol+negative+(j?i.substr(0,j)+thousand:'')+i.substr(j).replace(/(\d{3})(?=\d)/g,'$1'+thousand)+(places?decimal+Math.abs(number-i).toFixed(places).slice(2):'');}} 67function wooco_format_number(number){return parseFloat(number.replace(/[^0-9.,]/g,'').replace(',','.'));} 68function wooco_format_price(price){var price_html='<span class="woocommerce-Price-amount amount">';var price_formatted=wooco_format_money(price,wooco_vars.price_decimals,'',wooco_vars.price_thousand_separator,wooco_vars.price_decimal_separator);switch(wooco_vars.price_format){case'%1$s%2$s':price_html+='<span class="woocommerce-Price-currencySymbol">'+wooco_vars.currency_symbol+'</span>'+price_formatted;break;case'%1$s %2$s':price_html+='<span class="woocommerce-Price-currencySymbol">'+wooco_vars.currency_symbol+'</span> '+price_formatted;break;case'%2$s%1$s':price_html+=price_formatted+'<span class="woocommerce-Price-currencySymbol">'+wooco_vars.currency_symbol+'</span>';break;case'%2$s %1$s':price_html+=price_formatted+' <span class="woocommerce-Price-currencySymbol">'+wooco_vars.currency_symbol+'</span>';break;default:price_html+='<span class="woocommerce-Price-currencySymbol">'+wooco_vars.currency_symbol+'</span> '+price_formatted;} 69price_html+='</span>';return price_html;} 70function wooco_price_html(regular_price,sale_price){var price_html='';if(wooco_round(sale_price)!==wooco_round(regular_price)){if(wooco_round(sale_price)<wooco_round(regular_price)){price_html='<del>'+wooco_format_price(regular_price)+'</del> <ins>'+wooco_format_price(sale_price)+'</ins>';}else{price_html=wooco_format_price(sale_price);}}else{price_html=wooco_format_price(regular_price);} 71return price_html;} 72function wooco_step_update_selected($wrap){var $container=$wrap.find('.wooco-selected');if(!$container.length){var $summary=$wrap.find('.wooco_summary, .wooco-summary').first();if($summary.length){$summary.before('<div class="wooco-selected"></div>');$container=$wrap.find('.wooco-selected');} 73if(!$container.length){return;}} 74var $steps=$wrap.find('.wooco-components').children('.wooco_component');if(!$steps.length){$container.hide();return;} 75var rows=[];$steps.each(function(){var $step=jQuery(this);var $product=$step.find('.wooco_component_product').first();var labelEl=$step.find('.wooco_component_name').first().text().trim();var name=wooco_step_get_selected_name($product);if(!name||!labelEl){return;} 76rows.push('<div class="wooco-selected-row">' 77+'<span class="wooco-selected-label">'+labelEl+':</span> ' 78+'<span class="wooco-selected-name">'+name+'</span>' 79+'</div>');});if(rows.length===0){$container.html('').hide();}else{$container.html(rows.join('')).show();}} 80function wooco_step_get_selected_name($product){var isMultiple=$product.attr('data-multiple')==='yes';var isCustomQty=$product.attr('data-custom-qty')==='yes';if(isMultiple){var names=[];$product.find('.wooco_item_selected').each(function(){var $item=jQuery(this);var name=jQuery.trim($item.find('.wooco_component_product_selection_list_item_name').first().text()||$item.find('.wooco_component_product_selection_grid_item_name').first().text()||$item.attr('data-name')||'');if(name){var itemQty=parseFloat($item.find('.wooco_qty, .qty').first().val())||parseFloat($item.attr('data-qty'))||parseFloat($product.attr('data-qty'))||1;if(isCustomQty||itemQty>1){name=itemQty+' × '+name;} 81names.push(name);}});return names.length>0?names.join('; '):null;} 82var selectedId=parseInt($product.attr('data-id')||0);if(selectedId<=0){return null;} 83var name=null;var cachedName=jQuery.trim($product.attr('data-selected-name')||'');if(cachedName){name=cachedName;} 84if(!name){var $select=$product.find('.wooco_component_product_select');if($select.length){var $opt=$select.find('option[value="'+selectedId+'"]');if($opt.length){name=jQuery.trim($opt.text());} 85if(!name){$opt=$select.find('option').filter(function(){return parseInt(j
85Query(this).attr('data-id')||0)===selectedId;});if($opt.length){name=jQuery.trim($opt.first().text());}} 86if(!name){var $chosen=$select.find('option:selected');if($chosen.length&&parseInt($chosen.val())>0){name=jQuery.trim($chosen.text());}}}} 87if(!name){var $ddText=$product.find('.dd-selected-text');if($ddText.length){var ddName=jQuery.trim($ddText.text());if(ddName){name=ddName;}}} 88if(!name){var $listName=$product.find('.wooco_item_selected .wooco_component_product_selection_list_item_name').first();if($listName.length){name=jQuery.trim($listName.text());}} 89if(!name){var $gridName=$product.find('.wooco_item_selected .wooco_component_product_selection_grid_item_name').first();if($gridName.length){name=jQuery.trim($gridName.text());}} 90if(!name){var $anyItem=$product.find('.wooco_item_selected').first();if($anyItem.length&&$anyItem.attr('data-name')){name=jQuery.trim($anyItem.attr('data-name'));}} 91if(!name){return null;} 92var $selectedItem=$product.find('.wooco_item_selected').first();var $qtyInput=$selectedItem.length?$selectedItem.find('.wooco_qty, .qty').first():$product.find('.wooco_component_product_qty_input, .wooco_qty, .qty').first();var qty=parseFloat($qtyInput.val())||parseFloat($product.attr('data-qty'))||1;if(isCustomQty||qty>1){name=qty+' × '+name;} 93return name;}
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.