Living Life


Notice: Trying to get property 'ID' of non-object in /home/thecapa1/public_html/wp-content/themes/gravida-pro/templates/fullwidth_single_template.php on line 30

Notice: Trying to get property 'user_nicename' of non-object in /home/thecapa1/public_html/wp-content/themes/gravida-pro/templates/fullwidth_single_template.php on line 30

Home / Shop

Living Life

$1.99
Living Life
Living Life

Home / Shop

Living Life

$1.99
Model Number: SKU-7
Maximum quantity exceeded
Minimum purchase amount of 0 is required
Maximum purchase amount of 0 is allowed
1.990
Facebook
Twitter
Email
Pinterest
Google+
LinkedIn
MySpace
Digg
Delicious
  • Description

An abundant life is available to anyone who desires it.

There are only four inhibitors that prevent you from living a fulfilling life.

First you need to know what these four inhibitors are in order to deal with them and then you need to know how to fix them.

The first part is easy. They are a lack of the following:

  • Belief

  • Faith

  • Self-confidence 

  • Self-image

The truth is that no one will achieve more or less than their current self-image.

Unless Self-image is improved to the level of your desired results, your desires will diminish into pipe dreams.

The PDF download will give greater insight into this challenge and offer long term solutions for only $1.99

<form action="
Notice: Undefined variable: cartpage in /home/thecapa1/public_html/wp-content/plugins/wp-easycart/design/layout/base-responsive-v3/ec_add_to_cart_shortcode.php on line 2
" method="POST" enctype="multipart/form-data" class="ec_add_to_cart_form">

Maximum quantity exceeded
Minimum purchase amount of 0 is required
Maximum purchase amount of 0 is allowed
1.990
var img = new Image( ); var img_width = 400; var img_height = 400; var img_ratio = 1; var tier_quantities = []; var tier_prices = [];
Notice: Undefined variable: ipad in /home/thecapa1/public_html/wp-content/plugins/wp-easycart/design/layout/base-responsive-v3/ec_add_to_cart_shortcode.php on line 466

