Basket
-
-
1. Your plan
Happy with your phone? Save money with a SIM Only deal. Pick a tariff with the right amount of calls, texts and data to suit you. And now with Data Rollover on selected tariffs, you can roll over any unused data each month, so it won’t go to waste.
See AlsoLow-Income Internet Discounts: These ACP Alternatives Can Help Fill the GapRunning out of Gmail storage? How to get another 15GB for freeWaiting for FEMA check? Here’s how to get helpCash App customers can now claim more than $2,500 each in a $15 million settlement. Here's how.Prices exclude VAT
Prices include VAT
-
- -
- 1
- +
'; //Added by Accenture(Prachi) as part of BSO R8 var simHTMLOld = '
'; if (psSelectedSimType.Product_Code != undefined) { removeSIMTypefromPackage(psSelectedSimType.Product_Code); deselectSIMTypeBox(psSelectedSimType.Product_Code); if (obj.Name.indexOf('Nano') > -1){ jQuery('.sim-img-combi').attr('src', 'https://o2uk.my.salesforce.com/servlet/servlet.ImageServer?id=0150Y000000DYL9QAO&oid=00D0Y000000YQQB&lastMod=1441885561000'); }else{ jQuery('.sim-img-nano').attr('src', 'https://o2uk.my.salesforce.com/servlet/servlet.ImageServer?id=0150Y000000DYLCQA4&oid=00D0Y000000YQQB&lastMod=1441887718000'); } } var simName = (obj.Name);//.toLowerCase(); var simId = obj.Product_Code.replace(/ /g,""); psSelectedSimType = obj; simHTML = strReplaceAll(simHTML, '[PS SIM TAG NAME]', simName); simHTML = strReplaceAll(simHTML, '[PS SIM QUANTITY]', '1'); simHTML = strReplaceAll(simHTML, '[PS SIM ID]', simId); //Added by Accenture(Prachi) as part of BSO R8 --START simHTMLOld = strReplaceAll(simHTMLOld, '[PS SIM TAG NAME]', simName); simHTMLOld = strReplaceAll(simHTMLOld, '[PS SIM QUANTITY]', '1'); simHTMLOld = strReplaceAll(simHTMLOld, '[PS SIM ID]', simId); refreshPackageSummary('simtype', simHTML); refreshPackageSummary('simtype', simHTMLOld); //Added by Accenture(Prachi) as part of BSO R8 --END jQuery('.grid-view-tariff').show(); jQuery('.chooseSimType').eq(1).show(); jQuery('.chooseSimType').eq(2).show(); jQuery('#tableGridSwitch').show(); //Added by Accenture/Vitisha as part of BSO R8 changeTariffView('table'); } function removeSIMTypefromPackage(obj) { if (psCurrentPage == 'SIMOnlyTariff') { var currentBtnId = ''; var removedObjId = ''; if (obj.id != undefined) { currentBtnId = obj.id; removedObjId = currentBtnId.substring(0, currentBtnId.indexOf('_')); } else { currentBtnId = obj; removedObjId = obj; } if (Object.keys(psSelectedTariff).length > 0) { var tarriffs = tariffList[0]; for (var i=0, len=tarriffs.length; i < len; i++) { jQuery('#' + tarriffs[i].tariff.cspmb__Price_Item_Code__c + '_tbl-btn').addClass('disabled'); jQuery('#' + tarriffs[i].tariff.cspmb__Price_Item_Code__c + '_grid-btn').addClass('disabled'); deselectTariffBox(tarriffs[i].tariff.cspmb__Price_Item_Code__c +'_grid'); deselectTariffBox(tarriffs[i].tariff.cspmb__Price_Item_Code__c +'_tbl'); } removeSIMOnlyTariff(psSelectedTariff); } refreshTotals(); deselectSIMTypeBox(removedObjId); jQuery('#' + removedObjId +'_grid-container').remove(); psSelectedSimType = ''; jQuery('.grid-view-tariff').hide(); jQuery('.chooseSimType').eq(1).hide(); jQuery('.chooseSimType').eq(2).hide(); jQuery('#tableGridSwitch').hide(); jQuery('.table-view-tariff').hide(); jQuery('#next-button-tariff').attr('onclick', ''); jQuery('#next-button-lower').attr('onclick', ''); jQuery('#next-button-upper').attr('onclick', ''); } else { showLoadingPanel(); if(sitePageNameList.toLocaleLowerCase().indexOf('apps') > -1) jQuery('input.goToSIMOPage').click(); } } //Added by Accenture/Prachi as part of BSO R8 Start function getSimOnlyAppleObject(appleobj,otherobj){ var setSimOnlyTypeApple = appleobj; var setSimOnlyTypeOther = otherobj; $(".addsimTypeAppleToPackage").each(function(){ jQuery(this).html(JSON.stringify(setSimOnlyTypeApple)); }); $(".addsimTypeOtherToPackage").each(function(){ jQuery(this).html(JSON.stringify(setSimOnlyTypeOther)); }); } //Added by Accenture/Prachi as part of BSO R8 End //Added by Accenture/Vitisha as part of BSO R8 Start function changeSimTariffInPackage(obj){ //Start 5G checkbox_flag=false; //End 5G var selProductCode,selObjId; var curSelectedObj = $(obj).attr('id'); var selSimId = curSelectedObj.substring(0,curSelectedObj.indexOf('_')); var simTypeApple = 'AppleiPhoneSIM'; var simTypeOther = 'OthersmartphonesSIM'; //Added by Accenture/Prachi as part of BSO R8 Start var jsonobj; var jsonobjforOthersmartPhone; $(".addsimTypeAppleToPackage").each(function(){ var addAppletoPackage = jQuery(this).html(); jsonobj = JSON.parse(addAppletoPackage); }); $(".addsimTypeOtherToPackage").each(function(){ var addOtherSmartPhonetoPackage = jQuery(this).html(); jsonobjforOthersmartPhone = JSON.parse(addOtherSmartPhonetoPackage); }); //Added by Accenture/Prachi as part of BSO R8 End if(selSimId.indexOf(simTypeApple)>-1){ selProductCode = selSimId.split(simTypeApple)[1]; }else if(selSimId.indexOf(simTypeOther)>-1){ selProductCode = selSimId.split(simTypeOther)[1]; //Start 5G checkbox_flag=true; //End 5G } if(jQuery('#' + selSimId + '_checkbox').attr('checked')){ selObjId = simTypeApple + selProductCode; $('#' + simTypeOther + selProductCode +'_tbl').hide(); //added by ravi for countdown timer - starts let arr = new Array (); arr = mapCountdownIntervals.get(simTypeOther + selProductCode); if(arr != undefined){ arr.forEach(myFunction); } function myFunction(value) { clearInterval(value); } $('#' + simTypeOther + selProductCode +'_tbl_banner').hide(); //added by ravi Countdown Timer var timertext = jQuery('#' + simTypeApple + selProductCode +'_timertext').html(); var timerdate = jQuery('#' + simTypeApple + selProductCode +'_timerdate').html(); if(timertext!='undefined' && timerdate!='undefined'){ var now = new Date().getTime(); var countDownDate = new Date(timerdate).getTime(); var distance = countDownDate - now; if(Math.floor(distance)>0){ Countdown(selProductCode,timerdate,timertext,selObjId,'Apple'); $('#' + selObjId +'_tbl_banner').show(); //added by ravi Countdown Timer } } //added by ravi for countdown timer - ends //Added by Accenture/Prachi as part of BSO R8 Start $('#' + simTypeOther + selProductCode +'_tbl_promo').hide(); addSIMTypeToPackage(jsonobj); jQuery('#OthersmartphonesSIM_grid-container').remove(); jQuery('#OthersmartphonesSIM_grid-container_old').remove(); var showPromo1 = jQuery('#' + simTypeApple + selProductCode +'_showPromo1').html(); var showPromo2 = jQuery('#' + simTypeApple + selProductCode +'_showPromo2').html(); var showPromo3 = jQuery('#' + simTypeApple + selProductCode +'_showPromo3').html(); if((showPromo1==='false') && (showPromo2==='false') && (showPromo3==='false')){ $('#' + simTypeApple + selProductCode +'_tbl_promo').addClass('hide'); $('#' + simTypeOther + selProductCode +'_tbl_promo').addClass('hide'); } else { $('#' + simTypeApple + selProductCode +'_tbl_promo').removeClass('hide'); $('#' + simTypeOther + selProductCode +'_tbl_promo').addClass('hide'); } //Added by Accenture/Prachi as part of BSO R8 End }else{ selObjId = simTypeOther + selProductCode; $('#' + simTypeApple + selProductCode +'_tbl').hide(); //added by ravi for countdown timer - starts let arr = new Array (); arr = mapCountdownIntervals.get(simTypeApple + selProductCode); if(arr != undefined ){ arr.forEach(myFunction); } function myFunction(value) { clearInterval(value); } $('#' + simTypeApple + selProductCode +'_tbl_banner').hide(); //added by ravi Countdown Timer var timertext = jQuery('#' + simTypeOther + selProductCode +'_timertext').html(); var timerdate = jQuery('#' + simTypeOther + selProductCode +'_timerdate').html(); if(timertext!='undefined' && timerdate!='undefined'){ var now = new Date().getTime(); var countDownDate = new Date(timerdate).getTime(); var distance = countDownDate - now; if(Math.floor(distance)>0){ Countdown(selProductCode,timerdate,timertext,selObjId,'Other'); $('#' + selObjId +'_tbl_banner').show(); //added by ravi Countdown Timer } } //added by ravi for countdown timer - Ends //Added by Accenture/Prachi as part of BSO R8 Start var showPromo1 = jQuery('#' + simTypeOther + selProductCode +'_showPromo1').html(); var showPromo2 = jQuery('#' + simTypeOther + selProductCode +'_showPromo2').html(); var showPromo3 = jQuery('#' + simTypeOther + selProductCode +'_showPromo3').html(); if((showPromo1==='false') && (showPromo2==='false') && (showPromo3==='false')){ $('#' + simTypeOther + selProductCode +'_tbl_promo').addClass('hide');; $('#' + simTypeApple + selProductCode +'_tbl_promo').addClass('hide'); } else{ $('#' + simTypeApple + selProductCode +'_tbl_promo').addClass('hide'); $('#' + simTypeOther + selProductCode +'_tbl_promo').addClass('show'); $('#' + simTypeOther + selProductCode +'_tbl_promo').removeClass('hide'); } addSIMTypeToPackage(jsonobjforOthersmartPhone); jQuery('#AppleiPhoneSIM_grid-container').remove(); jQuery('#AppleiPhoneSIM_grid-container_old').remove(); //Added by Accenture/Prachi as part of BSO R8 End } $('#' + selObjId +'_tbl').show(); $('#' + selObjId +'_tbl_promo').show(); $(".boxWithBorder input[type='checkbox']").each(function(){ if($(this).attr('id').indexOf(simTypeApple) > -1){ $(this).attr('checked','checked'); }else if($(this).attr('id').indexOf(simTypeOther) > -1){ $(this).removeAttr('checked'); } }); addSIMOnlyTariffToPackage($('#'+selObjId + '_tbl-btn')); /* Anand - appendRecommenddedTariff Method is to append the recommendded tag to the start of tariff table */ appendRecommenddedTariff(); } /*Start 5G 6sept2019*/ function show5GOverlay(){ if(psSelectedTariff[Object.keys(psSelectedTariff)] != undefined){ if(checkbox_flag == false){ var test = psSelectedTariff[Object.keys(psSelectedTariff)].tariff.Inclusive_Core_Data__c; //Start Ankita 5G Smartphone 2020 if(psSelectedTariff[Object.keys(psSelectedTariff)].tariff.Inclusive_Core_Data__c >='1000' /*&& psSelectedTariff[Object.keys(psSelectedTariff)].tariff.Inclusive_Core_Data__c !='999999999'*/){ //End Ankita 5G Smartphone 2020 var msgBody = '
Do you want a 4G tariff or a 5G tariff ?
'; var msgBodyDetail = 'If you have got a 5G ready device, you can choose a 5G tariff. Otherwise choose a 4G tariff.'; simGen = false; var link5G = '
More about 5G'; var linkCoverage = '
5G Coverage checker'; var genButton = '
'; document.getElementById("promotionDeviceContent").innerHTML='
'+msgBody+'
'+''+msgBodyDetail+'
'+genButton+''+link5G+linkCoverage; jQuery('#Promo-Popup').addClass('showContent'); } } } } function closePromoOverlay(genG){ jQuery('[id$="hiddengenG"]').val(genG); if(genG == 'gen4G') { jQuery('#Promo-Popup').removeClass('showContent'); //Start 5G Ankita genSelected = '4G'; //End 5g Ankita } else if(genG == 'gen5G'){ //Start 5G Ankita genSelected = '5G'; //End 5g Ankita jQuery('#Promo-Popup').removeClass('showContent'); simGen = true; boltOnsHTMLInPS = boltOnsHTMLInPS + '
'; } else{ jQuery('#Promo-Popup').removeClass('showContent')}; //maha added for 5G enhancement on 8th sept 2019 var T5gSelectedText = "Whenever you’re in a 5G area, you’ll automatically be connected to our 5G network."; var T5gHeading = "5G connectivity included"; var T5Gdefaultbolton = '
'+ '
'+ '
- '+ '
- '+ '
'+ '
'+ ' - '+ '
- '+ '
- '+T5gHeading+''+ ' '+ '
- '+ ''+T5gSelectedText+''+ ' '+ '
'+ '
'+ '
'+ '
'; if(simGen){ jQuery('#grid-view-bolton').append(T5Gdefaultbolton); } } function genval() { var selectedClassId = simGen ; return selectedClassId; } //End Ankita 5G Smartphone 2020 function closeIPhoneOverlay(selection){ continueIphone=false; if(selection=='continueIphone'){ continueIphone=true; showPackage(); jQuery('#Promo-PopupIphone').removeClass('showContent'); } else{ jQuery('#Promo-PopupIphone').removeClass('showContent'); } } //End 5G Ankita Iphone //Added by Accenture/Peenal as part of Bill Cap function showPackage(){ // alert('showPackage()'); $("#tariffEditLink").addClass('clicked'); $("#tariffTermDiv").hide(); $(".newBasket").show(); $("#spendCaps").addClass("headerDarkBg"); $('#spendCaps').css("margin-bottom","35px"); $('#spendCaps').css("margin-top","-23px"); $("#spendCaps").addClass("spendCapsIEMoz"); $("#chooseExtra").css("margin-top","0px"); $("#chooseExtra, #chooseSimoTariff").removeClass("headerDarkBg"); $(".table-view-tariff").addClass("hide"); $('[id$=":firstPackageSummary"], [id$=":secondPackageSummary"],#secondSection,#spendCapSection,#billCapBtnSection, #tariffEditLink').show(); $('[id$=":firstPackageSummary"] #simOnly, [id$=":secondPackageSummary"] .rhs-basket-bottom, [id$=":firstPackageSummary"] .costDisplay').addClass("hide"); $('[id$=":secondPackageSummary"] #psmtrSummary, [id$=":secondPackageSummary"] #simOnly,[id$=":firstPackageSummary"] .rhs-basket-bottom,[id$=":secondPackageSummary"] .basket-bottom-cost,[id$=":secondPackageSummary"] .costDisplay').show(); $(".incAllPlans, .left, .right").hide(); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-95px");//smallbiz ravi - dec 10 2020 $('[id$=":secondPackageSummary"] #simOnly').css("margin-top","-20px"); if($('#promotion1').css('display') == 'none'){ $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-245px"); $('[id$=":secondPackageSummary"] #simOnly').css("margin-top","-85px"); } $("#vatSection").css({'margin-top':'0px', 'left': '887px','height':'0px'}); $("#chooseSimoTariff").css('margin-top','60px'); $('[id$=":secondPackageSummary"] #next-button-simonly').addClass('buttonDisabled').removeClass('btnEnable').show().attr('onclick', ''); if($('#capSelectedSection').hasClass('capSelected')) { $("#billCapEditLink,#capSelectedSection,.hideExtrasBolton,").show(); $("#spendCapSection, #capSelectionSection, #billCapDescription").hide(); $('[id$=":secondPackageSummary"] #next-button-simonly').removeClass('buttonDisabled').addClass('btnEnable').attr('onclick', 'goToNextPage();'); $("#spendCaps").removeClass("headerDarkBg"); $("#chooseExtra").addClass("headerDarkBg"); $('#spendCaps').css("margin-bottom","0px"); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-95px");//smallbiz ravi - dec 10 2020 $('[id$=":secondPackageSummary"] #simOnly').css("margin-top","-20px"); $("#secondSection").addClass("lightGreyBg"); } if($('#noCapSelectedSection').hasClass('capSelected')) { $("#noCapSelectedSection,#billCapEditLink,.hideExtrasBolton,").show(); $("#spendCapSection, #capSelectionSection, #billCapDescription").hide(); $('[id$=":secondPackageSummary"] #next-button-simonly').removeClass('buttonDisabled').addClass('btnEnable').attr('onclick', 'goToNextPage();'); $("#spendCaps").removeClass("headerDarkBg"); $("#chooseExtra").addClass("headerDarkBg"); $('#spendCaps').css("margin-bottom","0px"); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-95px");//smallbiz ravi - dec 10 2020 $('[id$=":secondPackageSummary"] #simOnly').css("margin-top","-20px"); $("#secondSection").addClass("lightGreyBg"); } } //Added by Accenture/Vitisha as part of BSO R8 End function addSIMOnlyTariffToPackage(obj){ var simGen; refreshSelectedAppleTariff(); var tariffEditLinkClicked; var tariffhtml = '
- [PS AIRTIME PER MONTH COST]
- [PS AIRTIME PER MONTH COST VAT]
- [PS AIRTIME PER WAS MONTH COST]
- [PS AIRTIME WAS PER MONTH COST VAT]
- ex VAT
- inc VAT
-
- [PS TARIFF DATA] data|[PS TARIFF MINUTES] minutes |[PS TARIFF TEXTS] |[PS TARIFF CONTRACT LENGTH]
- [PS TARIFF DATA ROLLOVER]
- More details
'; //Added by Accenture(Prachi) as part of BSO R8 var tariffhtmlOld = '
'; var currentSelectedObj = $(obj).attr('id'); var selectedObjId = currentSelectedObj.substring(0,currentSelectedObj.indexOf('_')); if ($("#"+selectedObjId+"_tbl-btn").hasClass("continueClicked")) { tariffEditLinkClicked = true; } else { tariffEditLinkClicked = false; } //Added by Accenture/Vitisha as part of BSO R8 jQuery('#' + selectedObjId +'_simType').show(); var tariffElem = $(obj).parent().parent().parent(); var boxwithBorderChild = $('.boxWithBorder').children().children().children(); var tariffchild = tariffElem.children().children().children(); if($('.boxWithBorder').hasClass('selectedTariff')) { $('.boxWithBorder').removeClass('selectedTariff'); } $(".selectedButton").each(function() { $(this).addClass('blueLight').removeClass('selectedButton'); }); //Added by Accenture(Prachi) as part of BSO R8 if($('.bolton-top-item').hasClass('selectedTariff')) { $('.bolton-top-item').removeClass('selectedTariff'); $('.bolton-top-item').removeClass('selected-insurance'); } if($('.text_Was').hasClass('wasTextColor')) { $('.text_Was').removeClass('wasTextColor'); } if(boxwithBorderChild!=null && boxwithBorderChild!=undefined){ boxwithBorderChild.each(function(){ if($(this).hasClass('selectedButtonSim')){ $(this).removeClass('selectedButtonSim'); } }); } if(tariffElem!=null && tariffElem!=undefined){ tariffElem.each(function(){ if($(this).hasClass('boxWithBorder')){ var tariffSection = $(this); if(tariffSection.hasClass("selectedTariff")) { tariffSection.removeClass("selectedTariff"); }else{ tariffSection.addClass("selectedTariff"); } } }); } if(tariffchild!=null && tariffchild!=undefined){ tariffchild.each(function(){ if($(this).hasClass('text_Was')){ $(this).addClass('wasTextColor'); } }); } jQuery("#ataglearnMore").addClass("lmielshift"); //added by nidhiSolanki -03/03/2021 if (Object.keys(psSelectedTariff).length > 0) { var previouslyAddedTariff,prevProductCode; if (psSelectedTariff[Object.keys(psSelectedTariff)].sku != undefined) previouslyAddedTariff = stripSKU(psSelectedTariff[Object.keys(psSelectedTariff)].sku); else previouslyAddedTariff = stripSKU(psSelectedTariff[Object.keys(psSelectedTariff)].sku); deselectTariffBox(previouslyAddedTariff + '_grid'); deselectTariffBox(previouslyAddedTariff + '_tbl'); //Added by Accenture/Vitisha as part of BSO R8 var selConTerm = jQuery('#' + selectedObjId + '_contract-length').html(); var prevConTerm = psSelectedTariff[Object.keys(psSelectedTariff)].tariff.cspmb__Contract_Term__c; if(selConTerm == prevConTerm){ if((previouslyAddedTariff.indexOf(simTypeApple)>-1) && (tariffEditLinkClicked == false)){ prevProductCode = previouslyAddedTariff.split(simTypeApple)[1]; $('#' + simTypeOther + prevProductCode +'_tbl').show(); $('#' + simTypeOther + prevProductCode +'_tbl_promo').removeClass('hide'); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-245px"); $('[id$=":secondPackageSummary"] #simOnly').css("margin-top","-85px"); $('#' + simTypeOther + prevProductCode +'_simType').hide(); $('#' + previouslyAddedTariff +'_tbl').hide(); $('#' + previouslyAddedTariff +'_tbl_promo').addClass('hide'); //Added by Accenture(Prachi) as part of Coundown Timer --- start var timertext = jQuery('#' + simTypeOther + prevProductCode +'_timertext').html(); var timerdate = jQuery('#' + simTypeOther + prevProductCode +'_timerdate').html(); var selObjId = simTypeOther + prevProductCode; if(timertext!='undefined' && timerdate!='undefined'){ $('#' + simTypeOther + prevProductCode +'_tbl_banner').show(); //added by prachi Countdown Timer Countdown(prevProductCode,timerdate,timertext,selObjId,'Other'); appendRecommenddedTariff(); } //Added by Accenture(Prachi) as part of Coundown Timer --- end } //Added by Accenture/Prachi as part of Bill cap release --start else if((previouslyAddedTariff.indexOf(simTypeApple)>-1) && (tariffEditLinkClicked == true)){ prevProductCode = previouslyAddedTariff.split(simTypeApple)[1]; $('#' + simTypeApple + prevProductCode +'_tbl').show(); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-245px"); $('[id$=":secondPackageSummary"] #simOnly').css("margin-top","-85px"); //$('#' + previouslyAddedTariff +'_tbl').hide(); //$('#' + previouslyAddedTariff +'_tbl_promo').addClass('hide'); } else if((previouslyAddedTariff.indexOf(simTypeOther)>-1)){ prevProductCode = previouslyAddedTariff.split(simTypeOther)[1]; $('#' + simTypeOther + prevProductCode +'_tbl').show(); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-245px"); $('[id$=":secondPackageSummary"] #simOnly').css("margin-top","-85px"); if($('#' + simTypeOther + prevProductCode +'_tbl').hasClass("selectedTariff")){ $('#' + simTypeOther + prevProductCode +'_simType').show();} else { $('#' + simTypeOther + prevProductCode +'_simType').hide(); } } } else{ //Added by Accenture(Prachi) as part of Coundown Timer --- start if((previouslyAddedTariff.indexOf(simTypeApple)>-1)) prevProductCode = previouslyAddedTariff.split(simTypeApple)[1]; else prevProductCode = previouslyAddedTariff.split(simTypeOther)[1]; var timertext = jQuery('#' + simTypeOther + prevProductCode +'_timertext').html(); var timerdate = jQuery('#' + simTypeOther + prevProductCode +'_timerdate').html(); var selObjId = simTypeOther + prevProductCode; if(timertext!='undefined' && timerdate!='undefined'){ $('#' + simTypeOther + prevProductCode +'_tbl_banner').show(); //added by prachi Countdown Timer Countdown(prevProductCode,timerdate,timertext,selObjId,'Other'); appendRecommenddedTariff(); } //Added by Accenture(Prachi) as part of Coundown Timer --- end $("#"+previouslyAddedTariff+"_simType").hide(); } removeSIMOnlyTariff(psSelectedTariff); applyFilter(); } //Added by Accenture(Prachi) as part of BSO R8 -- Start var jsonobj; var jsonobjforOthersmartPhone; $(".addsimTypeAppleToPackage").each(function(){ var addAppletoPackage = jQuery(this).html(); jsonobj = JSON.parse(addAppletoPackage); }); $(".addsimTypeOtherToPackage").each(function(){ var addOtherSmartPhonetoPackage = jQuery(this).html(); jsonobjforOthersmartPhone = JSON.parse(addOtherSmartPhonetoPackage); }); if(selectedObjId.indexOf('Othersmartphones')>-1){ jQuery('#AppleiPhoneSIM_grid-container').remove(); jQuery('#AppleiPhoneSIM_grid-container_old').remove(); jQuery('#OthersmartphonesSIM_grid-container').remove(); jQuery('#OthersmartphonesSIM_grid-container_old').remove(); addSIMTypeToPackage(jsonobjforOthersmartPhone); } else{ jQuery('#AppleiPhoneSIM_grid-container').remove(); jQuery('#AppleiPhoneSIM_grid-container_old').remove(); jQuery('#OthersmartphonesSIM_grid-container').remove(); jQuery('#OthersmartphonesSIM_grid-container_old').remove(); addSIMTypeToPackage(jsonobj); } //Added by Accenture(Prachi) as part of BSO R8 -- End /*CFD-948 CD43226 Smartphone 2016 START*/ //PS:02/06/2017 EURegs_Yield_Project Start var euData = ''; if(jQuery('#' + selectedObjId + '_eu_data').html() != '') euData = '
'; tariffhtml = strReplaceAll(tariffhtml, '[PS EU TARIFF MINS TEXTS]', euData); //Added by Accenture(Prachi) as part of BSO R8 tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS EU TARIFF MINS TEXTS]', euData); var euData = ''; var ukeuMins = ''; var euTexts = ''; var euMins = ''; /*CFD-948 CD43226 Smartphone 2016 END*/ /*CFD-1180 START*/ if(euData != '' && euData.length > 0 || euTexts != '' && euTexts.length > 0 || euMins != '' && euMins.length > 0){ if(jQuery('#travelling_europe-details').css('display') == 'block'){ jQuery('#travelling_europe-link').click(); jQuery('.travelling-europe-bg').hide(); jQuery('.travelling-header').hide(); jQuery('.travelling-header').parent().find('h3').hide(); } else{ jQuery('.travelling-europe-bg').hide(); jQuery('.travelling-header').hide(); jQuery('.travelling-header').parent().find('h3').hide(); } } else{ jQuery('.travelling-europe-bg').show(); jQuery('.travelling-header').show(); jQuery('.travelling-header').parent().find('h3').show(); } /*CFD-1180 END*/ tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF TAG NAME]', selectedObjId); //Added by Accenture(Prachi) as part of BSO R8 ---START var contractTerm = jQuery('#' + selectedObjId + '_contract-length').html(); if(contractTerm=='1'){ tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF CONTRACT LENGTH]', '30 days contract'); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF CONTRACT LENGTH]','30 days contract'); } else { //Modified by Accenture/Vitisha as part of Bill Cap contractTerm = contractTerm + ' months contract'; //Modified by Nishith - 36M changes. tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF CONTRACT LENGTH]',contractTerm); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF CONTRACT LENGTH]',contractTerm); } //Added by Accenture(Prachi) as part of BSO R8 ---END tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DATA]', jQuery('#' + selectedObjId + '_tbl-data').html()); //Added by Accenture(Prachi) as part of BSO R8 ---START tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF TAG NAME]', selectedObjId); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF DATA]', jQuery('#' + selectedObjId + '_tbl-data').html()); //Added by Accenture(Prachi) as part of BSO R8 ---END var selectedTariffMinutes = jQuery('#' + selectedObjId + '_tbl-minutes').html(); selectedTariffMinutes = selectedTariffMinutes.substring(0,selectedTariffMinutes.indexOf(' ')); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF MINUTES]', selectedTariffMinutes); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF TEXTS]', jQuery('#' + selectedObjId + '_tbl-texts').html()); //Added by Accenture(Prachi) as part of BSO R8 ---START tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF MINUTES]', selectedTariffMinutes); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF TEXTS]', jQuery('#' + selectedObjId + '_tbl-texts').html()); //Added by Accenture(Prachi) as part of BSO R8 ---END //added for data rollover - Ravi - Starts tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DATA ROLLOVER]', jQuery('#' + selectedObjId + '_tbl-rollover').html()); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF DATA ROLLOVER]', jQuery('#' + selectedObjId + '_tbl-rollover').html()); //added for data rollover - Ravi - Ends var unitPrice = jQuery('#' + selectedObjId + '_month-price').html(); var monthPrice = "0"; // Added by Ravi for the was now pricing -Starts var wasunitPrice = jQuery('#' + selectedObjId + '_was_month-price').html(); var wasunitPriceVat = jQuery('#' + selectedObjId + '_was_month-price-VAT').html(); var wasmonthPrice = "0"; var wasmonthPriceVat = "0"; // Added by Ravi for the was now pricing -ends //Added by Accenture/Prachi as part of BSO R8 var qty ; if(jQuery('[id^="psNoOfSIMs"]').hasClass('newPackageSimCount')){ $(".newPackageSimCount").each(function(){ SimId = $(this).attr('id'); qty = jQuery('#'+SimId).html(); }); } if (jQuery('[id^="psNoOfSIMs"]').val() != undefined) { //Added by Accenture/Prachi as part of BSO R8 if(jQuery('[id^="psNoOfSIMs"]').hasClass('newPackageSimCount')){ $(".newPackageSimCount").each(function(){ SimId = $(this).attr('id'); qty = jQuery('#'+SimId).html(); }); } else { qty = jQuery('[id^="psNoOfSIMs"]').html(); } monthPrice = parseFloat(unitPrice) * parseFloat(qty); //Added by Ravi for was now pricing- Starts if(wasunitPrice != undefined && wasunitPrice != 'undefined'){ wasmonthPrice = parseFloat(wasunitPrice) * parseFloat(qty); } if(wasunitPriceVat != undefined && wasunitPriceVat != 'undefined'){ wasmonthPriceVat = parseFloat(wasunitPriceVat) * parseFloat(qty); } } else{ monthPrice = 0; wasmonthPrice = 0; wasmonthPriceVat = 0; } if(wasunitPrice != undefined && wasunitPrice != 'undefined'){ tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF WAS UNIT PRICE]', formatPound(wasunitPrice)); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF WAS UNIT PRICE]', formatPound(wasunitPrice)); }else{ tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF WAS UNIT PRICE]', wasunitPrice); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF WAS UNIT PRICE]', wasunitPrice); } if(wasmonthPrice != "0" && wasmonthPrice != 0){ var x = 'was
'; var xVat = 'was
'; tariffhtml = strReplaceAll(tariffhtml, '[PS AIRTIME PER WAS MONTH COST]', x); tariffhtml = strReplaceAll(tariffhtml, '[PS AIRTIME WAS PER MONTH COST VAT]', xVat); tariffhtml = strReplaceAll(tariffhtml, '[COLOR CODE]', 'wasnowpink'); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS AIRTIME PER WAS MONTH COST]', x); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS AIRTIME WAS PER MONTH COST VAT]', xVat); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[COLOR CODE]', 'wasnowpink'); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[WAS NOW]', 'showblock'); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[NO WAS NOW]', 'hideblock'); }else{ tariffhtml = strReplaceAll(tariffhtml, '[PS AIRTIME PER WAS MONTH COST]', ''); tariffhtml = strReplaceAll(tariffhtml, '[PS AIRTIME WAS PER MONTH COST VAT]', ''); tariffhtml = strReplaceAll(tariffhtml, '[COLOR CODE]', ''); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS AIRTIME PER WAS MONTH COST]', ''); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS AIRTIME WAS PER MONTH COST VAT]', ''); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[COLOR CODE]', ''); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[WAS NOW]', 'hideblock'); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[NO WAS NOW]', ''); } //Added by Ravi for was now pricing- Ends tariffhtml = strReplaceAll(tariffhtml, '[PS AIRTIME PER MONTH COST]', formatPound(monthPrice) + '*'); tariffhtml = strReplaceAll(tariffhtml, '[PS AIRTIME PER MONTH COST VAT]', formatPound(monthPrice*VATmultiplier) + '*'); // by sohil Sprint 6 tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF UNIT PRICE]', formatPound(unitPrice)); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF QTY]', qty); //Added by Accenture(Prachi) as part of BSO R8 ---START tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS AIRTIME PER MONTH COST]', formatPound(monthPrice) + '*'); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS AIRTIME PER MONTH COST VAT]', formatPound(monthPrice*VATmultiplier) + '*'); // by sohil Sprint 6 tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF UNIT PRICE]', formatPound(unitPrice)); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF QTY]', jQuery('[id^="psNoOfSIMs"]').html()); //Added by Accenture(Prachi) as part of BSO R8 ---END //Modified by Accenture/Vitisha as part of BSO R8 //Added by Accenture/Peenal as part of Bill Cap updateButton(selectedObjId + '_tbl-btn', 'SelectedSim'); /*Start 5G 6sept2019*/ //Start 5G Ankita iphone //Start Ankita 5G Smartphone 2020 addRemoveButtonClickFunction('#' + selectedObjId + '_tbl-btn', 'bind', 'show5GOverlay();showPackage();'); checkbox_flag=false; /*End 5G 6sept2019*/ var tariffs = tariffList[0]; for (var item=0, len=tariffs.length; item < len; item++) { if (tariffs[item].sku != undefined && selectedObjId.indexOf(stripSKU(tariffs[item].sku)) > -1) { psSelectedTariff[stripSKU(tariffs[item].sku)] = tariffs[item]; //Added by Accenture(Prachi) as part of BSO R8 -- START if(tariffs[item].tariff.Promotion_Header__c != undefined || tariffs[item].tariff.Promotion_Header__c != null ) { pspromotion = tariffs[item].tariff.Promotion_Header__c; var pspromotionsplit; if(pspromotion.indexOf(':#') > -1){ var promoData = pspromotion.split(':#'); pspromotionsplit = promoData[0]; } else{ pspromotionsplit = pspromotion; } tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF PROMOTION]', pspromotionsplit); } else{ tariffhtml = strReplaceAll(tariffhtml, 'display:none !important-promotion1', 'display:none !important'); } if(tariffs[item].tariff.Promotion_Header2__c != undefined || tariffs[item].tariff.Promotion_Header2__c != null ) { pspromotion1 = tariffs[item].tariff.Promotion_Header2__c; if(pspromotion1.indexOf(':#') > -1) { promoData1 = pspromotion1.split(':#'); pspromotionsplit1 = promoData1[0]; } else{ pspromotionsplit1 = pspromotion1; } tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF PROMOTION1]', pspromotionsplit1); } else { tariffhtml = strReplaceAll(tariffhtml, 'display:none !important-promotion2', 'display:none !important'); } if(tariffs[item].tariff.Promotion_Header3__c != undefined || tariffs[item].tariff.Promotion_Header3__c != null ) { pspromotion2 = tariffs[item].tariff.Promotion_Header3__c; if(pspromotion2.indexOf(':#') > -1){ var promoData2 = pspromotion2.split(':#'); pspromotionsplit2 = promoData2[0]; } else{ pspromotionsplit2 = pspromotion2; } tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF PROMOTION2]', pspromotionsplit2); } else { tariffhtml = strReplaceAll(tariffhtml, 'display:none !important-promotion3', 'display:none !important'); } if((tariffs[item].tariff.Promotion_Header3__c == undefined || tariffs[item].tariff.Promotion_Header3__c == null) && (tariffs[item].tariff.Promotion_Header2__c == undefined || tariffs[item].tariff.Promotion_Header2__c == null ) && (tariffs[item].tariff.Promotion_Header__c == undefined || tariffs[item].tariff.Promotion_Header__c == null )) tariffhtml = strReplaceAll(tariffhtml, 'display:none !important-promotion', 'display:none !important'); //Added by Accenture(Prachi) as part of BSO R8 -- END psSelectedTariffJSON = psSelectedTariff; psCurrentPage = 'SIMOnlyTariff'; } } psSelectedTariffHTML = tariffhtml; selectTariffBox(selectedObjId + '_grid'); selectTariffBox(selectedObjId + '_tbl'); jQuery('#next-button-tariff').removeClass('buttonDisabled'); jQuery('#next-button-tariff').attr('onclick', 'addPackageToBasket();'); //Added by Accenture(Prachi) as part of BSO R8 jQuery('#next-button-lower').removeClass('buttonDisabled'); jQuery('#next-button-lower').attr('onclick', 'addPackageToBasket();'); jQuery('#next-button-upper').removeClass('buttonDisabled'); jQuery('#next-button-upper').attr('onclick', 'addPackageToBasket();'); jQuery('.costDisplay').show();// by sohil Sprint 3 jQuery('.costDisplayUpper').show();// by sohil Sprint 3 //Yield part b jQuery('.basket-gray-text').show();// by sohil Sprint 3 refreshPackageSummary('simotariff', tariffhtml); psSelectedTariffHTML = tariffhtmlOld; refreshPackageSummary('simotariff', tariffhtmlOld); showDataRollOverSeperator(); //Data Rollover var data = jQuery('#' + selectedObjId + '_tbl-data').html(); // by Sohil Sprint 6 /*CFD-1180 START*/ var rowBoltonhtml = '
'; if(rowBoltonhtml != null && rowBoltonhtml != '' && rowBoltonhtml.length > 0) jQuery('.trfDiv').append(rowBoltonhtml); //Added by Accenture(Prachi) as part of BSO R8 --START var selectedTariffCode1 = psSelectedTariff[Object.keys(psSelectedTariff)].sku ; selectedTariffCode1 = selectedTariffCode1.replace(/\s/g,''); jQuery('input[id$=selectedTariffCode]').val(selectedTariffCode1); jQuery('input[id$=selectedDeviceSku]').val(psSelectedTariff[Object.keys(psSelectedTariff)].sku); if(sessionStorage.PricesVAT == true || sessionStorage.PricesVAT == 'true'){ jQuery('#'+ selectedObjId + '_ps-monthCost-VAT').addClass("simopriceIncVatMoz");} else { jQuery('#'+ selectedObjId + '_ps-monthCost').addClass("simopriceMoz");} //Added by Accenture(Prachi) as part of BSO R8 --END /*CFD-1180 END*/ if(sessionStorage.PricesVAT == true || sessionStorage.PricesVAT == 'true') showVAT(); else hideVAT(); //--updated by Piyush_CICS_CR || Data only tariff in SIMO (CICS CR) || 14JUNE2022 --Start var tariffMinutes = psSelectedTariff[Object.keys(psSelectedTariff)].tariff.Inclusive_Minutes__c; var tariffText = psSelectedTariff[Object.keys(psSelectedTariff)].tariff.Inclusive_Texts__c; if(tariffMinutes == '0' && tariffText == '0'){ jQuery('#' + selectedObjId +'_simType').hide(); } else{ jQuery('#' + selectedObjId +'_simType').show(); } //--updated by Piyush_CICS_CR || Data only tariff in SIMO (CICS CR) || 14JUNE2022 --END } //Data Rollover changes. function showDataRollOverSeperator() { jQuery('.checkroll').each(function(index){ if(!jQuery(this).hasClass('Rollover')) { jQuery(this).addClass('hide'); } }); //existing issue fix by ravi - 02 feb 2020 jQuery('.removelink').each(function(index){ if(jQuery(this).hasClass('tariff-detail-link')) { jQuery(this).removeClass('tariff-detail-link'); } }); //existing issue fix by ravi - 02 feb 2020 } //Modified by Accenture/Vitisha as part of Bill Cap function addTariffToPackage(obj) {
$("#tariffHead").removeClass("headerDarkBg"); $("#spendCaps").addClass("headerDarkBg"); $("#showPrices").css("margin-top","-26px"); $("#table-view,.tariffTabs,.tabText,.belowTabText,.tabBorder,.boltOnSummary").hide(); $(".filter-left,.filter-right,.filter-left-5G").hide(); //5G:SN:11092019 //added by ravi || WOR || 9 jul 2021 || starts $(".filter-mid").hide(); $(".36mnthtxt").addClass("hidevisible"); $(".36mnthtxt").removeClass("visible"); //added by ravi || WOR || 9 jul 2021 || ends //$("#hideExtra,.hideExtrasBolton,.hide_details").hide();//Commented by Amit SBL - dec 10 2020 $("#secondSection").hide(); //Added by Amit SBL - dec 10 2020 $("#chooseExtra").css("margin-top","-20px"); //Added by Amit SBL - dec 10 2020 $("#chooseExtra").css("background","#D8D8D8");//Added by Amit SBL - dec 10 2020 $(".filter-mid").addClass("filter-mid2"); $("#tariffHead").css("margin-top","38px"); $("#spendCaps").css("margin-top","-20px"); //$("#chooseExtra").css("margin-top","0px");//Commented by Amit SBL - dec 10 2020 $("#capSelectionSection").hide(); $(".newBasket,#billCapBtnSection,#spendCapSection,#chooseTariffEdit,.hideExtrasBolton,.hide_details").show(); //Added by Amit SBL - dec 10 2020 $('[id$=":firstPackageSummary"], [id$=":secondPackageSummary"]').show(); $('[id$=":firstPackageSummary"] #notsimOnly,[id$=":secondPackageSummary"] .rhs-basket-bottom, [id$=":firstPackageSummary"] .costDisplay,[id$=":firstPackageSummary"] .basket-bottom-cost').hide(); $('[id$=":secondPackageSummary"] #psmtrSummary, [id$=":secondPackageSummary"] #notsimOnly,[id$=":firstPackageSummary"] .rhs-basket-bottom,[id$=":secondPackageSummary"] .basket-bottom-cost').show(); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-95px");
jQuery('.ChildGridClass').css("display","none"); var tablettext = jQuery('#tablet-bolton-msg').text(); if (tablettext.toLowerCase().indexOf("unfortunately") >= 0) { $("#bolton-pricesExcVat").hide(); $("#bolton-pricesIncVat").hide(); } var tariffhtml = '
'; var tariffhtmlOld = '
-
-
- Airtime cost per month
- [PS TARIFF CONTRACT LENGTH] month contract
- [PS TARIFF DATA] data
- [PS TARIFF MINUTES] minutes and [PS TARIFF TEXTS] [PS EU TARIFF MINS TEXTS]
-
- [PS AIRTIME PER MONTH COST]
-
- Remove
'; var currentSelectedObj = obj.id; var promotion = obj.Promotion_Header__c; var selectedObjId = currentSelectedObj.substring(0, currentSelectedObj.indexOf('_')); var tariffElem = $(obj).parent().parent(); var mem = ''; if($('.boxWithBorder').hasClass('selectedTariff')) { $('.boxWithBorder').removeClass('selectedTariff'); } if($('.bolton-top-item').hasClass('selectedTariff')) { $('.bolton-top-item').removeClass('selectedTariff'); $('.bolton-top-item').removeClass('selected-insurance'); } if($('.text_Was').hasClass('wasTextColor')) { $('.text_Was').removeClass('wasTextColor'); } if($('.openPlanDetail').hasClass('fontColor1-selectedTariff')) { $('.openPlanDetail').removeClass('fontColor1-selectedTariff'); $('.openPlanDetail').removeClass('learnIcon'); $('.openPlanDetail').addClass('tariff-detail-link'); } var tariffchild = tariffElem.children().children(); var learnmore = tariffElem.children(); if(learnmore!=null && learnmore!=undefined){ learnmore.each(function(){ if($(this).hasClass('openPlanDetail')){ $(this).addClass('fontColor1-selectedTariff'); $(this).addClass('learnIcon'); $(this).removeClass('tariff-detail-link'); } }); } if(tariffchild!=null && tariffchild!=undefined){ tariffchild.each(function(){ if($(this).hasClass('text_Was')){ $(this).addClass('wasTextColor'); } if($(this).hasClass('openPlanDetail')){ $(this).addClass('fontColor1-selectedTariff'); } }); } var boxwithBorderChild = $('.boxWithBorder').children().children(); if(boxwithBorderChild!=null && boxwithBorderChild!=undefined){ boxwithBorderChild.each(function(){ if($(this).hasClass('selectedButton')){ $(this).removeClass('selectedButton'); } }); } if(tariffElem!=null && tariffElem!=undefined){ tariffElem.each(function(){ if($(this).hasClass('boxWithBorder')){ var tariffSection = $(this); if(tariffSection.hasClass("selectedTariff")){ tariffSection.removeClass("selectedTariff"); }else{ tariffSection.addClass("selectedTariff"); } } }); } $('[id^=app_] .basket-remove-lnk').each(function(){ removeAppFromPackage($(this)); }); //added by anmol US21 $(".packageaccessory .basket-remove-lnk").each(function(){ removeAccessoryToPackage($(this)); }); $(".bolton-top-item").hide(); if (Object.keys(psSelectedTariff).length > 0) { var previouslyAddedTariff; var promotion = psSelectedTariff[Object.keys(psSelectedTariff)].handset.Promotion_Header__c; if (psSelectedTariff[Object.keys(psSelectedTariff)].tariff != undefined) previouslyAddedTariff = psSelectedTariff[Object.keys(psSelectedTariff)].tariff.cspmb__Price_Item_Code__c + '\\|' + psSelectedTariff[Object.keys(psSelectedTariff)].handset.Id + '\\|' + psSelectedTariff[Object.keys(psSelectedTariff)].handset.Full_upfront__c; else previouslyAddedTariff = psSelectedTariff[Object.keys(psSelectedTariff)].cspmb__Price_Item_Code__c + '\\|' + psSelectedTariff[Object.keys(psSelectedTariff)].handset.Id+ '\\|' + psSelectedTariff[Object.keys(psSelectedTariff)].handset.Full_upfront__c; deselectTariffBox(previouslyAddedTariff + '_grid'); deselectTariffBox(previouslyAddedTariff + '_tbl'); removeTariff(psSelectedTariff); } var jquerySelectorQuery = strReplaceAll(selectedObjId, '|', '\\|'); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF TAG NAME]', selectedObjId); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF TAG NAME]', selectedObjId);
var tariffs = tariffList[0]; for (var item=0, len=tariffs.length; item < len; item++) { if (tariffs[item].tariff != undefined && selectedObjId.indexOf(tariffs[item].tariff.cspmb__Price_Item_Code__c + '|' + tariffs[item].handset.Id + '|' + tariffs[item].handset.Full_upfront__c) > -1) { if(tariffs[item].handset.Full_upfront__c) { tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF CONTRACT LENGTH]', "30 days contract"); } else{ //Modified by Accenture/Vitisha as part of Bill Cap tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF CONTRACT LENGTH]', jQuery('#' + jquerySelectorQuery + '_contract-length').html().concat(' months contract')); //Modified by Nishith - 36M changes. } }} // tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF CONTRACT LENGTH]', jQuery('#' + jquerySelectorQuery + '_contract-length').html());
tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF CONTRACT LENGTH]', jQuery('#' + jquerySelectorQuery + '_contract-length').html()); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DATA]', jQuery('#' + jquerySelectorQuery + '_tbl-data').html()); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF DATA]', jQuery('#' + jquerySelectorQuery + '_tbl-data').html()); //Added for Data Rollover - Ravi Shankar - Starts tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DATA ROLLOVER]', jQuery('#' + jquerySelectorQuery + '_tbl-rollover').html()); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF DATA ROLLOVER]', jQuery('#' + jquerySelectorQuery + '_tbl-rollover').html()); //Added for Data Rollover - Ravi Shankar - Ends // Added these two lines to remove / after unlimited text. var selectedTariffMinutes = jQuery('#' + jquerySelectorQuery + '_tbl-minutes').html(); selectedTariffMinutes = selectedTariffMinutes.substring(0,selectedTariffMinutes.indexOf(' ')); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF MINUTES]', selectedTariffMinutes); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF MINUTES]', selectedTariffMinutes); if(jQuery('#' + jquerySelectorQuery + '_tbl-texts').html() == 'Unlimited'){ tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF TEXTS]', 'Unlimited'); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF TEXTS]', 'Unlimited'); } else{ tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF TEXTS]', jQuery('#' + jquerySelectorQuery + '_tbl-texts').html()); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF TEXTS]', jQuery('#' + jquerySelectorQuery + '_tbl-texts').html()); } //added by ravi for was now price - starts var wasmonthlyPrice = jQuery('#' + jquerySelectorQuery + '_device-was-monthly-price').html(); var wasmonthlyPriceVat = jQuery('#' + jquerySelectorQuery + '_device-was-monthly-price-vat').html(); var wasupfrontPrice = jQuery('#' + jquerySelectorQuery + '_device-was-upfront-price').html(); var wasupfrontPriceVat = jQuery('#' + jquerySelectorQuery + '_device-was-upfront-price-vat').html(); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DEVICE WAS MONTHLY PRICE]', wasmonthlyPrice); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DEVICE WAS MONTHLY PRICE VAT]', wasmonthlyPriceVat); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DEVICE WAS UPFRONT PRICE]', wasupfrontPrice); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DEVICE WAS UPFRONT PRICE VAT]', wasupfrontPriceVat); //added by ravi for was now price - ends var unitPrice = jQuery('#' + jquerySelectorQuery + '_month-price').html(); var monthPrice = parseFloat(unitPrice) * parseFloat(jQuery('[id^="psNoOfDevices"]').val()); if(jQuery('[id^="psNoOfDevices"]').hasClass('newPackageDeviceCount')){ var monthPrice = parseFloat(unitPrice) * parseFloat(jQuery('[id^="psNoOfDevices"]').html()); //Modified by Accenture/Vitisha as part of Bill Cap } var deviceMonthlyPrice = jQuery('#' + jquerySelectorQuery + '_device-tariff-price').html(); // ravi smallbiz - dec 10 2020 tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DEVICE MONTHLY PRICE]', deviceMonthlyPrice); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF DEVICE MONTHLY PRICE]', deviceMonthlyPrice); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF UPFRONT PRICE]', jQuery('#' + jquerySelectorQuery + '_discount-price').html()); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF UPFRONT PRICE]', jQuery('#' + jquerySelectorQuery + '_discount-price').html()); /* Added by Accenture/Vitisha Start */ $('#upfront_price').html(formatPound(jQuery('#' + jquerySelectorQuery + '_discount-price').html())); $('#month_price').html(formatPound(parseFloat(monthPrice) + parseFloat(deviceMonthlyPrice))); /* Added by Accenture/Vitisha End */ tariffhtml = strReplaceAll(tariffhtml, '[PS AIRTIME PER MONTH COST]', formatPound(monthPrice) + '*'); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS AIRTIME PER MONTH COST]', formatPound(monthPrice) + '*'); tariffhtml = strReplaceAll(tariffhtml, '[PS AIRTIME PER MONTH COST VAT]', formatPound(monthPrice*VATmultiplier) + '*'); // by sohil sprint 3 prices change on VAT on product summary tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS AIRTIME PER MONTH COST VAT]', formatPound(monthPrice*VATmultiplier) + '*'); // by sohil sprint 3 prices change on VAT on product summary tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF UNIT PRICE]', formatPound(unitPrice)); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF UNIT PRICE]', formatPound(unitPrice)); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF QTY]', jQuery('[id^="psNoOfDevices"]').val()); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF QTY]', jQuery('[id^="psNoOfDevices"]').val()); if(jQuery('[id^="psNoOfDevices"]').hasClass('newPackageDeviceCount')){ deviceQuantity = jQuery('[id^="psNoOfDevices"]').html(); //Modified by Accenture/Vitisha as part of Bill Cap tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF QTY]', jQuery('[id^="psNoOfDevices"]').attr('value')); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF QTY]', jQuery('[id^="psNoOfDevices"]').attr('value')); } /*CFD-948 CD43226 Smartphone 2016 START*/ //PS:02/06/2017 EURegs_Yield_Project Start var euMinsTexts = ''; if(jQuery('#' + jquerySelectorQuery + '_eu_mins_texts').html() != '') euMinsTexts = '
'; tariffhtml = strReplaceAll(tariffhtml, '[PS EU TARIFF MINS TEXTS]', euMinsTexts); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS EU TARIFF MINS TEXTS]', euMinsTexts); var deviceAirTimeCost = jQuery('#' + jquerySelectorQuery +'_device-tariff-airtime-price').html(); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF DEVICE AIRTIME PRICE]', deviceAirTimeCost); tariffhtmlOld = strReplaceAll(tariffhtmlOld, '[PS TARIFF DEVICE AIRTIME PRICE]', deviceAirTimeCost); //Modified by Accenture/Vitisha as part of Billcap updateButton(jquerySelectorQuery + '_tbl-btn', 'Continue'); addRemoveButtonClickFunction('#' + jquerySelectorQuery + '_tbl-btn', 'bind', 'addTariffToPackage(this)'); var tariffs = tariffList[0]; for (var item=0, len=tariffs.length; item < len; item++) { if (tariffs[item].tariff != undefined && selectedObjId.indexOf(tariffs[item].tariff.cspmb__Price_Item_Code__c + '|' + tariffs[item].handset.Id + '|' + tariffs[item].handset.Full_upfront__c) > -1) { psSelectedTariff[tariffs[item].tariff.Id] = tariffs[item]; psSelectedTariffJSON = psSelectedTariff; psDeviceUnitPrice = tariffs[item].handset.Discount_Treshold__c; psDeviceUnitPriceVAT = ((tariffs[item].handset.Discount_Treshold__c)*VATmultiplier); var fullPrice = tariffs[item].handset.Full_Price__c; var fullPriceVAT = ((tariffs[item].handset.Full_Price__c)*VATmultiplier); var fullPriceVAT = ((tariffs[item].handset.Full_Price__c)*VATmultiplier); var fullPrice = tariffs[item].handset.Full_Price__c; if(jQuery('[id^="psNoOfDevices"]').hasClass('newPackageDeviceCount')){ var currentQuantity = parseFloat(jQuery('[id^="psNoOfDevices"]').html()); //Modified by Accenture/Vitisha as part of Bill Cap } var loanamtunit = fullPrice - psDeviceUnitPrice; var loanamtunitVAT = fullPriceVAT - psDeviceUnitPriceVAT; var loanamt = ((fullPrice - psDeviceUnitPrice) * currentQuantity ); var loanamtvat = ((fullPriceVAT - psDeviceUnitPriceVAT) * currentQuantity ) ; //tariffs[item].handset.Discounted_Price__c; pstariffitemcode = tariffs[item].handset.cspmb__Price_Item_Code__c; tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF PRICE ITEM KEY]', pstariffitemcode); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF LOAN AMOUNT]',loanamt); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF UNIT LOAN AMOUNT]',loanamtunit); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF UNIT VAT LOAN AMOUNT]',loanamtunitVAT); tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF LOAN AMOUNT VAT]',loanamtvat); if(tariffs[item].handset.Promotion_Header__c != undefined || tariffs[item].handset.Promotion_Header__c != null ) { pspromotion = tariffs[item].handset.Promotion_Header__c; var pspromotionsplit; if(pspromotion.indexOf(':#') > -1){ var promoData = pspromotion.split(':#'); pspromotionsplit = promoData[0]; } else{ pspromotionsplit = pspromotion; } pspromotionsplit = pspromotionsplit.replace("
", ""); // small biz ravi - dec 10 2020 tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF PROMOTION]', pspromotionsplit); } else{ tariffhtml = strReplaceAll(tariffhtml, 'display:none !important-promotion1', 'display:none !important'); } if(tariffs[item].handset.Promotion_Header2__c != undefined || tariffs[item].handset.Promotion_Header2__c != null ) { pspromotion1 = tariffs[item].handset.Promotion_Header2__c; if(pspromotion1.indexOf(':#') > -1) { promoData1 = pspromotion1.split(':#'); pspromotionsplit1 = promoData1[0]; } else{ pspromotionsplit1 = pspromotion1; } pspromotionsplit1 = pspromotionsplit1.replace("
", ""); // small biz ravi - dec 10 2020 tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF PROMOTION1]', pspromotionsplit1); } else { tariffhtml = strReplaceAll(tariffhtml, 'display:none !important-promotion2', 'display:none !important'); } if(tariffs[item].handset.Promotion_Header3__c != undefined || tariffs[item].handset.Promotion_Header3__c != null ) { pspromotion2 = tariffs[item].handset.Promotion_Header3__c; if(pspromotion2.indexOf(':#') > -1){ var promoData2 = pspromotion2.split(':#'); pspromotionsplit2 = promoData2[0]; } else{ pspromotionsplit2 = pspromotion2; } pspromotionsplit2 = pspromotionsplit2.replace("
", ""); // small biz ravi - dec 10 2020 tariffhtml = strReplaceAll(tariffhtml, '[PS TARIFF PROMOTION2]', pspromotionsplit2); } else { tariffhtml = strReplaceAll(tariffhtml, 'display:none !important-promotion3', 'display:none !important'); } if((tariffs[item].handset.Promotion_Header3__c == undefined || tariffs[item].handset.Promotion_Header3__c == null) && (tariffs[item].handset.Promotion_Header2__c == undefined || tariffs[item].handset.Promotion_Header2__c == null ) && (tariffs[item].handset.Promotion_Header__c == undefined || tariffs[item].handset.Promotion_Header__c == null )) tariffhtml = strReplaceAll(tariffhtml, 'display:none !important-promotion', 'display:none !important'); psCurrentPage = 'Tariff'; psCurrentPageNew = 'TariffExtra'; //added by anmol US21 } } psSelectedTariffHTML = tariffhtml; for (var item=0, len=tariffs.length; item < len; item++) { if (tariffs[item].tariff != undefined && selectedObjId.indexOf(tariffs[item].tariff.cspmb__Price_Item_Code__c + '|' + tariffs[item].handset.Id + '|' + tariffs[item].handset.Full_upfront__c) > -1) { if(tariffs[item].handset.Promotion_Header__c == undefined || tariffs[item].handset.Promotion_Header__c == null ) jQuery('#promotion1').hide(); if(tariffs[item].handset.Promotion_Header2__c == undefined || tariffs[item].handset.Promotion_Header2__c == null ) jQuery('#promotion2').hide(); if(tariffs[item].handset.Promotion_Header3__c == undefined || tariffs[item].handset.Promotion_Header3__c == null ) jQuery('#promotion3').hide(); } } selectTariffBox(jquerySelectorQuery + '_grid'); selectTariffBox(jquerySelectorQuery + '_tbl'); //Modified by Accenture/Vitisha as part of R7 if (psCurrentPage == 'Tariff') { jQuery('#next-button-upper').removeClass('buttonDisabled'); jQuery('#next-button-upper').attr('onclick', 'addPackageToBasket();'); }else{ //Modified by Accenture/Vitisha as part of Bill Cap jQuery('#next-button-tariff,#next-button-lower,#next-button-upper').removeClass('buttonDisabled'); jQuery('#next-button-tariff,#next-button-lower,#next-button-upper').attr('onclick', 'goToNextPage();'); } //Modified by Accenture/Vitisha as part of Bill Cap jQuery('.costDisplay,.costDisplayUpper,.basket-gray-text').show();// by sohil Sprint 3 refreshPackageSummary('tariff', tariffhtml); psSelectedTariffHTML = tariffhtmlOld; var data = jQuery('#' + jquerySelectorQuery + '_tbl-data').html(); /*CFD-1180 START*/ if(psSelectedDevice[Object.keys(psSelectedDevice)] != null && psSelectedDevice[Object.keys(psSelectedDevice)].productFamily != null && psSelectedDevice[Object.keys(psSelectedDevice)].productFamily.Type__c != null && psSelectedDevice[Object.keys(psSelectedDevice)].productFamily.Type__c.length > 0 && psSelectedDevice[Object.keys(psSelectedDevice)].productFamily.Type__c.toUpperCase().indexOf('PHONE') !== -1){ var rowBoltonhtml = '
'; if(rowBoltonhtml != null && rowBoltonhtml != '' && rowBoltonhtml.length > 0) jQuery('.trfDiv').append(rowBoltonhtml); } /*CFD-1180 END*/ if(sessionStorage.PricesVAT=="true") showVAT(); else hideVAT(); if(psSelectedTariff && Object.keys(psSelectedTariff).length > 0){ var keyTariff; for(key in psSelectedTariff){ keyTariff = key; break; } jQuery('input[id$=selectedTariffCode]').val(psSelectedTariff[keyTariff].tariff.cspmb__Price_Item_Code__c); jQuery('input[id$=selectedDeviceSku]').val(psSelectedTariff[keyTariff].handset.cspmb__Price_Item_Code__c); //jQuery('input[id$=selectedTariffCode]').val(Object.values(psSelectedTariff)[0].tariff.cspmb__Price_Item_Code__c); //jQuery('input[id$=selectedDeviceSku]').val(Object.values(psSelectedTariff)[0].handset.cspmb__Price_Item_Code__c); } if (psCurrentPage != 'SIMOnlyTariff') { showDefaultBoltons(true); } //Modified by Accenture/Vitisha as part of Bill Cap if(jQuery('#stockImage').hasClass('stock_red')){ $('[id$=":secondPackageSummary"] #next-button-lower,#next-button-tariff').addClass('buttonDisabled'); $('[id$=":secondPackageSummary"] #next-button-lower,#next-button-tariff').attr('onclick', ''); } if(jQuery('.accAddBtn').hasClass('buttonDisabled')){ jQuery('.accAddBtn').removeClass('buttonDisabled'); // jQuery('.accAddBtn').attr('onclick', 'addAccessoryToPackage(this)'); } //Added by Accenture/Vitisha as part of USOE_021 if(jQuery('#Wifi4GCalling').hasClass('wifiRemove')){ var wifi4gSelectedText = "Get better indoor coverage and make calls when you don’t have signal."; var wifi4gHeading = "4G and Wifi calling included"; $("#Wifi4GCalling").removeClass('wifiRemove'); $("#wifiIcon").removeClass('o2-icon-g-calling-remove'); $("#wifi4gTextHeading").text(wifi4gHeading); $("#wifi4gText").text(wifi4gSelectedText); } //added by anmol US21 - start getMobileDevicesTariff().done(function(){ loadDigitalApps(jQuery('input[id$=selectedDeviceSku]').val()); }); //added by anmol US21 - end //added by Roopakshi as a part of tariff refresh - start var listOfActiveBoltons = []; var defaultBoltonSize = 4; $(".bolton-top-item").each(function(){ if(($(this).attr('style').indexOf('display:block') > -1) || ($(this).attr('style').indexOf('display: block') > -1)){ listOfActiveBoltons.push($(this).attr('id')); } }); document.getElementById("boltonList").innerHTML = listOfActiveBoltons; document.getElementById("numberOnBoltons").innerHTML = defaultBoltonSize; if (selectedDevice.productFamily.WiFi_Calling_Compatible__c == true){ defaultBoltonSize = defaultBoltonSize - 1; if (selectedDevice.productFamily.Generation__c== '5G'){//Maha added for 5G enhancement on 9th sept 2019 defaultBoltonSize = defaultBoltonSize - 1; } document.getElementById("flagForWifi").innerHTML = 1; if (selectedDevice.productFamily.Generation__c== '5G'){//Maha added for 5G enhancement on 9th sept 2019 document.getElementById("flagForWifi").innerHTML = 2; } } else{ document.getElementById("flagForWifi").innerHTML = 0; } $("#grid-view-bolton .bolton-top-item").hide(); $(".PlusBolton").hide(); $(".MinusBolton").hide(); if(listOfActiveBoltons.length > 0){ for(var i = 0; i < listOfActiveBoltons.length; i++){ if(i < defaultBoltonSize){ $('#'+listOfActiveBoltons[i]).show(); } else{ $(".PlusBolton").show(); $('#'+listOfActiveBoltons[i]).hide(); } } } //added by Roopakshi as a part of tariff refresh - end //Added by Accenture/Vitisha as part of Bill Cap if($('#promotion1').css('display') == 'none'){ $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-95px");// small biz ravi - dec 10 2020 } if($('#capSelectedSection').hasClass('capSelected')) { $('#spendCaps').css("margin-bottom","15px"); $("#billCapEditLink,#capSelectedSection,.hideExtrasBolton,.hide_details").show(); $("#spendCapSection, #capSelectionSection, #billCapDescription").hide(); $("#spendCaps").removeClass("headerDarkBg"); $("#chooseExtra").addClass("headerDarkBg"); $("#secondSection").addClass("lightGreyBg"); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-95px"); } if($('#noCapSelectedSection').hasClass('capSelected')) { $('#spendCaps').css("margin-bottom","15px"); $("#noCapSelectedSection,#billCapEditLink,.hideExtrasBolton,.hide_details").show(); $("#spendCapSection, #capSelectionSection, #billCapDescription").hide(); $("#spendCaps").removeClass("headerDarkBg"); $("#chooseExtra").addClass("headerDarkBg"); $("#secondSection").addClass("lightGreyBg"); $('[id$=":secondPackageSummary"] .costDisplay').css("margin-top","-95px"); } //accessoryLoaded = false;//Commented by Amit SBL - dec 10 2020 navExtra.goToSection('#tariffDetailSection'); showDataRollOverSeperator(); } function removeTariffFromPackage(obj) { //added by anmol US21 if (psCurrentPage == 'Tariff' || psCurrentPageNew == 'TariffExtra') { var currentBtnId = obj.id; var removedObjId = currentBtnId.substring(0,currentBtnId.indexOf('-')); if (removedObjId.indexOf('grid') > 0) deselectTariffBox(removedObjId); else { if (removedObjId.indexOf('ps') > 0) { var removedObjId = removedObjId.substring(0,removedObjId.indexOf('_')); deselectTariffBox(removedObjId+'_grid'); deselectTariffBox(removedObjId+'_tbl'); } else deselectTariffBox(removedObjId); } removeTariff(psSelectedTariff); psSelectedTariff = {}; psSelectedTariffJSON = null; psDeviceUnitPrice = null; psSelectedTariffHTML = ''; refreshPrices('tariff'); jQuery('input[id$=selectedTariffCode]').val(''); } else { showLoadingPanel(); jQuery('input.goToTariffPage').click(); } if (psCurrentPage != 'SIMOnlyTariff') { showDefaultBoltons(true); } } function removeSIMOnlyTariffFromPackage(obj) { if (psCurrentPage == 'SIMOnlyTariff') { var currentBtnId = obj.id; var removedObjId = currentBtnId.substring(0, currentBtnId.indexOf('-')); if (removedObjId.indexOf('grid') > 0) deselectTariffBox(removedObjId); else { if (removedObjId.indexOf('ps') > 0) { var removedObjId = removedObjId.substring(0,removedObjId.indexOf('_')); deselectTariffBox(removedObjId+'_grid'); deselectTariffBox(removedObjId+'_tbl'); } else deselectTariffBox(removedObjId); } removeSIMOnlyTariff(psSelectedTariff); psSelectedTariff = {}; psSelectedTariffJSON = null; psDeviceUnitPrice = null; psSelectedTariffHTML = ''; refreshPrices('tariff'); } else { showLoadingPanel(); if(sitePageNameList.toLocaleLowerCase().indexOf('apps') > -1) jQuery('input.goToSIMOPage').click(); } /*CFD-1180 START*/ jQuery('.travelling-header').show(); jQuery('.travelling-europe-bg').show(); jQuery('.travelling-header').parent().find('h3').show(); /*CFD-1180 END*/ } function removeDeviceFromBasket() { showLoadingPanel(); jQuery('input.goToDevicesPage').click(); } function scrollToItemPS(itemSelector) { // Added by Prachi so as to stop basket from scrolling // jQuery('.rhs-basket-bottom').animate({scrollTop: jQuery(itemSelector).offset().top}); } function checkToEnableNextButton(element){ if (enableNextButtonCheck.length == 0) { jQuery('#next-button-tariff').attr('onclick', 'addPackageToBasket()'); jQuery('#next-button-tariff').removeClass('buttonDisabled'); jQuery('#next-button-lower').attr('onclick', 'addPackageToBasket()'); jQuery('#next-button-lower').removeClass('buttonDisabled'); jQuery('#next-button-upper').attr('onclick', 'addPackageToBasket()'); jQuery('#next-button-upper').removeClass('buttonDisabled'); } else enableNextButtonCheck.push(element); jQuery('a[id*="_btn"]').each(function() { jQuery(this).attr('onclick', 'checkToEnableNextButton(this)'); }); jQuery('#' + element.id).attr('onclick', ''); } function showAccPageNextStep(nextStep) { if (nextStep == 'insurance') { jQuery('#accessory_btn').unbind('click'); jQuery('#accessory_btn').addClass('buttonDisabled'); jQuery('#insurance').css({'display':'block'}); jQuery('.insuranceClassEl').css({'display':'block'}); jQuery('.insuranceHeaderClassEl').removeClass('freqBought'); jQuery('.insuranceHeaderClassEl').addClass('freqBoughtCollapse'); jQuery('#insuranceList').show(); } if (nextStep == 'bolton') { jQuery('#insurance_btn').unbind('click'); jQuery('#insurance_btn').addClass('buttonDisabled'); jQuery('#travellingAbroad').css({'display':'block'}); } } function addAccessoryToPackage(obj) { checkToEnableNextButton(obj); showAccPageNextStep('insurance'); var currentSelectedObj = obj.id; // Added by Accenture/Prachi as part of USOE_021 Start var ret = currentSelectedObj.replace('accessoryAddBtn','accessory'); jQuery('#'+ret).addClass('background-insurance'); var learn = currentSelectedObj.replace('accessoryAddBtn','learnmore_'); jQuery('#'+learn).removeClass('tariff-detail-link'); jQuery('#'+learn).addClass('learnIcon'); jQuery('#'+learn).addClass('whitetext'); // Added by Accenture/Prachi as part of USOE_021 End var selectedObjId = currentSelectedObj.substring(currentSelectedObj.indexOf('_') + 1,currentSelectedObj.length); var numberOfAccessoryToBuy= jQuery('#noOfAccessory_'+selectedObjId).html(); /*rename to remove and bind to different function*/ updateButton(obj.id, 'remove'); jQuery('#' + obj.id).attr('onclick','').unbind('click'); jQuery('#' + obj.id).attr('onclick', 'removeAccessoryToPackage(this)'); /*update*/ if (accessoriesInPS.indexOf(selectedObjId) != -1) { jQuery('#' + prodIdMap['accessory'][0] + '_' + selectedObjId).val(numberOfAccessoryToBuy); jQuery('li #' + prodIdMap['accessory'][0] + '_' + selectedObjId).last().html(numberOfAccessoryToBuy); refreshPrices('accessory'); scrollToItemPS('#' + prodIdMap['accessory'][0] + '_' + selectedObjId); selectedAccessoryList[selectedObjId].quantity = numberOfAccessoryToBuy; // Added by Accenture/Prachi as part of USOE_021 Start jQuery('#psNoOfAccessory_'+selectedObjId).html(numberOfAccessoryToBuy); jQuery('#psNoOfAccessory_'+selectedObjId).val(numberOfAccessoryToBuy); jQuery('#noOfAccessory_'+selectedObjId).val(numberOfAccessoryToBuy); jQuery('#noOfAccessory_'+selectedObjId).html(numberOfAccessoryToBuy); refreshPrices('accessory'); // Added by Accenture/Prachi as part of USOE_021 End return; } /*insert*/ var basketCounterId = prodIdMap['accessory'][1] + '_' + selectedObjId + '-basket'; var accessoryName = jQuery('#accessoryName_' + selectedObjId).html(); var accessoryDetail = jQuery('#accessoryDetail_' + selectedObjId).html(); var accessoryPrice = jQuery('#accessoryPrice_' + selectedObjId).html(); var accessoryImage = jQuery('#accessoryImg_' + selectedObjId).attr('src'); var accessoryhtml ='
'; accessoryhtml = strReplaceAll(accessoryhtml, '[PS ACCESSORY IMAGE]', accessoryImage); accessoryhtml = strReplaceAll(accessoryhtml, '[PS ACCESSORY NAME]', accessoryName); accessoryhtml = strReplaceAll(accessoryhtml, '[PS NUMBER OF ACCESSORIES]', numberOfAccessoryToBuy); var accPrice = parseFloat(accessoryPrice.match(/[0-9+\.]/g).join('')); var accNum = parseInt(numberOfAccessoryToBuy); accessoryhtml = strReplaceAll(accessoryhtml, '[PS ACCESSORY UNIT PRICE]', accPrice); accessoryhtml = strReplaceAll(accessoryhtml, '[PS ACCESSORY PRICE]', formatPound(accPrice)); var accPriceVat=accPrice*VATmultiplier; accessoryhtml = strReplaceAll(accessoryhtml, '[PS ACCESSORY PRICE VAT]', formatPound(accPriceVat.toFixed(2))); accessoryhtml = strReplaceAll(accessoryhtml, '[PS ACCESSORY SEQ NUMBER]', selectedObjId); jQuery('#psAccessoryTotalPrice_' + selectedObjId).html(); accessoriesInPS.push(selectedObjId); accsHTMLInPS.push(accessoryhtml); for (var i=0, len=psAccsAllObjects.length; i < len; i++) { if (psAccsAllObjects[i].accessory.accessoryID == selectedObjId) { accsObjInPS.push(psAccsAllObjects[i]); selectedAccessoryList[psAccsAllObjects[i].accessory.accessoryID] = psAccsAllObjects[i]; selectedAccessoryList[psAccsAllObjects[i].accessory.accessoryID].quantity = numberOfAccessoryToBuy; } } psCurrentPage = 'Accessories'; psCurrentPageNew = 'TariffExtra'; //added by anmol US21 if (accessoriesInPS.length == 1) { var accessoryhtmlObj = jQuery(accessoryhtml); // Modified by Accenture/Prachi as part of USOE_021 accessoryhtmlObj.prepend(jQuery("
")); accessoryhtml = accessoryhtmlObj; } refreshPackageSummary('accessory', accessoryhtml); // Added by Accenture/Prachi as part of USOE_021 jQuery('#psNoOfAccessory_'+selectedObjId).val(numberOfAccessoryToBuy); jQuery('#psNoOfAccessory_'+selectedObjId).html(numberOfAccessoryToBuy); jQuery('#noOfAccessory_'+selectedObjId).html(numberOfAccessoryToBuy); refreshPrices('accessory') scrollToItemPS('#' + prodIdMap['accessory'][0] + '_' + selectedObjId); if(sessionStorage.PricesVAT=="true")showVAT(); else hideVAT(); // Added by Accenture/Prachi as part of USOE_021 //jQuery('#ret').addClass('background-insurance'); // Added by Accenture/Vitisha as part Billcap $(".packageaccessory").hide(); } function removeAccessoryToPackage(obj) { var currentSelectedObj = $(obj).attr('id'); //added by anmol US21 // Added by Accenture/Prachi as part of USOE_021 Start var remove = currentSelectedObj.replace('accessoryAddBtn','accessory'); var learn = currentSelectedObj.replace('accessoryAddBtn','learnmore_'); jQuery('#'+learn).addClass('tariff-detail-link'); jQuery('#'+learn).removeClass('learnIcon'); jQuery('#'+learn).removeClass('whitetext'); // Added by Accenture/Prachi as part of USOE_021 End var selectedObjId = currentSelectedObj.substring(currentSelectedObj.indexOf('_') + 1, currentSelectedObj.length); jQuery('#accessory_' + selectedObjId + '.packageaccessory').remove(); jQuery('#accessoryRemove_' + selectedObjId).remove(); var indexToRemove = accessoriesInPS.indexOf(selectedObjId); delete selectedAccessoryList[accessoriesInPS[accessoriesInPS.indexOf(selectedObjId)]]; accessoriesInPS.splice(indexToRemove, 1); accsHTMLInPS.splice(indexToRemove, 1); accsObjInPS.splice(indexToRemove, 1); if (indexToRemove == 0 && accessoriesInPS.length >= 1) { if (jQuery('#accessory_' + accessoriesInPS[0]).children().length == 1) jQuery('#accessory_' + accessoriesInPS[0]).prepend(jQuery("")); } if(psCurrentPage == 'Accessories' || psCurrentPageNew == 'TariffExtra'){ //added by anmol US21 var accAddRemoveButton = prodIdMap['accessory'][2] + '_' + selectedObjId; updateButton(accAddRemoveButton, 'add'); jQuery('#' + accAddRemoveButton).attr('onclick', 'addAccessoryToPackage(this)'); } refreshTotals(); jQuery('#'+remove).removeClass('background-insurance'); } function getObjClassName(obj) { var selectedClassId = ''; var objClassList = $(obj).attr('class').split(' '); //added by anmol US21 for (var item=0, len=objClassList.length; item