- Products
- All Products
- Best Sellers
- FSA/HSA
- Combo Packs
- Life Stage
- Female Fertility
- Male Fertility
- Pregnancy
- Breastfeeding
- Menopause
- Product Type
- Fertility Supplements
- Ovulation Prediction
- Prenatal Supplements
- Breastfeeding Supplements
- Vaginal Care
- Our Brands
- Fairhaven Health
- PeaPod
- Milkies
- Featured Product
Complete Menopause Relief
- Featured Product
Menopause Multivitamin Essentials
- Our Story
- Meet Our Health Advisors
- The Fairhaven Health Blog
- Ovulation Calculator
- Fertility Supplements Guide
- Breastfeeding Supplements Guide
- Ovulation Test Strip Instructions
- Pregnancy Test Strip Instructions
- Login
- Become a Retailer or Distributor
Item added to your cart
fertility bloodwork
Please note that all labs have their own normal values, and those presented in these charts are just an average. These charts are provided as a tool to help patients have a better dialog with their doctors, not for self-diagnosis or as a substitute for good medical care.
When trying to conceive, it is important to closely track your cycle, ideally through the use of urine-based ovulation testing. Additionally, if you believe that hormonal imbalance may be contributing to your difficulty in achieving pregnancy, consider taking a natural fertility-enhancing supplement like FertilAid for Women.
Additionally, there are a number of home fertility screening tests available for both women and men which can provide useful information about hormone levels, sperm count, sperm motility, and more.
- Female Hormone Levels Chart
- Blood Glucose Levels Chart
- Glucose Tolerance Test with Insulin Chart
- Cholesterol, Triglycerides and C-Peptide Chart
- Graphic Depiction of Female Menstrual Cycle
FEMALE HORMONE LEVELS
Hormone to Test | Time to Test | Normal Values | What Value Means |
Follicle Stimulating Hormone (FSH) | Day 3 | 3-20mIU/ml | FSH is often used as a gauge of ovarian reserve. In general, under 6 is excellent, 6-9 is good, 9-10 fair, 10-13 diminished reserve, 13+ very hard to stimulate. In PCOS testing, the LH:FSH ratio may be used in the diagnosis. The ratio is usually close to 1:1, but if the LH is higher, it is one possible indication of PCOS. |
Estradiol (E2) | Day 3 | 25-75pg/ml | Levels on the lower end tend to be better for stimulating. Abnormally high levels on day 3 may indicate existence of a functional cyst or diminished ovarian reserve. |
Estradiol (E2) | Day 4-5 of meds | 100+pg/ml or 2x Day 3 | There are no charts showing E2 levels during stimulation since there is a wide variation depending on how many follicles are being produced and their size. Most doctors will consider any increase in E2 a positive sign, but others use a formula of either 100 pg/ml after 4 days of stims, or a doubling in E2 from the level taken on cycle day 3. |
Estradiol (E2) | Surge/hCGday | 200+ pg/ml | The levels should be 200-600 per mature (18 mm) follicle. These levels are sometimes lower in overweight women. |
Luteinizing Hormone (LH) | Day 3 | < 7mIU/ml | A normal LH level is similar to FSH. An LH that is higher than FSH is one indication of PCOS. |
Luteinizing Hormone (LH) | SurgeDay | >20 mIU/ml | The LH surge leads to ovulation within 48 hours. |
Prolactin | Day 3 | < 24ng/ml | Increased prolactin levels can interfere with ovulation. They may also indicate further testing (MRI) should be done to check for a pituitary tumor. Some women with PCOS also have hyperprolactinemia. |
Progesterone (P4) | Day 3 | < 1.5ng/ml | Often called the follicular phase level. An elevated level may indicate a lower pregnancy rate. |
Progesterone (P4) | 7 dpo | > 15ng/ml | A progesterone test is done to confirm ovulation. When a follicle releases its egg, it becomes what is called a corpus luteum and produces progesterone. A level over 5 probably indicates some form of ovulation, but most doctors want to see a level over 10 on a natural cycle, and a level over 15 on a medicated cycle. There is no mid-luteal level that predicts pregnancy. Some say the test may be more accurate if done first thing in the morning after fasting. |
Thyroid Stimulating Hormone (TSH) | Day 3 | .4-4uIU/ml | Mid-range normal in most labs is about 1.7. A high level of TSH combined with a low or normal T4 level generally indicates hypothyroidism, which can have an effect on fertility. |
Free Triiodothyronine (T3) | Day 3 | 1.4-4.4pg/ml | Sometimes the diseased thyroid gland will start producing very high levels of T3 but still produce normal levels of T4. Therefore measurement of both hormones provides an even more accurate evaluation of thyroid function. |
Free Thyroxine (T4) | Day 3 | .8-2ng/dl | A low level may indicate a diseased thyroid gland or may indicate a non- functioning pituitary gland which is not stimulating the thyroid to produce T4. If the T4 is low and the TSH is normal, that is more likely to indicate a problem with the pituitary. |
Total Testosterone | Day 3 | 6-86ng/dl | Testosterone is secreted from the adrenal gland and the ovaries. Most would consider a level above 50 to be somewhat elevated. |
Free Testosterone | Day 3 | .7-3.6pg/ml | |
Dehydroepiandrosterone Sulfate (DHEAS) | Day 3 | 35-430ug/dl | An elevated DHEAS level may be improved through use of dexamethasone, prednisone, or insulin-sensitizing medications. |
Androstenedione | Day 3 | .7-3.1ng/ml | |
Sex Hormone Binding Globulin (SHBG) | Day 3 | 18-114 nmol/l | Increased androgen production often leads to lower SHBG |
17 Hydroxyprogesterone | Day 3 | 20-100 ng/dl | Mid-cycle peak would be 100-250 ng/dl, luteal phase 100-500 ng/dl |
Fasting Insulin | 8-16 hours fasting | < 30mIU/ml | The normal range here doesn't give all the information. A fasting insulin of 10-13 generally indicates some insulin resistance, and levels above 13 indicate greater insulin resistance. |
TOP
BLOOD GLUCOSE LEVELS
Type of Test | Time to Test | Normal Values | What Value Means |
Fasting Glucose | 8-16 hours fasting | 70-110mg/dl | A healthy fasting glucose level is between 70-90, but up to 110 is within normal limits. A level of 111-125 indicates impaired glucose tolerance/insulin resistance. A fasting level of 126+ indicates type II diabetes. |
Glycohemoglobin/ Glycosylated Hemoglobin (HbA1c) | anytime | < 6% | An HbA1c measures glucose levels over the past 3 months. It should be under 6% to show good diabetic control (postprandial glucose levels rarely going above 120). Good control reduces the risk of miscarriage and birth defects. |
TOP
GLUCOSE TOLERANCE TEST WITH INSULIN (GTT / IGTT)
Time | Normal Glucose Values | Normal Insulin Values | What the Results Mean |
Fasting | < 126 mg/dl | < 10 mIU/ml | Normal glucose results are 70-90, 111 or over is impaired, 126 or over is diabetic. Insulin levels above 10 show insulin resistance. |
? hour | < 200 mg/dl | 40-70 mIU/ml | A truly normal glucose response will not exceed 150. |
1 hour | < 200 mg/dl | 50-90 mIU/ml | Some want to lower the threshold on glucose to < 180 to identify early stages of diabetes. Insulin > 80 shows insulin resistance, or a level 5 times that of the fasting level (i.e., a fasting of 11 followed by a 1 hour > 55) |
2 hours | < 140 mg/dl | 6-50 mIU/ml | A truly normal glucose response is 110 or lower. Insulin > 60 is IR. |
3 hours | < 120 mg/dl | ||
4 hours | < 120 mg/dl |
TOP
CHOLESTEROL, TRIGLYCERIDES AND C-PEPTIDE
What to Test | Time to Test | Normal Values | What value means |
Triglycerides (TG) | 8-16 hours fasting | < 200mg/dl | Borderline high is 200-400, high is 400-1000, and very high is >1000. Elevated levels are a risk factor for coronary artery disease. |
Cholesterol Total | 8-16 hours fasting | < 200mg/dl | A level of 200-239 is borderline high, and a level 240+ is high. Increased levels are associated with increased risk of heart disease. |
low-density lipoprotein cholesterol (LDL) | 8-16 hours fasting | < 160mg/dl | This is the "bad" cholesterol. In someone with one risk factor for heart disease, < 160 is recommended, with 2 risk factors < 130, and those with documented coronary heart disease the target is < 100 |
high-density lipoprotein cholesterol (HDL) | 8-16 hours fasting | > 34mg/dl | This is the "good" cholesterol which may be increased through a healthy diet and exercise. The HDL level is usually estimated by taking total cholesterol and subtracting LDL, rather than by direct measure. |
C-peptide | 8-16 hours fasting | 0.5to 4.0 ng/ml | Levels increase with insulin production. |
Creatinine | < 1.4mg/dl | Levels1.4 mg/dl and higher may indicate renal (kidney) disease or renal dysfunction. |
TOP
Related Articles
Navigating Grief with a Bereavement Doula After Pregnancy Loss
Evidence-Based Testing For Recurrent Pregnancy Loss
10 Key Vitamins and Minerals During Pregnancy
Fertility New Year’s Resolutions for Conceiving in 2024
Navigating the Holidays with Infertility: A Guide to Thriving
Does Caffeine Impact Your Fertility?
Related Articles
Navigating Grief with a Bereavement Doula After Pregnancy Loss
Evidence-Based Testing For Recurrent Pregnancy Loss
10 Key Vitamins and Minerals During Pregnancy
Fertility New Year’s Resolutions for Conceiving in 2024
Navigating the Holidays with Infertility: A Guide to Thriving
Does Caffeine Impact Your Fertility?
Join our Newsletter
Sign up for our newsletter and take 15% off your first retail purchase!
' + WSAIO.applied_shipping.final_ship_rule.message + "
"); } /* ==================Show Checkout button =============================== */ if(typeof WSAIO.isShowCheckout == 'undefined'){ $(WSAIO.checkout_selector+','+WSAIO.duplicate_checkout_selector).removeClass('wsaio_hideCheckout') }else{ $(WSAIO.checkout_selector+','+WSAIO.duplicate_checkout_selector).addClass('wsaio_hideCheckout') } $('.wsaio_coupon_group, .wsaio_coupon_link').css('cssText','display:block !important') /* ==================Append all Alerts =============================== */ $('.wsaio-alerts').remove(); $('.waio_agree_message').remove() if(typeof window.MOQ_alert != 'undefined' && window.MOQ_alert!=''){ WSAIO.checkoutAlert = window.MOQ_alert; }else{ if($('.wsaio-alerts').length == 0 && WSAIO.checkoutAlert != undefined){ $(WSAIO.checkout_message_selector).after(WSAIO.checkoutAlert); } } WSAIO.cartLevelUpSell(); $('.wsaioUsellMessage,.Shipping_msg').remove(); if(WSAIO.wsaioUpSell_msg != undefined && WSAIO.wsaioUpSell_msg!= '' && $('.wsaioUsellMessage').length == 0){ if(typeof WSAIO.cart_level_upsell_message_select == 'undefined' || WSAIO.cart_level_upsell_message_select == ''){ $(WSAIO.checkout_message_selector).before('' + WSAIO.wsaioUpSell_msg + "
"); }else{ $(WSAIO.cart_level_upsell_message_select).before('' + WSAIO.wsaioUpSell_msg + "
"); } } if(WSAIO.applied_shipping != undefined && WSAIO.applied_shipping.apply_shipping_charges && $('.Shipping_msg').length == 0 && WSAIO.shipping_message_applied){ $(WSAIO.checkout_message_selector).after('' + WSAIO.applied_shipping.final_ship_rule.message + "
"); } if($('.wsaio-alerts').length == 0 && WSAIO.checkoutAlert != undefined && typeof window.MOQ_alert != 'undefined' && WSAIO.checkoutAlert.indexOf('- -1){ $(WSAIO.checkout_message_selector).after(WSAIO.checkoutAlert); } /* ==================Disabled Enable Checkout =============================== */ if(WSAIO.disable_checkout || window.disable_checkout_MOQ || window.isAgree == false){ if(WSAIO.agrrement_alert_message != '' && $('.waio_agree_message').length == 0 && typeof window.isAgree != 'undefined' && window.isAgree == false){ $(WSAIO.checkout_message_selector).after('
'+WSAIO.agrrement_alert_message+'
'); } if((typeof WSAIO.allow_normal_checkout__OC != 'undefined' && WSAIO.allow_normal_checkout__OC) && ((!window.disable_checkout_MOQ || $('.moq_error').length == 0) && (typeof window.isAgree == 'undefined' || window.isAgree))){ $(WSAIO.netTerm_checkout_selector).addClass('checkout-disabled').attr('disabled','disabled').css({'pointer-events': 'none','cursor': 'default'}) }else{ $(WSAIO.checkout_selector+','+WSAIO.duplicate_checkout_selector+','+WSAIO.netTerm_checkout_selector).addClass('checkout-disabled').attr('disabled','disabled').css({'pointer-events': 'none','cursor': 'default'}) } }else{ $(WSAIO.checkout_selector+','+WSAIO.duplicate_checkout_selector+','+WSAIO.netTerm_checkout_selector).removeClass('checkout-disabled').removeAttr('disabled').css({'pointer-events': 'auto','cursor': 'pointer'}) } /* ==================================== =============================== */ $('.wsaio_loader_checkout').hide(); } } window.addEventListener("load",function(){ if(typeof WSAIO != 'undefined' && window.wsaio_involved != undefined && window.wsaio_involved == true && typeof WSAIO.preCheckout == 'undefined' && WSAIO.app_mode_applied){ WSAIO.preloadCheckout = function (){ WSAIO.showCheckoutLoader(); try { "undefined" === typeof window.waioMOC && (window.waioMOC = {}); "undefined" === typeof waioMOC.cart && (waioMOC.cart = {}); try { window.cart_data = WSAIO.cart_object; waioMOC.cart["item_count"] = WSAIO.cart_object.item_count; waioMOC.cart["original_total_price"] = WSAIO.cart_object.original_total_price; WSAIO.order_control() setTimeout(function(){ if(typeof WSAIO.loadcartQuantityControllers != 'undefined' && typeof WSAIO.load_checkout_restriction != 'undefined'){ WSAIO.load_checkout_restriction(); WSAIO.loadcartQuantityControllers([],function(e){setTimeout(function(){WSAIO.run_checkout()},1000)});}else{WSAIO.run_checkout()} },1000) } catch (e) {} } catch (e) {} }; WSAIO.preCheckout = function (){ if(typeof WSAIO.run_checkout != 'undefined'){ WSAIO.showCheckoutLoader() $.getJSON(WSAIO.local_param +'cart',function(e){ window.cart_data = e; try { "undefined" === typeof window.waioMOC && (window.waioMOC = {}); "undefined" === typeof waioMOC.cart && (waioMOC.cart = {}); try { waioMOC.cart["item_count"] = e.item_count; waioMOC.cart["original_total_price"] = e.original_total_price; WSAIO.order_control() if(typeof WSAIO.cartQuantityControllers != 'undefined' && typeof WSAIO.checkout_restriction != 'undefined'){ WSAIO.checkout_restriction(); WSAIO.cartQuantityControllers([],function(e){setTimeout(function(){WSAIO.run_checkout()},500)});}else{WSAIO.run_checkout()} } catch (e) {} } catch (e) {} }) } }; WSAIO.preloadCheckout(); } }) };
' + '
'+row.title+'
' + ' ' + '
' + ' ' + '
' + ' ' + ' ' + ' ' + '
"'+message+'"
' + '' + ' ' ; } }) }else{ rows_data = ''; qc_ctrl = []; qc_ctrl.push(check_table_rule); for(var k=0; k< qc_ctrl.length;k++){ current_product.variants.forEach(function(variant, i){ max_qty = 0; _qtyInc = 1; _qtyMin = 0; _qtyMax = 0; _qtyDefault = 1; var Applicable = qc_ctrl[k].find(function(x){ return x.applies_to!="variants" || (x.variants && x.variants.findIndex(function(y){ return parseInt(y.id)===parseInt(variant.id) })!==-1) }); var qty__attrs = 'class="waio_qty-input" data-min="'+_qtyMin+'" data-method="'+_fLavel+'" data-max="'+_qtyMax+'" data-default="'+_qtyDefault+'" data-inc="'+_qtyInc+'"'; if(typeof Applicable !== "undefined"){ $('.product_level_msg').remove(); product_level_msg = ''; var indxx = ids.findIndex(function(e){if(e==variant.id){return e}}) ids = ids.filter(function(elem){ return elem != ids[indxx]; }); var message = Applicable.message.replace("[[mul]]",Applicable.quantity_increment).replace("[[min]]",Applicable.minimum_quantity).replace('"',''); _fLavel = Applicable.minimum_quantity_method; max_qty = Applicable.maximum_quantity==""?0:Applicable.maximum_quantity; _qtyInc = parseInt(Applicable.quantity_increment) || 1; _qtyMin = parseInt(Applicable.minimum_quantity) || 0; _qtyMax = parseInt(max_qty) || 0; if(Applicable.default_quantity == 0 && Applicable.default_quantity != ''){ _qtyDefault = parseInt(Applicable.default_quantity); }else{ _qtyDefault = parseInt(Applicable.default_quantity) || 1; } if(_fLavel == "product_level" ||_fLavel == "selected_product_level"){ Notable = "false"; $(removeableSelector_variants).hide(); product_level = "true"; } var img = current_product.featured_image; if(variant.featured_image != null) img = variant.featured_image.src; qty__attrs = 'class="waio_qty-input waio_qty-input__applicable" data-method="'+_fLavel+'" data-min="'+_qtyMin+'" data-max="'+_qtyMax+'" data-default="'+_qtyDefault+'" data-inc="'+_qtyInc+'" '; rows_data +=''+ '
' + '
' + ' ' + '
' + ' ' + '
' + '
'+variant.title+'
' + ' ' + '
' + '
' + ' ' + ' ' + ' ' + '
"'+message+'"
' + '' ; } }) } } }) }) for(var k=0; k< ids.length;k++){ current_product.variants.forEach(function(variant, i){ if(ids[k] == variant.id){ max_qty = 0; _qtyInc = 1; _qtyMin = 0; _qtyMax = 0; _qtyDefault = 1; window.MOQ_applied = [{ '_qtyDefault':_qtyDefault, '_qtyInc':_qtyInc, '_qtyMin':_qtyMin, '_qtyMax':_qtyMax }] var qty__attrs = 'class="waio_qty-input" data-min="'+_qtyMin+'" data-method="'+_fLavel+'" data-max="'+_qtyMax+'" data-default="'+_qtyDefault+'" data-inc="'+_qtyInc+'"'; var indxx = ids.findIndex(function(e){if(e==variant.id){return e}}) ids = ids.filter(function(elem){ return elem != ids[indxx]; }); var img = current_product.featured_image; if(variant.featured_image != null) img = variant.featured_image.src; rows_data +=''+ '
' + '
' + ' ' + '
' + ' ' + '
' + '
'+variant.title+'
' + ' ' + '
' + '
' + ' ' + ' ' + ' ' + '
' + '' ; } }) } }else{ current_product.variants.forEach(function(variant, i){ max_qty = 0; _qtyInc = 1; _qtyMin = 0; _qtyMax = 0; _qtyDefault = 1; var Applicable = qc_ctrl.find(function(x){return x.applies_to!="variants"||(x.variants && x.variants.findIndex(function(y){return parseInt(y.id)===parseInt(variant.id)})!==-1)}); var qty__attrs = 'class="waio_qty-input" data-min="'+_qtyMin+'" data-method="'+_fLavel+'" data-max="'+_qtyMax+'" data-default="'+_qtyDefault+'" data-inc="'+_qtyInc+'"'; if(typeof Applicable !== "undefined"){ _fLavel = Applicable.minimum_quantity_method; max_qty = Applicable.maximum_quantity==""?0:Applicable.maximum_quantity; _qtyInc = parseInt(Applicable.quantity_increment) || 1; _qtyMin = parseInt(Applicable.minimum_quantity) || 0; _qtyMax = parseInt(max_qty) || 0; if(Applicable.default_quantity == 0 && Applicable.default_quantity != ''){ _qtyDefault = parseInt(Applicable.default_quantity); }else{ _qtyDefault = parseInt(Applicable.default_quantity) || 1; } if(_fLavel == "product_level" || _fLavel == "selected_product_level"){ Notable = "false"; $(removeableSelector_variants).hide(); product_level = "true"; } } window.MOQ_applied = [{ '_qtyDefault':_qtyDefault, '_qtyInc':_qtyInc, '_qtyMin':_qtyMin, '_qtyMax':_qtyMax }] var img = current_product.featured_image; if(variant.featured_image != null) img = variant.featured_image.src; rows_data+=''+ '
' + '
' + ' ' + '
' + ' ' + '
' + '
'+variant.title+'
' + ' ' + '
' + '
' + ' ' + ' ' + ' ' + '
' + '' ; }) } var tableHTML = '
Variants | ' + 'Qty | ' + '
---|
' ; if($('.waio__qc-table').length)$('.waio__qc-table').remove(); if(current_product.variants[0].title=="Default Title"){ var variant = current_product.variants[0]; var Applicable = qc_ctrl.find(function(x){return x.applies_to!="variants"||(x.variants && x.variants.findIndex(function(y){return parseInt(y.id)===parseInt(variant.id)})!==-1)}); if(typeof Applicable.message == 'undefined'){ Applicable = Applicable[0]; } if(typeof Applicable !== "undefined"){ _fLavel = Applicable.minimum_quantity_method; max_qty = Applicable.maximum_quantity==""?0:Applicable.maximum_quantity; _qtyInc = parseInt(Applicable.quantity_increment) || 1; _qtyMin = parseInt(Applicable.minimum_quantity) || 0; _qtyMax = parseInt(max_qty) || 0; if(Applicable.default_quantity == 0){ _qtyDefault = parseInt(Applicable.default_quantity); }else{ _qtyDefault = parseInt(Applicable.default_quantity) || 1; } product_level_msg = Applicable.message; if(current_product.tags != undefined){ var all_in_one = 0; for(var i=0; i
' + ''+ '
' + ' ' + ' ' + ' ' + '
' + '
"+product_level_msg+"
"); var vids = ''; append_addtocart(config._addToCart,vids) moqEvent(config._addToCart) }else{ $(".waio__single-qc").remove(); // $(".product_level_msg").remove(); $(removeableSelector_qty).show(); $('[name="moq_addToCart"]').replaceWith(addTocartHtml); var vids = ''; append_addtocart(config._addToCart,vids) moqEvent(config._addToCart) } } else{ if(Notable == "true"){ var variant = current_product.variants.find(function(x){return x.id==_selected_variant_id}); var Applicable = qc_ctrl.find(function(x){return x.applies_to!="variants"||(x.variants && x.variants.findIndex(function(y){return parseInt(y.id)===parseInt(variant.id)})!==-1)}); var qty__attrs = 'class="waio_qty-input" data-min="'+_qtyMin+'" data-method="'+_fLavel+'" data-max="'+_qtyMax+'" data-default="'+_qtyDefault+'" data-inc="'+_qtyInc+'"'; if(typeof Applicable !== "undefined"){ _fLavel = Applicable.minimum_quantity_method; max_qty = Applicable.maximum_quantity==""?0:Applicable.maximum_quantity; _qtyInc = parseInt(Applicable.quantity_increment) || 1; _qtyMin = parseInt(Applicable.minimum_quantity) || 0; _qtyMax = parseInt(max_qty) || 0; if(Applicable.default_quantity == 0 && Applicable.default_quantity != ''){ _qtyDefault = parseInt(Applicable.default_quantity); }else{ _qtyDefault = parseInt(Applicable.default_quantity) || 1; } if(current_product.tags != undefined){ var all_in_one = 0; for(var i=0; i' + ''+ '
' + ' ' + ' ' + ' ' + '
' + '
"+product_level_msg+"
"); var vids = ''; append_addtocart(config._addToCart,vids) moqEvent(config._addToCart) }else{ $(".waio__single-qc").remove(); $(".product_level_msg").remove(); $(removeableSelector_qty).show(); $('[name="moq_addToCart"]').replaceWith(addTocartHtml); } }else{ if(product_level_Notable == "true"){ $(removeableSelector_qty).show(); $(removeableSelector_variants).show(); $(".product_level_msg").remove(); $(_addToCart).before(""+product_level_msg+"
"); var vids = ''; append_addtocart(config._addToCart,vids) moqEvent(config._addToCart) return false; }else{ $(_addToCart).before(tableHTML); $(".product_level_msg").remove(); $(".waio__qc-table").before(""+product_level_msg+"
"); var vids = ''; append_addtocart(config._addToCart,vids) moqEvent(config._addToCart) } } } } } else{ $(".product_level_msg").remove(); $(".waio__single-qc").remove(); $(removeableSelector_qty).show(); $('[name="moq_addToCart"]').replaceWith(addTocartHtml); } qty_function(); }) } /*========= Events =========== */ $(document).off('.waio_qc'); /* off all attached event */ function append_addtocart(addtocart,vid){ var _atcBtn = ''+ ' ' ; if(vid != ''){ $('[vid="'+vid+'"]').find(addtocart).replaceWith(_atcBtn); }else{ $(addtocart).replaceWith(_atcBtn); } } $(document).on('change.waio_qc','.waio_qty-input input', function(e) { e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); var _this = $(this); // console.warn('========changed======='); var $input = $(this); if($input.val().trim()=='') return; var val = parseInt($input.val()); var qty_wrapper = $input.parents('.waio_qty-input'); var _qMin = 0, _qMax = 0, _qInc = 1; var _fLavel = qty_wrapper.attr('data-method'); if(_fLavel !== 'selected_product_level'){ _qInc = parseInt(qty_wrapper.attr('data-inc')); } if(_fLavel === 'variant_level' && _fLavel !== 'selected_product_level'){ _qMin = parseInt(qty_wrapper.attr('data-min')); _qMax = parseInt(qty_wrapper.attr('data-max')); } if (val < _qMin) { val = _qMin; } else if (val > _qMax && _qMax!==0) { val = _qMax; } else if(val%_qInc === 0) return; else val = (val-(val%_qInc))+_qInc; $input.val(val); //$(this).parents(WSAIO.product_parent_grid_selector).find('[name="quantity"]').val(val); }); function qty_function(){ $('.waio_qty-input .waio__more').on('click', function(e) { e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); var _this = $(this); // console.warn('==================='); var $input = $(this).parent().find('input'); var val = parseInt($input.val()); var qty_wrapper = $input.parents('.waio_qty-input'); var _qMin = 0, _qMax = 0, _qInc = 1; var _fLavel = qty_wrapper.attr('data-method'); if(_fLavel !== 'selected_product_level'){ _qInc = parseInt(qty_wrapper.attr('data-inc')); } if(_fLavel === 'variant_level' && _fLavel !== 'selected_product_level'){ _qMin = parseInt(qty_wrapper.attr('data-min')); _qMax = parseInt(qty_wrapper.attr('data-max')); } if ($(this).hasClass('waio__less')) { if(val%_qInc === 0) val = val-_qInc; else val = val-(val%_qInc); } else if ($(this).hasClass('waio__more')) { val = (val-(val%_qInc))+_qInc; } if (val < _qMin) { val = _qMin; } if (val > _qMax && _qMax!==0) { val = _qMax; } $input.val(val); //$(this).parents(WSAIO.product_parent_grid_selector).find('[name="quantity"]').val(val); if(typeof MOQ_applied != 'undefined' && MOQ_applied.length > 0){ check_restriction_Buynow($input.val()); } }); $('.waio_qty-input .waio__less').on('click',function(e) { e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); var _this = $(this); // console.warn('==================='); var $input = $(this).parent().find('input'); var val = parseInt($input.val()); var qty_wrapper = $input.parents('.waio_qty-input'); var _qMin = 0, _qMax = 0, _qInc = 1; var _fLavel = qty_wrapper.attr('data-method'); if(_fLavel !== 'selected_product_level'){ _qInc = parseInt(qty_wrapper.attr('data-inc')); } if(_fLavel === 'variant_level' && _fLavel !== 'selected_product_level'){ _qMin = parseInt(qty_wrapper.attr('data-min')); _qMax = parseInt(qty_wrapper.attr('data-max')); } if ($(this).hasClass('waio__less')) { if(val%_qInc === 0) val = val-_qInc; else val = val-(val%_qInc); } else if ($(this).hasClass('waio__more')) { val = (val-(val%_qInc))+_qInc; } if (val < _qMin) { val = _qMin; } if (val > _qMax && _qMax!==0) { val = _qMax; } if(val > -1){ $input.val(val); //$(this).parents(WSAIO.product_parent_grid_selector).find('[name="quantity"]').val(val); } if(typeof MOQ_applied != 'undefined' && MOQ_applied.length > 0){ check_restriction_Buynow($input.val()); } }); $('.waio__less').trigger('click') } function check_restriction_Buynow(qty){ if((qty%MOQ_applied[0]._qtyInc) == 0 && qty >= MOQ_applied[0]._qtyMin){ if(MOQ_applied[0]._qtyMax != 0 && qty <= MOQ_applied[0]._qtyMax){ $('.shopify-payment-button__button').removeClass('checkout-disabled').removeAttr('disabled') }else{ $('.shopify-payment-button__button').removeClass('checkout-disabled').removeAttr('disabled') } }else{ $('.shopify-payment-button__button').addClass('checkout-disabled').attr('disabled','disabled') } } function moqEvent(_addToCart){ var _form = $(_addToCart).parents('form'); _form.off(); var _atcBtn = $('[name="moq_addToCart"]'); $('.product-form--atc').css('display','block') /*====== Click event on ATC =======*/ _atcBtn.on('click', function(e) { e.preventDefault(); e.stopImmediatePropagation(); e.stopPropagation(); var _this = $(this); $('.waio__Msg').remove(); var _btn = $(this); _btn.find('[data-waio-atc-text]').hide(); _btn.find('[data-waio-atcloader]').removeClass('waio-hide'); var _totalQty = 0, _isValidQty = true, _errorMsg = ''; $('.waio_qty-input').removeClass('waio__invalid-input'); var isProductLevel = false, productLevel_Min = 1, productLevel_Max = 1; _this.parents('form').find('.waio_qty-input').each(function(){ var $this=$(this); var _val = $this.find('input').val(); if($this.hasClass('waio_qty-input__applicable')){ _totalQty+=parseInt(_val); } _fLavel = $this.attr('data-method'); if(_fLavel === "product_level" || _fLavel !== "selected_product_level"){ isProductLevel = true; productLevel_Min = parseInt($this.attr('data-min')); productLevel_Max = parseInt($this.attr('data-max')); var _qInc = parseInt($this.attr('data-inc')); if(_val%_qInc !==0){ _isValidQty = false; _errorMsg = 'All quantities must be multiple of '+_qInc; $this.addClass('waio__invalid-input'); return false; } } if(_fLavel === "variant_level" || _fLavel !== "selected_product_level"){ isProductLevel = true; productLevel_Min = parseInt($this.attr('data-min')); productLevel_Max = parseInt($this.attr('data-max')); var _qInc = parseInt($this.attr('data-inc')); if(_val%_qInc !==0){ _isValidQty = false; _errorMsg = 'All quantities must be multiple of '+_qInc; $this.addClass('waio__invalid-input'); return false; } } }); if(isProductLevel && _fLavel != 'selected_product_level'){ if(_totalQty > productLevel_Max && productLevel_Max != 0){ _isValidQty = false; _errorMsg = 'You cannot buy more than '+productLevel_Max+' items'; } if(_totalQty < productLevel_Min){ _isValidQty = false; _errorMsg = 'You cannot buy less than '+productLevel_Min+' items'; } } $('.waio__ErrorMsg').remove(); if(!_isValidQty){ _atcBtn.before(''+_errorMsg+'
0){ _queue.unshift({ quantity:_value, id: $this.find('input').attr('data-qc-variant') }); } }); }else{ var _value = parseInt(_this.parents('form').find('[name="quantity"]').val()); if(_value>0){ _queue.unshift({ quantity:_value, id: _this.parents('form').find('[name="id"]').val() }); } } var isCartError = false; var _moveAlong = function(atc_queue){ if(atc_queue.length > 0){ //keep adding var item = atc_queue.pop(); //console.log(item); $.ajax({ type: 'POST', url: '/cart/add.js', cache: false, dataType: 'json', data: item, success: function(result){ $('.waio__Msg--'+item.id).remove(); $('[data-qc-variant="'+item.id+'"]') .parents('.waio_qty-input') .after(''+item.quantity+' items are added
'); _moveAlong(atc_queue); }, error: function(err){ console.error(err); isCartError = true; _btn.find('[data-waio-atc-text]').show(); _btn.find('[data-waio-atcloader]').addClass('waio-hide'); if(err.status && err.status===422){ $('.waio__Msg--'+item.id).remove(); $('[data-qc-variant="'+item.id+'"]') .parents('.waio_qty-input') .after(''+err.responseJSON.description+'
'); _moveAlong(atc_queue); } } }); } else{ // all added! _btn.find('[data-waio-atc-text]').show(); _btn.find('[data-waio-atcloader]').addClass('waio-hide'); // console.log('=============added=============='); if(!isCartError) window.location.href="/cart"; } } _moveAlong(_queue); }) } // ==========================================product page code end ========================================================= // ==========================================cart page code start ========================================================== $(document).ready(function(){ if(typeof WSAIO != 'undefined'){ WSAIO.cartQuantityControllers = function(config,callback){ window.MOQ_alert = ''; window.disable_checkout_MOQ = false; if("undefined"===typeof config)var config={}; null===config&&(config={}); var _errorMsg = ''; var _limitsUl = $('Order requirements not met.
- '+_limitsUl.html()+'
Order requirements not met.
- '+_limitsUl.html()+'
Order requirements not met.
- '+_limitsUl.html()+'
Order requirements not met.
- '+_limitsUl.html()+'