Notice: Undefined variable: iphone in /home/thecapa1/public_html/wp-content/plugins/wp-easycart/design/layout/base-responsive-v3/ec_add_to_cart_shortcode.php on line 466
jQuery( '.ec_details_main_image_12' ).mousemove( function( e ){ var parentOffset = jQuery( this ).parent( ).offset( ); var mouse_x = e.pageX - parentOffset.left; var mouse_y = e.pageY - parentOffset.top; var div_width = jQuery( this ).width( ); var div_height = jQuery( this ).height( ); var x_val = '-' + ( ( img_width - div_width ) * ( mouse_x / div_width ) ) + 'px'; var y_val = '-' + ( ( img_height - div_height ) * ( mouse_y / div_height ) ) + 'px'; jQuery( '.ec_details_magbox_image_12' ).css( 'background-position', x_val + ' ' + y_val ); } ); jQuery( '.ec_details_main_image_12' ).hover( function( ){ img = new Image( ); img.onload = function( ){ img_width = this.width; img_height = this.height; img_ratio = img_height / img_width; jQuery( '.ec_details_magbox' ).css( 'width', jQuery( '.ec_details_main_image_12' ).width( ) + 'px' ).css( 'height', jQuery( '.ec_details_main_image_12' ).height( ) + 'px' ); jQuery( '.ec_details_magbox_image_12' ).css( 'width', jQuery( '.ec_details_main_image_12' ).width( ) + 'px' ).css( 'height', jQuery( '.ec_details_main_image_12' ).height( ) + 'px' ); } img.src = jQuery( this ).find( 'img' ).attr( 'src' ); jQuery( '.ec_details_magbox_12' ).fadeIn( 'fast' ); }, function( ){ jQuery( '.ec_details_magbox_12' ).fadeOut( 'fast' ); } );jQuery( '.ec_details_thumbnail_12' ).click( function( e ){ var src = jQuery( this ).find( 'img' ).attr( 'src' ); jQuery( '.ec_details_thumbnail_12' ).removeClass( 'ec_active' ); jQuery( this ).addClass( 'ec_active' ); jQuery( '.ec_details_main_image_12' ).find( 'img' ).attr( 'src', src ); jQuery( '.ec_details_large_popup_main_12' ).find( 'img' ).attr( 'src', src ); jQuery( '.ec_details_magbox_image_12' ).css( 'background', 'url( "' + src + '" ) no-repeat' ); }); jQuery( '.ec_details_large_popup_thumbnail_12' ).click( function( e ){ var src = jQuery( this ).find( 'img' ).attr( 'src' ); jQuery( '.ec_details_large_popup_thumbnail_12' ).removeClass( 'ec_active' ); jQuery( this ).addClass( 'ec_active' ); jQuery( '.ec_details_thumbnail_12' ).removeClass( 'ec_active' ); jQuery( '.ec_details_main_image_12' ).find( 'img' ).attr( 'src', src ); jQuery( '.ec_details_large_popup_main_12' ).find( 'img' ).attr( 'src', src ); jQuery( '.ec_details_magbox_image_12' ).css( 'background', 'url( "' + src + '" ) no-repeat' ); }); jQuery( '.ec_minus' ).click( function( ){ ec_details_base_adjust_price_12( );} ); jQuery( '.ec_plus' ).click( function( ){ ec_details_base_adjust_price_12( );} ); jQuery( document.getElementById( 'ec_quantity_12' ) ).change( function( ){ ec_details_base_adjust_price_12( );} ); jQuery( document.getElementById( 'ec_donation_amount_12' ) ).change( function( ){ ec_details_base_adjust_price_12( );} ); jQuery( '.ec_details_tab_12' ).click( function( ){ jQuery( '.ec_details_tab_12' ).removeClass( 'ec_active' ); jQuery( this ).addClass( 'ec_active' ); jQuery( '.ec_details_extra_area_12' ).children( 'div' ).each( function( ){ jQuery( this ).hide( ) } ); if( jQuery( this ).hasClass( 'ec_description' ) ) jQuery( '.ec_details_description_tab_12' ).show( ); else if( jQuery( this ).hasClass( 'ec_specifications' ) ) jQuery( '.ec_details_specifications_tab_12' ).show( ); else if( jQuery( this ).hasClass( 'ec_customer_reviews' ) ) jQuery( '.ec_details_customer_reviews_tab_12' ).show( ); else jQuery( '.ec_details_' + jQuery( this ).attr( 'data-tab-id' ) + '_tab' ).show( ); } ); jQuery( '.ec_details_swatches > li.ec_option1_12' ).click( function( ){ if( jQuery( this ).hasClass( 'ec_active' ) ){ var optionitem_id_1 = jQuery( this ).attr( 'data-optionitem-id' ); var quantity = jQuery( this ).attr( 'data-optionitem-quantity' ); ec_option1_image_change_12( optionitem_id_1, quantity ); jQuery( '.ec_details_swatches > li.ec_option1_12' ).removeClass( 'ec_selected' ); jQuery( this ).addClass( 'ec_selected' ); jQuery( '.ec_option1_12.ec_details_option_row_error' ).hide( ); jQuery( document.getElementById( 'ec_option1_12' ) ).val( optionitem_id_1 ); ec_details_base_adjust_price_12( ); } } ); jQuery( '.ec_details_swatches > li.ec_option2_12' ).click( function( ){ if( jQuery( this ).hasClass( 'ec_active' ) ){ var optionitem_id_1 = 0; if( jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).length ){ optionitem_id_1 = jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).attr( 'data-optionitem-id' ); }else{ optionitem_id_1 = jQuery( '.ec_details_combo.ec_option1_12' ).val( ); } var optionitem_id_2 = jQuery( this ).attr( 'data-optionitem-id' ); jQuery( '.ec_details_swatches > li.ec_option2_12' ).removeClass( 'ec_selected' ); jQuery( this ).addClass( 'ec_selected' ); jQuery( '.ec_option2_12.ec_details_option_row_error' ).hide( ); jQuery( document.getElementById( 'ec_option2_12' ) ).val( optionitem_id_2 ); ec_details_base_adjust_price_12( ); } } ); jQuery( '.ec_details_swatches > li.ec_option3_12' ).click( function( ){ if( jQuery( this ).hasClass( 'ec_active' ) ){ var optionitem_id_1 = 0; if( jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).length ){ optionitem_id_1 = jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).attr( 'data-optionitem-id' ); }else{ optionitem_id_1 = jQuery( '.ec_details_combo.ec_option1_12' ).val( ); } var optionitem_id_2 = 0; if( jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).length ){ optionitem_id_2 = jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).attr( 'data-optionitem-id' ); }else{ optionitem_id_2 = jQuery( '.ec_details_combo.ec_option2_12' ).val( ); } var optionitem_id_3 = jQuery( this ).attr( 'data-optionitem-id' ); jQuery( '.ec_details_swatches > li.ec_option3_12' ).removeClass( 'ec_selected' ); jQuery( this ).addClass( 'ec_selected' ); jQuery( '.ec_option3_12.ec_details_option_row_error' ).hide( ); jQuery( document.getElementById( 'ec_option3_12' ) ).val( optionitem_id_3 ); ec_details_base_adjust_price_12( ); } } ); jQuery( '.ec_details_swatches > li.ec_option4_12' ).click( function( ){ if( jQuery( this ).hasClass( 'ec_active' ) ){ var optionitem_id_1 = 0; if( jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).length ){ optionitem_id_1 = jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).attr( 'data-optionitem-id' ); }else{ optionitem_id_1 = jQuery( '.ec_details_combo.ec_option1_12' ).val( ); } var optionitem_id_2 = 0; if( jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).length ){ optionitem_id_2 = jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).attr( 'data-optionitem-id' ); }else{ optionitem_id_2 = jQuery( '.ec_details_combo.ec_option2_12' ).val( ); } var optionitem_id_3 = 0; if( jQuery( '.ec_details_swatches > li.ec_option3_12.ec_selected' ).length ){ optionitem_id_3 = jQuery( '.ec_details_swatches > li.ec_option3_12.ec_selected' ).attr( 'data-optionitem-id' ); }else{ optionitem_id_3 = jQuery( '.ec_details_combo.ec_option3_12' ).val( ); } var optionitem_id_4 = jQuery( this ).attr( 'data-optionitem-id' ); jQuery( '.ec_details_swatches > li.ec_option4_12' ).removeClass( 'ec_selected' ); jQuery( this ).addClass( 'ec_selected' ); jQuery( '.ec_option4_12.ec_details_option_row_error' ).hide( ); jQuery( document.getElementById( 'ec_option4_12' ) ).val( optionitem_id_4 ); ec_details_base_adjust_price_12( ); } } ); jQuery( '.ec_details_swatches > li.ec_option5_12' ).click( function( ){ if( jQuery( this ).hasClass( 'ec_active' ) ){ var optionitem_id_5 = jQuery( this ).attr( 'data-optionitem-id' ); jQuery( '.ec_details_swatches > li.ec_option5_12' ).removeClass( 'ec_selected' ); jQuery( this ).addClass( 'ec_selected' ); jQuery( '.ec_option5_12.ec_details_option_row_error' ).hide( ); jQuery( document.getElementById( 'ec_option5_12' ) ).val( optionitem_id_5 ); ec_details_base_adjust_price_12( ); } } ); jQuery( '.ec_details_combo.ec_option1_12' ).change( function( ){ var optionitem_id_1 = jQuery( '.ec_details_combo.ec_option1_12' ).val( ); var quantity = jQuery( '.ec_details_combo.ec_option1_12 option:selected' ).attr( 'data-optionitem-quantity' ); ec_option1_image_change_12( optionitem_id_1, quantity ); jQuery( '.ec_option1_12.ec_details_option_row_error' ).hide( ); ec_details_base_adjust_price_12( ); } ); jQuery( '.ec_details_combo.ec_option2_12' ).change( function( ){ jQuery( '.ec_option2_12.ec_details_option_row_error' ).hide( ); ec_details_base_adjust_price_12( ); } ); jQuery( '.ec_details_combo.ec_option3_12' ).change( function( ){ jQuery( '.ec_option3_12.ec_details_option_row_error' ).hide( ); ec_details_base_adjust_price_12( ); } ); jQuery( '.ec_details_combo.ec_option4_12' ).change( function( ){ jQuery( '.ec_option4_12.ec_details_option_row_error' ).hide( ); ec_details_base_adjust_price_12( ); } ); jQuery( '.ec_details_combo.ec_option5_12' ).change( function( ){ jQuery( '.ec_option5_12.ec_details_option_row_error' ).hide( ); ec_details_base_adjust_price_12( ); } ); jQuery( '.ec_details_checkbox_row > input, .ec_details_radio_row > input' ).click( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_option_row.ec_option_type_combo > .ec_details_option_data > select' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_option_row.ec_option_type_date > .ec_details_option_data > input' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_option_row.ec_option_type_file > .ec_details_option_data > input' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_option_row.ec_option_type_text > .ec_details_option_data > input' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_option_row.ec_option_type_textarea > .ec_details_option_data > textarea' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_grid_row > input' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_swatches > li.ec_advanced' ).click( function( ){ var optionitem_id = jQuery( this ).attr( 'data-optionitem-id' ); var option_id = jQuery( this ).attr( 'data-option-id' ); var product_id = '12'; jQuery( document.getElementById( 'ec_option_' + option_id + "_" + product_id ) ).val( optionitem_id ); jQuery( '.ec_details_swatches > li.ec_option_' + option_id + "_" + product_id ).removeClass( 'ec_selected' ); jQuery( this ).addClass( 'ec_selected' ); jQuery( document.getElementById( 'ec_details_option_row_error_' + option_id + "_" + product_id ) ).hide( ); ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_option_row.ec_option_type_dimensions1 > .ec_details_option_data > input' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_option_row.ec_option_type_dimensions2 > .ec_details_option_data > input' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( '.ec_details_option_row.ec_option_type_dimensions2 > .ec_details_option_data > select' ).change( function( ){ ec_details_advanced_adjust_price_12( ); } ); jQuery( document ).ready( function( ){ ec_details_base_adjust_price_12( ); ec_details_advanced_adjust_price_12( ); } ); function ec_details_base_adjust_price_12( ){ if( jQuery( document.getElementById( 'ec_base_price_12' ) ).length == 0 ) return; var base_price = Number( jQuery( document.getElementById( 'ec_base_price_12' ) ).html( ) ); var option1_price_adj = 0; var option2_price_adj = 0; var option3_price_adj = 0; var option4_price_adj = 0; var option5_price_adj = 0; var option1_price_add = 0; var option2_price_add = 0; var option3_price_add = 0; var option4_price_add = 0; var option5_price_add = 0; var option1_price_override = -1; var option2_price_override = -1; var option3_price_override = -1; var option4_price_override = -1; var option5_price_override = -1; // Option 1 Price Adjustment if( jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).length ){ option1_price_adj = jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).attr( 'data-optionitem-price' ); option1_price_add = jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).attr( 'data-optionitem-price-onetime' ); option1_price_override = Number( jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).attr( 'data-optionitem-price-override' ) ); option1_price_multiplier = Number( jQuery( '.ec_details_swatches > li.ec_option1_12.ec_selected' ).attr( 'data-optionitem-price-multiplier' ) ); }else if( jQuery( '.ec_details_combo.ec_option1_12' ).length ){ option1_price_adj = jQuery( '.ec_details_combo.ec_option1_12 option:selected' ).attr( 'data-optionitem-price' ); option1_price_add = jQuery( '.ec_details_combo.ec_option1_12 option:selected' ).attr( 'data-optionitem-price-onetime' ); option1_price_override = Number( jQuery( '.ec_details_combo.ec_option1_12 option:selected' ).attr( 'data-optionitem-price-override' ) ); option1_price_multiplier = Number( jQuery( '.ec_details_combo.ec_option1_12 option:selected' ).attr( 'data-optionitem-price-multiplier' ) ); } // Option 2 Price Adjustment if( jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).length ){ option2_price_adj = jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).attr( 'data-optionitem-price' ); option2_price_add = jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).attr( 'data-optionitem-price-onetime' ); option2_price_override = Number( jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).attr( 'data-optionitem-price-override' ) ); option2_price_multiplier = Number( jQuery( '.ec_details_swatches > li.ec_option2_12.ec_selected' ).attr( 'data-optionitem-price-multiplier' ) ); }else if( jQuery( '.ec_details_combo.ec_option2_12' ).length ){ option2_price_adj = jQuery( '.ec_details_combo.ec_option2_12 option:selected' ).attr( 'data-optionitem-price' ); option2_price_add = jQuery( '.ec_details_combo.ec_option2_12 option:selected' ).attr( 'data-optionitem-price-onetime' ); option2_price_override = Number( jQuery( '.ec_details_combo.ec_option2_12 option:selected' ).attr( 'data-optionitem-price-override' ) ); option2_price_multiplier = Number( jQuery( '.ec_details_combo.ec_option2_12 option:selected' ).attr( 'data-optionitem-price-multiplier' ) ); } // Option 3 Price Adjustment if( jQuery( '.ec_details_swatches > li.ec_option3_12.ec_selected' ).length ){ option3_price_adj = jQuery( '.ec_details_swatches > li.ec_option3_12.ec_selected' ).attr( 'data-optionitem-price' ); option3_price_add = jQuery( '.ec_details_swatches > li.ec_option3_12.ec_selected' ).attr( 'data-optionitem-price-onetime' ); option3_price_override = Number( jQuery( '.ec_details_swatches > li.ec_option3_12.ec_selected' ).attr( 'data-optionitem-price-override' ) ); option3_price_multiplier = Number( jQuery( '.ec_details_swatches > li.ec_option3_12.ec_selected' ).attr( 'data-optionitem-price-multiplier' ) ); }else if( jQuery( '.ec_details_combo.ec_option3_12' ).length ){ option3_price_adj = jQuery( '.ec_details_combo.ec_option3_12 option:selected' ).attr( 'data-optionitem-price' ); option3_price_add = jQuery( '.ec_details_combo.ec_option3_12 option:selected' ).attr( 'data-optionitem-price-onetime' ); option3_price_override = Number( jQuery( '.ec_details_combo.ec_option3_12 option:selected' ).attr( 'data-optionitem-price-override' ) ); option3_price_multiplier = Number( jQuery( '.ec_details_combo.ec_option3_12 option:selected' ).attr( 'data-optionitem-price-multiplier' ) ); } // Option 4 Price Adjustment if( jQuery( '.ec_details_swatches > li.ec_option4_12.ec_selected' ).length ){ option4_price_adj = jQuery( '.ec_details_swatches > li.ec_option4_12.ec_selected' ).attr( 'data-optionitem-price' ); option4_price_add = jQuery( '.ec_details_swatches > li.ec_option4_12.ec_selected' ).attr( 'data-optionitem-price-onetime' ); option4_price_override = Number( jQuery( '.ec_details_swatches > li.ec_option4_12.ec_selected' ).attr( 'data-optionitem-price-override' ) ); option4_price_multiplier = Number( jQuery( '.ec_details_swatches > li.ec_option4_12.ec_selected' ).attr( 'data-optionitem-price-multiplier' ) ); }else if( jQuery( '.ec_details_combo.ec_option4_12' ).length ){ option4_price_adj = jQuery( '.ec_details_combo.ec_option4_12 option:selected' ).attr( 'data-optionitem-price' ); option4_price_add = jQuery( '.ec_details_combo.ec_option4_12 option:selected' ).attr( 'data-optionitem-price-onetime' ); option4_price_override = Number( jQuery( '.ec_details_combo.ec_option4_12 option:selected' ).attr( 'data-optionitem-price-override' ) ); option4_price_multiplier = Number( jQuery( '.ec_details_combo.ec_option4_12 option:selected' ).attr( 'data-optionitem-price-multiplier' ) ); } // Option 5 Price Adjustment if( jQuery( '.ec_details_swatches > li.ec_option5_12.ec_selected' ).length ){ option5_price_adj = jQuery( '.ec_details_swatches > li.ec_option5_12.ec_selected' ).attr( 'data-optionitem-price' ); option5_price_add = jQuery( '.ec_details_swatches > li.ec_option5_12.ec_selected' ).attr( 'data-optionitem-price-onetime' ); option5_price_override = Number( jQuery( '.ec_details_swatches > li.ec_option5_12.ec_selected' ).attr( 'data-optionitem-price-override' ) ); option5_price_multiplier = Number( jQuery( '.ec_details_swatches > li.ec_option5_12.ec_selected' ).attr( 'data-optionitem-price-multiplier' ) ); }else if( jQuery( '.ec_details_combo.ec_option5_12' ).length ){ option5_price_adj = jQuery( '.ec_details_combo.ec_option5_12 option:selected' ).attr( 'data-optionitem-price' ); option5_price_add = jQuery( '.ec_details_combo.ec_option5_12 option:selected' ).attr( 'data-optionitem-price-onetime' ); option5_price_override = Number( jQuery( '.ec_details_combo.ec_option5_12 option:selected' ).attr( 'data-optionitem-price-override' ) ); option5_price_multiplier = Number( jQuery( '.ec_details_combo.ec_option5_12 option:selected' ).attr( 'data-optionitem-price-multiplier' ) ); } var num_decimals = 2; var decimal_symbol = '.'; var grouping_symbol = ','; var new_price = base_price + Number( option1_price_adj ) + Number( option2_price_adj ) + Number( option3_price_adj ) + Number( option4_price_adj ) + Number( option5_price_adj ); var order_price = Number( option1_price_add ) + Number( option2_price_add ) + Number( option3_price_add ) + Number( option4_price_add ) + Number( option5_price_add ); var override_price = -1; if( option1_price_override > -1 ) override_price = option1_price_override; else if( option2_price_override > -1 ) override_price = option2_price_override; else if( option3_price_override > -1 ) override_price = option3_price_override; else if( option4_price_override > -1 ) override_price = option4_price_override; else if( option5_price_override > -1 ) override_price = option5_price_override; if( override_price > -1 ){ jQuery( document.getElementById( 'ec_final_price_12' ) ).html( ec_details_format_money( override_price ) ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price ) ); } ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price ) ); } ); }else{ jQuery( document.getElementById( 'ec_final_price_12' ) ).html( ec_details_format_money( new_price ) ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price ) ); } ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price ) ); } ); } if( order_price != 0 ){ jQuery( '.ec_details_added_price_12' ).show( ); jQuery( document.getElementById( 'ec_added_price_12' ) ).html( ec_details_format_money( order_price ) ); }else{ jQuery( '.ec_details_added_price_12' ).hide( ); } } function ec_details_advanced_adjust_price_12( ){ if( jQuery( document.getElementById( 'ec_base_price_12' ) ).length == 0 ) return; var base_price = Number( jQuery( document.getElementById( 'ec_base_price_12' ) ).html( ) ); // Get a quantity in case we need to use in calculating price var current_quantity = 1; if( jQuery( document.getElementById( 'ec_quantity_12' ) ).length > 0 ){ current_quantity = jQuery( document.getElementById( 'ec_quantity_12' ) ).val( ); } if( jQuery( '.ec_details_grid_row > input' ).length > 0 ){ current_quantity = 0; jQuery( '.ec_details_grid_row > input' ).each( function( ){ current_quantity = current_quantity + Number( jQuery( this ).val( ) ); } ); } for( var i=0; i<tier_quantities.length; i++ ){ if( tier_quantities[i] input:checked' ).each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ checkbox_adj += Number( jQuery( this ).attr( 'data-optionitem-price' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ checkbox_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } } ); jQuery( '.ec_details_option_row.ec_option_type_combo > .ec_details_option_data > select option:selected' ).each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ combo_adj += Number( jQuery( this ).attr( 'data-optionitem-price' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ combo_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } } ); jQuery( '.ec_details_option_row.ec_option_type_date > .ec_details_option_data > input' ).each( function( ){ if( jQuery( this ).val( ) != "" ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ date_adj += Number( jQuery( this ).attr( 'data-optionitem-price' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ date_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } } } ); jQuery( '.ec_details_option_row.ec_option_type_file > .ec_details_option_data > input' ).each( function( ){ if( jQuery( this ).val( ) != "" ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ file_adj += Number( jQuery( this ).attr( 'data-optionitem-price' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ file_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } } } ); jQuery( '.ec_details_swatch.ec_advanced.ec_selected' ).each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ swatch_adj += Number( jQuery( this ).attr( 'data-optionitem-price' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ swatch_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } } ); jQuery( '.ec_details_radio_row > input:checked' ).each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ radio_adj += Number( jQuery( this ).attr( 'data-optionitem-price' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ radio_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } } ); jQuery( '.ec_details_option_row.ec_option_type_text > .ec_details_option_data > input' ).each( function( ){ if( jQuery( this ).val( ) != "" ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ text_adj += Number( jQuery( this ).attr( 'data-optionitem-price' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ text_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-per-character' ) > 0 ){ var num_characters = Number( jQuery( this ).val( ).replace( / /g, '' ).length ); var price_per_char = Number( jQuery( this ).attr( 'data-optionitem-price-per-character' ) ); text_adj = text_adj + ( num_characters * price_per_char ); } } } ); jQuery( '.ec_details_option_row.ec_option_type_textarea > .ec_details_option_data > textarea' ).each( function( ){ if( jQuery( this ).val( ) != "" ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ textarea_adj += Number( jQuery( this ).attr( 'data-optionitem-price' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ textarea_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-per-character' ) > 0 ){ var num_characters = Number( jQuery( this ).val( ).replace( / /g, '' ).length ); var price_per_char = Number( jQuery( this ).attr( 'data-optionitem-price-per-character' ) ); textarea_adj = textarea_adj + ( num_characters * price_per_char ); } } } ); jQuery( '.ec_details_grid_row > input' ).each( function( ){ if( jQuery( this ).val( ) > 0 ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price' ) != 0 ){ grid_adj += ( Number( jQuery( this ).attr( 'data-optionitem-price' ) ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-onetime' ) != 0 ){ grid_add += Number( jQuery( this ).attr( 'data-optionitem-price-onetime' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-override' ) >= 0 ){ override_price = Number( jQuery( this ).attr( 'data-optionitem-price-override' ) ); } if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-optionitem-price-multiplier' ) > 0 ){ price_multiplier = Number( jQuery( this ).attr( 'data-optionitem-price-multiplier' ) ); } } } ); jQuery( '.ec_dimensions_width' ).each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' ){ has_sq_footage = true; var option_id = jQuery( this ).attr( 'data-option-id' ); var product_id = '12'; var width = jQuery( document.getElementById( 'ec_option_' + option_id + '_' + product_id + '_width' ) ).val( ); var sub_width = 0; if( jQuery( document.getElementById( 'ec_option_' + option_id + '_' + product_id + '_sub_width' ) ).length ) var sub_width = jQuery( document.getElementById( 'ec_option_' + option_id + '_' + product_id + '_sub_width' ) ).val( ); var height = jQuery( document.getElementById( 'ec_option_' + option_id + '_' + product_id + '_height' ) ).val( ); var sub_height = 0; if( jQuery( document.getElementById( 'ec_option_' + option_id + '_' + product_id + '_sub_height' ) ).length ) var sub_height = jQuery( document.getElementById( 'ec_option_' + option_id + '_' + product_id + '_sub_height' ) ).val( ); if( width != "" && height != "" ) sq_footage = ec_details_get_sq_footage_12( width, sub_width, height, sub_height ) * Number( jQuery( document.getElementById( 'ec_quantity_12' ) ).val( ) ); } } ); var new_price = ( base_price + Number( checkbox_adj ) + Number( combo_adj ) + Number( date_adj ) + Number( file_adj ) + Number( swatch_adj ) + Number( grid_adj ) + Number( radio_adj ) + Number( text_adj ) + Number( textarea_adj ) ); var new_price_sqft = new_price * sq_footage; var override_price_final = override_price + Number( checkbox_adj ) + Number( combo_adj ) + Number( date_adj ) + Number( file_adj ) + Number( swatch_adj ) + Number( grid_adj ) + Number( radio_adj ) + Number( text_adj ) + Number( textarea_adj ); var override_price_sqft = override_price_final * sq_footage; var order_price = Number( checkbox_add ) + Number( combo_add ) + Number( date_add ) + Number( file_add ) + Number( swatch_add ) + Number( grid_add ) + Number( radio_add ) + Number( text_add ) + Number( textarea_add ); if( override_price > -1 ){ jQuery( document.getElementById( 'ec_final_price_12' ) ).html( ec_details_format_money( override_price_sqft ) ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final ) ); } ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final ) ); } ); }else{ jQuery( document.getElementById( 'ec_final_price_12' ) ).html( ec_details_format_money( new_price_sqft ) ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price ) ); } ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price ) ); } ); } if( price_multiplier > 1 && override_price > -1 ){ jQuery( document.getElementById( 'ec_final_price_12' ) ).html( ec_details_format_money( override_price_sqft * Number( price_multiplier ) ) ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final * Number( price_multiplier ) ) ); } ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final * Number( price_multiplier ) ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final * Number( price_multiplier ) / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final * Number( price_multiplier ) ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final * Number( price_multiplier ) / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( override_price_final * Number( price_multiplier ) ) ); } ); }else if( price_multiplier > 1 ){ jQuery( document.getElementById( 'ec_final_price_12' ) ).html( ec_details_format_money( new_price * Number( price_multiplier ) ) ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price * Number( price_multiplier ) ) ); } ); jQuery( '.ec_details_price.ec_details_single_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price * Number( price_multiplier ) ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price * Number( price_multiplier ) / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_sale_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price * Number( price_multiplier ) ) ); } ); jQuery( '.ec_details_price.ec_details_no_vat_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price * Number( price_multiplier ) / 1 ) ); } ); jQuery( '.ec_details_price.ec_details_vat_price > .ec_product_price_12' ).each( function( ){ jQuery( this ).html( ec_details_format_money( new_price * Number( price_multiplier ) ) ); } ); } if( order_price != 0 ){ jQuery( '.ec_details_added_price_12' ).show( ); jQuery( document.getElementById( 'ec_added_price_12' ) ).html( ec_details_format_money( order_price ) ); }else{ jQuery( '.ec_details_added_price_12' ).hide( ); } } function ec_details_get_sq_footage_12( width, sub_width, height, sub_height ){ var sub_width_decimal = ec_details_get_sub_dimension_decimal_12( sub_width ); width = Number( Number( width ) + sub_width_decimal ) / 12; var sub_height_decimal = ec_details_get_sub_dimension_decimal_12( sub_height ); height = Number( Number( height ) + sub_height_decimal ) / 12; return width*height; } function ec_details_get_sub_dimension_decimal_12( sub_dimension ){ if( sub_dimension == "0" ){ return 0; }else if( sub_dimension == "1/16" ){ return .0625; }else if( sub_dimension == "1/8" ){ return .1250; }else if( sub_dimension == "3/16" ){ return .1875; }else if( sub_dimension == "1/4" ){ return .2500; }else if( sub_dimension == "5/16" ){ return .3125; }else if( sub_dimension == "3/8" ){ return .3750; }else if( sub_dimension == "7/16" ){ return .4375; }else if( sub_dimension == "1/2" ){ return .5000; }else if( sub_dimension == "9/16" ){ return .5625; }else if( sub_dimension == "5/8" ){ return .6250; }else if( sub_dimension == "11/16" ){ return .6875; }else if( sub_dimension == "3/4" ){ return .7500; }else if( sub_dimension == "13/16" ){ return .8125; }else if( sub_dimension == "7/8" ){ return .8750; }else if( sub_dimension == "15/16" ){ return .9375; }else{ return 0; } } function ec_details_format_money( price, num_decimals, grouping_symbol, decimal_symbol ){ var currency_symbol = '$'; var num_decimals = 2; var decimal_symbol = '.'; var grouping_symbol = ','; var conversion_rate = '1'; var symbol_location = 1; var currency_code = 'USD'; var show_currency_code = '0'; price = ec_pricing_round( price * Number( conversion_rate ), num_decimals ); var n = price, num_decimals = isNaN(num_decimals = Math.abs(num_decimals)) ? 2 : num_decimals, decimal_symbol = decimal_symbol == undefined ? "." : decimal_symbol, grouping_symbol = grouping_symbol == undefined ? "," : grouping_symbol, i = parseInt(n = price.toFixed( num_decimals ) ) + "", j = (j = i.length) > 3 ? j % 3 : 0; var formatted = (j ? i.substr(0, j) + grouping_symbol : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + grouping_symbol) + (num_decimals ? decimal_symbol + Math.abs(n - i).toFixed(num_decimals).slice(2) : ""); if( symbol_location ){ formatted = currency_symbol + formatted; }else{ formatted = formatted + currency_symbol; } if( show_currency_code == '1' ){ formatted = currency_code + ' ' + formatted; } return formatted; }; function ec_pricing_round(number, places) { var multiplier = Math.pow(10, places+2); // get two extra digits var fixed = Math.floor(number*multiplier); // convert to integer fixed += 50; // round down on anything less than x.xxx50 fixed = Math.floor(fixed/100); // chop off last 2 digits return fixed/Math.pow(10, places); } function ec_details_submit_inquiry_12( ){ var errors = 0; if( document.getElementById( 'ec_inquiry_name_12' ) ){ if( jQuery( document.getElementById( 'ec_inquiry_name_12' ) ).val( ) == "" || jQuery( document.getElementById( 'ec_inquiry_email_12' ) ).val( ) == "" || jQuery( document.getElementById( 'ec_inquiry_message_12' ) ).val( ) == "" ){ jQuery( document.getElementById( 'ec_details_inquiry_error_12' ) ).show( ); errors++; }else{ jQuery( document.getElementById( 'ec_details_inquiry_error_12' ) ).hide( ); } } if( errors > 0 ) return false; else{ jQuery( document.getElementById( 'ec_inquiry_loader_12' ) ).show( ); jQuery( document.getElementById( 'ec_inquiry_loader_bg_12' ) ).show( ); return true; } } function ec_details_add_to_cart_12( ){ var errors = 0; // Basic Option 1 Error Check if( jQuery( '.ec_details_swatch.ec_option1_12' ).length && !jQuery( '.ec_option1_12.ec_selected' ).attr( 'data-optionitem-id' ) ){ jQuery( '.ec_option1_12.ec_details_option_row_error' ).show( ); errors++; }else if( jQuery( '.ec_details_combo.ec_option1_12' ).length && jQuery( '.ec_details_combo.ec_option1_12' ).val( ) == '0' ){ jQuery( '.ec_option1_12.ec_details_option_row_error' ).show( ); errors++; }else{ jQuery( '.ec_option1_12.ec_details_option_row_error' ).hide( ); } // Basic Option 2 Error Check if( jQuery( '.ec_details_swatch.ec_option2_12' ).length && !jQuery( '.ec_option2_12.ec_selected' ).attr( 'data-optionitem-id' ) ){ jQuery( '.ec_option2_12.ec_details_option_row_error' ).show( ); errors++; }else if( jQuery( '.ec_details_combo.ec_option2_12' ).length && jQuery( '.ec_details_combo.ec_option2.ec_option2_12' ).val( ) == '0' ){ jQuery( '.ec_option2_12.ec_details_option_row_error' ).show( ); errors++; }else{ jQuery( '.ec_option2_12.ec_details_option_row_error' ).hide( ); } // Basic Option 3 Error Check if( jQuery( '.ec_details_swatch.ec_option3_12' ).length && !jQuery( '.ec_option3_12.ec_selected' ).attr( 'data-optionitem-id' ) ){ jQuery( '.ec_option3_12.ec_details_option_row_error' ).show( ); errors++; }else if( jQuery( '.ec_details_combo.ec_option3_12' ).length && jQuery( '.ec_details_combo.ec_option3.ec_option3_12' ).val( ) == '0' ){ jQuery( '.ec_option3_12.ec_details_option_row_error' ).show( ); errors++; }else{ jQuery( '.ec_option3_12.ec_details_option_row_error' ).hide( ); } // Basic Option 4 Error Check if( jQuery( '.ec_details_swatch.ec_option4_12' ).length && !jQuery( '.ec_option4_12.ec_selected' ).attr( 'data-optionitem-id' ) ){ jQuery( '.ec_option4_12.ec_details_option_row_error' ).show( ); errors++; }else if( jQuery( '.ec_details_combo.ec_option4_12' ).length && jQuery( '.ec_details_combo.ec_option4.ec_option4_12' ).val( ) == '0' ){ jQuery( '.ec_option4_12.ec_details_option_row_error' ).show( ); errors++; }else{ jQuery( '.ec_option4_12.ec_details_option_row_error' ).hide( ); } // Basic Option 5 Error Check if( jQuery( '.ec_details_swatch.ec_option5_12' ).length && !jQuery( '.ec_option5_12.ec_selected' ).attr( 'data-optionitem-id' ) ){ jQuery( '.ec_option5_12.ec_details_option_row_error' ).show( ); errors++; }else if( jQuery( '.ec_details_combo.ec_option5_12' ).length && jQuery( '.ec_details_combo.ec_option5.ec_option5_12' ).val( ) == '0' ){ jQuery( '.ec_option5_12.ec_details_option_row_error' ).show( ); errors++; }else{ jQuery( '.ec_option5_12.ec_details_option_row_error' ).hide( ); } // --------Advanced Option Checks---------- // // Select Box Check var advanced_select_rows = jQuery( '.ec_details_option_row.ec_option_type_combo' ); advanced_select_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required if( jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).val( ) == '0' ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); } } } ); // Check Box Check var advanced_checkbox_rows = jQuery( '.ec_details_option_row.ec_option_type_checkbox' ); advanced_checkbox_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required var selected_checkboxes = jQuery( "input.ec_option_" + jQuery( this ).attr( 'data-option-id' ) + ":checked" ); if( selected_checkboxes.length ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // Date Box Check var advanced_date_rows = jQuery( '.ec_details_option_row.ec_option_type_date' ); advanced_date_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required if( jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).val( ) == "" ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); } } } ); // File Upload Check var advanced_file_rows = jQuery( '.ec_details_option_row.ec_option_type_file' ); advanced_file_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required if( jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).val( ) ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // Swatch Check var advanced_swatch_rows = jQuery( '.ec_details_option_row.ec_option_type_swatch' ); advanced_swatch_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required var advanced_selected_swatches = jQuery( ".ec_details_swatch.ec_option_" + jQuery( this ).attr( 'data-option-id' ) + '_12' + ".ec_selected" ); if( advanced_selected_swatches.length ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // Radio Button Check var advanced_radio_rows = jQuery( '.ec_details_option_row.ec_option_type_radio' ); advanced_radio_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required var selected_radios = jQuery( "input[name='ec_option_" + jQuery( this ).attr( 'data-option-id' ) + "']:checked" ); if( selected_radios.length ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // Text Box Check var advanced_text_rows = jQuery( '.ec_details_option_row.ec_option_type_text' ); advanced_text_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required if( jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).val( ) != "" ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // Text Area Check var advanced_textarea_rows = jQuery( '.ec_details_option_row.ec_option_type_textarea' ); advanced_textarea_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required if( jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).val( ) != "" ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // Quantity Grid Check var advanced_grid_rows = jQuery( '.ec_details_option_row.ec_option_type_grid' ); advanced_grid_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required var grid_items = jQuery( ".ec_details_grid_row > input" ); var total_grid_quantity = 0; grid_items.each( function( ){ total_grid_quantity += jQuery( this ).val( ); } ); if( total_grid_quantity > 0 ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // Dimensions Type 1 Check var advanced_dimensions_rows = jQuery( '.ec_details_option_row.ec_option_type_dimensions1' ); advanced_dimensions_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required // Test Width + Height if( jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' + '_width' ) ).val( ) != "" && jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' + '_height' ) ).val( ) != "" ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // Dimensions Type 2 Check var advanced_dimensions_rows = jQuery( '.ec_details_option_row.ec_option_type_dimensions2' ); advanced_dimensions_rows.each( function( ){ if( jQuery( this ).attr( 'data-product-id' ) == '12' && jQuery( this ).attr( 'data-option-required' ) == '1' ){ // Option is Required // Test Width + Height if( jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' + '_width' ) ).val( ) != "" && jQuery( document.getElementById( 'ec_option_' + jQuery( this ).attr( 'data-option-id' ) + '_12' + '_height' ) ).val( ) != "" ){ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).hide( ); }else{ jQuery( document.getElementById( 'ec_details_option_row_error_' + jQuery( this ).attr( 'data-option-id' ) + '_12' ) ).show( ); errors++; } } } ); // -------END Advanced Option Checks------- // // -------START GIFT CARD CHECK ----------- // var gift_card_errors = 0; if( document.getElementById( 'ec_giftcard_to_name_12' ) && jQuery( document.getElementById( 'ec_giftcard_to_name_12' ) ).val( ) == "" ){ errors++; gift_card_errors++; } if( document.getElementById( 'ec_giftcard_to_email_12' ) && jQuery( document.getElementById( 'ec_giftcard_to_email_12' ) ).val( ) == "" ){ errors++; gift_card_errors++; } if( document.getElementById( 'ec_giftcard_from_name_12' ) && jQuery( document.getElementById( 'ec_giftcard_from_name_12' ) ).val( ) == "" ){ errors++; gift_card_errors++; } if( document.getElementById( 'ec_giftcard_message_12' ) && jQuery( document.getElementById( 'ec_giftcard_message_12' ) ).val( ) == "" ){ errors++; gift_card_errors++; } if( gift_card_errors ){ jQuery( document.getElementById( 'ec_details_giftcard_error_12' ) ).show( ); }else{ jQuery( document.getElementById( 'ec_details_giftcard_error_12' ) ).hide( ); } // -------END GIFT CARD CHECK ----------- // // -------START DONATION CHECK ----------- // if( document.getElementById( 'ec_donation_amount_12' ) ){ if( isNaN( jQuery( document.getElementById( 'ec_donation_amount_12' ) ).val( ) ) || Number( jQuery( document.getElementById( 'ec_donation_amount_12' ) ).val( ) ) < 1.99 ){ jQuery( document.getElementById( 'ec_details_donation_error_12' ) ).show( ); errors++; }else{ jQuery( document.getElementById( 'ec_details_donation_error_12' ) ).hide( ); } } // -------END DONATION CHECK ----------- // // -------START INQUIRY CHECK ----------- // if( document.getElementById( 'ec_inquiry_name' ) ){ if( jQuery( document.getElementById( 'ec_inquiry_name' ) ).val( ) == "" || jQuery( document.getElementById( 'ec_inquiry_email' ) ).val( ) == "" || jQuery( document.getElementById( 'ec_inquiry_message' ) ).val( ) == "" ){ jQuery( document.getElementById( 'ec_details_inquiry_error' ) ).show( ); errors++; }else{ jQuery( document.getElementById( 'ec_details_inquiry_error' ) ).hide( ); } } // -------END INQUIRY CHECK ----------- // // Stock Quantity Check var entered_quantity = Number( jQuery( document.getElementById( 'ec_quantity_12' ) ).val( ) ); var allowed_quantity = 9999999999999; if( jQuery( document.getElementById( 'ec_details_stock_quantity' ) ).length ){ allowed_quantity = Number( jQuery( document.getElementById( 'ec_details_stock_quantity' ) ).html( ) ); } // Backorder Check if( allowed_quantity allowed_quantity ){ jQuery( document.getElementById( 'ec_addtocart_quantity_exceeded_error_12' ) ).show( ); errors++; }else{ jQuery( document.getElementById( 'ec_addtocart_quantity_exceeded_error_12' ) ).hide( ); } // Minimum Quantity Check var min_quantity = 0; if( entered_quantity 0 && entered_quantity > max_quantity ){ jQuery( document.getElementById( 'ec_addtocart_quantity_maximum_error_12' ) ).show( ); errors++; }else{ jQuery( document.getElementById( 'ec_addtocart_quantity_maximum_error_12' ) ).hide( ); } if( errors > 0 ) return false; else return true; } jQuery( '.ec_details_review_input_12' ).hover( function( ){ var score = jQuery( this ).attr( 'data-review-score' ); jQuery( '.ec_details_review_input_12' ).removeClass( 'ec_product_details_star_on' ).addClass( 'ec_product_details_star_off' ); for( var i=0; i li.ec_option2_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_swatches > li.ec_option3_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_swatches > li.ec_option4_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_swatches > li.ec_option5_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_combo.ec_option2_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_details_combo.ec_option3_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_details_combo.ec_option4_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_details_combo.ec_option5_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( document.getElementById( 'ec_details_stock_quantity_12' ) ).html( quantity ); jQuery( document.getElementById( 'ec_option_loading_2_12' ) ).show( ); var next_options = jQuery( '.ec_details_swatches > li.ec_option2_12' ); if( next_options.length ){ next_options.each( function( ){ jQuery( this ).removeClass( 'ec_active' ); } ); var data = { action: 'ec_ajax_get_optionitem_quantities', optionitem_id_1: optionitem_id_1, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ var json_data = JSON.parse( data ); jQuery( document.getElementById( 'ec_option_loading_2_12' ) ).hide( ); var i=0; next_options.each( function( ){ jQuery( this ).attr( 'data-optionitem-quantity', json_data[i].quantity ); if( json_data[i].quantity > 0 ){ jQuery( this ).addClass( 'ec_active' ); } i++; } ); } } ); }else{ next_options = jQuery( '.ec_details_combo.ec_option2_12 option' ); next_options.each( function( ){ jQuery( this ).removeClass( 'ec_active' ); } ); var data = { action: 'ec_ajax_get_optionitem_quantities', optionitem_id_1: optionitem_id_1, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ jQuery( '.ec_details_combo.ec_option2_12' ).prop( 'disabled', false ).removeClass( 'ec_inactive' ); var json_data = JSON.parse( data ); jQuery( document.getElementById( 'ec_option_loading_2_12' ) ).hide( ); var i=0; next_options.each( function( ){ if( i > 0 ){ jQuery( this ).attr( 'data-optionitem-quantity', json_data[i-1].quantity ) if( json_data[i-1].quantity > 0 ){ jQuery( this ).show( ); jQuery( this ).prop( 'disabled', false ); }else{ jQuery( this ).hide( ); jQuery( this ).prop( 'disabled', true ); } }else{ jQuery( this ).attr( 'data-optionitem-quantity', quantity ); } i++; } ); } } ); } } function option2_selected_12( optionitem_id_1, optionitem_id_2, quantity ){ jQuery( '.ec_details_swatches > li.ec_option3_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_swatches > li.ec_option4_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_swatches > li.ec_option5_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_combo.ec_option3_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_details_combo.ec_option4_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_details_combo.ec_option5_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_option2_12.ec_details_option_row_error' ).hide( ); jQuery( document.getElementById( 'ec_details_stock_quantity_12' ) ).html( quantity ); var next_options = jQuery( '.ec_details_swatches > li.ec_option3_12' ); jQuery( document.getElementById( 'ec_option_loading_3_12' ) ).show( ); if( next_options.length ){ next_options.each( function( ){ jQuery( this ).removeClass( 'ec_active' ); } ); var data = { action: 'ec_ajax_get_optionitem_quantities', optionitem_id_1: optionitem_id_1, optionitem_id_2: optionitem_id_2, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ var json_data = JSON.parse( data ); jQuery( document.getElementById( 'ec_option_loading_3_12' ) ).hide( ); var i=0; next_options.each( function( ){ jQuery( this ).attr( 'data-optionitem-quantity', json_data[i].quantity ); if( json_data[i].quantity > 0 ){ jQuery( this ).addClass( 'ec_active' ); } i++; } ); } } ); }else{ next_options = jQuery( '.ec_details_combo.ec_option3_12 option' ); next_options.each( function( ){ jQuery( this ).removeClass( 'ec_active' ); } ); var data = { action: 'ec_ajax_get_optionitem_quantities', optionitem_id_1: optionitem_id_1, optionitem_id_2: optionitem_id_2, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ jQuery( '.ec_details_combo.ec_option3_12' ).prop( 'disabled', false ).removeClass( 'ec_inactive' ); var json_data = JSON.parse( data ); jQuery( document.getElementById( 'ec_option_loading_3_12' ) ).hide( ); var i=0; next_options.each( function( ){ if( i > 0 ){ jQuery( this ).attr( 'data-optionitem-quantity', json_data[i-1].quantity ); if( json_data[i-1].quantity > 0 ){ jQuery( this ).show( ); jQuery( this ).prop( 'disabled', false ); }else{ jQuery( this ).hide( ); jQuery( this ).prop( 'disabled', true ); } }else{ jQuery( this ).attr( 'data-optionitem-quantity', quantity ); } i++; } ); } } ); } } function option3_selected_12( optionitem_id_1, optionitem_id_2, optionitem_id_3, quantity ){ jQuery( '.ec_details_swatches > li.ec_option4_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_swatches > li.ec_option5_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_combo.ec_option4_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_details_combo.ec_option5_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_option3_12.ec_details_option_row_error' ).hide( ); jQuery( document.getElementById( 'ec_details_stock_quantity_12' ) ).html( quantity ); var next_options = jQuery( '.ec_details_swatches > li.ec_option4_12' ); jQuery( document.getElementById( 'ec_option_loading_4_12' ) ).show( ); if( next_options.length ){ next_options.each( function( ){ jQuery( this ).removeClass( 'ec_active' ); } ); var data = { action: 'ec_ajax_get_optionitem_quantities', optionitem_id_1: optionitem_id_1, optionitem_id_2: optionitem_id_2, optionitem_id_3: optionitem_id_3, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ var json_data = JSON.parse( data ); jQuery( document.getElementById( 'ec_option_loading_4_12' ) ).hide( ); var i=0; next_options.each( function( ){ jQuery( this ).attr( 'data-optionitem-quantity', json_data[i].quantity ); if( json_data[i].quantity > 0 ){ jQuery( this ).addClass( 'ec_active' ); } i++; } ); } } ); }else{ next_options = jQuery( '.ec_details_combo.ec_option4_12 option' ); next_options.each( function( ){ jQuery( this ).removeClass( 'ec_active' ); } ); var data = { action: 'ec_ajax_get_optionitem_quantities', optionitem_id_1: optionitem_id_1, optionitem_id_2: optionitem_id_2, optionitem_id_3: optionitem_id_3, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ jQuery( '.ec_details_combo.ec_option4_12' ).prop( 'disabled', false ).removeClass( 'ec_inactive' ); var json_data = JSON.parse( data ); jQuery( document.getElementById( 'ec_option_loading_4_12' ) ).hide( ); var i=0; next_options.each( function( ){ if( i > 0 ){ jQuery( this ).attr( 'data-optionitem-quantity', json_data[i-1].quantity ); if( json_data[i-1].quantity > 0 ){ jQuery( this ).show( ); jQuery( this ).prop( 'disabled', false ); }else{ jQuery( this ).hide( ); jQuery( this ).prop( 'disabled', true ); } }else{ jQuery( this ).attr( 'data-optionitem-quantity', quantity ); } i++; } ); } } ); } } function option4_selected_12( optionitem_id_1, optionitem_id_2, optionitem_id_3, optionitem_id_4, quantity ){ jQuery( '.ec_details_swatches > li.ec_option5_12' ).removeClass( 'ec_selected' ).removeClass( 'ec_active' ); jQuery( '.ec_details_combo.ec_option5_12' ).val( '0' ).prop( 'disabled', true ).addClass( 'ec_inactive' ); jQuery( '.ec_option4.ec_details_option_row_error' ).hide( ); jQuery( document.getElementById( 'ec_details_stock_quantity_12' ) ).html( quantity ); var next_options = jQuery( '.ec_details_swatches > li.ec_option5_12' ); jQuery( document.getElementById( 'ec_option_loading_5_12' ) ).show( ); if( next_options.length ){ next_options.each( function( ){ jQuery( this ).removeClass( 'ec_active' ); } ); var data = { action: 'ec_ajax_get_optionitem_quantities', optionitem_id_1: optionitem_id_1, optionitem_id_2: optionitem_id_2, optionitem_id_3: optionitem_id_3, optionitem_id_4: optionitem_id_4, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ var json_data = JSON.parse( data ); jQuery( document.getElementById( 'ec_option_loading_5_12' ) ).hide( ); var i=0; next_options.each( function( ){ jQuery( this ).attr( 'data-optionitem-quantity', json_data[i].quantity ); if( json_data[i].quantity > 0 ){ jQuery( this ).addClass( 'ec_active' ); } i++; } ); } } ); }else{ next_options = jQuery( '.ec_details_combo.ec_option5_12 option' ); next_options.each( function( ){ jQuery( this ).removeClass( 'ec_active' ); } ); var data = { action: 'ec_ajax_get_optionitem_quantities', optionitem_id_1: optionitem_id_1, optionitem_id_2: optionitem_id_2, optionitem_id_3: optionitem_id_3, optionitem_id_4: optionitem_id_4, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ jQuery( '.ec_details_combo.ec_option5_12' ).prop( 'disabled', false ).removeClass( 'ec_inactive' ); var json_data = JSON.parse( data ); jQuery( document.getElementById( 'ec_option_loading_5_12' ) ).hide( ); var i=0; next_options.each( function( ){ if( i > 0 ){ jQuery( this ).attr( 'data-optionitem-quantity', json_data[i-1].quantity ); if( json_data[i-1].quantity > 0 ){ jQuery( this ).show( ); jQuery( this ).prop( 'disabled', false ); }else{ jQuery( this ).hide( ); jQuery( this ).prop( 'disabled', true ); } }else{ jQuery( this ).attr( 'data-optionitem-quantity', quantity ); } i++; } ); } } ); } } function ec_submit_product_review_12( ){ var review_title = jQuery( document.getElementById( 'ec_review_title_12' ) ).val( ); var review_score = 0; for( var i=1; i<=5; i++ ){ if( jQuery( document.getElementById( 'ec_details_review_star' + i + '_12' ) ).hasClass( 'ec_product_details_star_on' ) ){ review_score++; } } var review_message = jQuery( document.getElementById( 'ec_review_message_12' ) ).val( ); if( review_title != "" && review_score != 0 && review_message != "" ){ // Submit a filled out review jQuery( document.getElementById( 'ec_details_customer_review_loader_12' ) ).show( ); jQuery( document.getElementById( 'ec_details_review_error_12' ) ).hide( ); var data = { action: 'ec_ajax_insert_customer_review', review_title: review_title, review_score: review_score, review_message: review_message, product_id: '12' }; jQuery.ajax( { url: wpeasycart_ajax_object.ajax_url, type: 'post', data: data, success: function( data ){ jQuery( document.getElementById( 'ec_details_customer_review_loader_12' ) ).hide( ); jQuery( document.getElementById( 'ec_review_title_12' ) ).val( "" ); jQuery( document.getElementById( 'ec_review_message_12' ) ).val( "" ); jQuery( document.getElementById( 'ec_details_review_star1_12' ) ).removeClass( 'ec_product_details_star_on' ).addClass( 'ec_product_details_star_off' ); jQuery( document.getElementById( 'ec_details_review_star2_12' ) ).removeClass( 'ec_product_details_star_on' ).addClass( 'ec_product_details_star_off' ); jQuery( document.getElementById( 'ec_details_review_star3_12' ) ).removeClass( 'ec_product_details_star_on' ).addClass( 'ec_product_details_star_off' ); jQuery( document.getElementById( 'ec_details_review_star4_12' ) ).removeClass( 'ec_product_details_star_on' ).addClass( 'ec_product_details_star_off' ); jQuery( document.getElementById( 'ec_details_review_star5_12' ) ).removeClass( 'ec_product_details_star_on' ).addClass( 'ec_product_details_star_off' ); jQuery( document.getElementById( 'ec_details_submit_review_button_row_12' ) ).hide( ); jQuery( document.getElementById( 'ec_details_review_submitted_button_row_12' ) ).show( ); jQuery( document.getElementById( 'ec_details_customer_review_success_12' ) ).show( ).delay( 1500 ).fadeOut( 'slow' ); } } ); }else{ // Something is missing, display error. jQuery( document.getElementById( 'ec_details_review_error_12' ) ).show( ); } }

Comments are closed.