How to solve when we uncheck the check box in the persanilization feature the selected date should delete

How to solve when we uncheck the check box in the persanilization feature the selected date should delete for this we need to add the code in the extension ands tpl file
first we need to add the data action in the tpl file
and we need to add the co0de to corresponding class or it

setLogoOption: function (e)
			{
				try {
					let pdp = this.pdp;
					let value = e.currentTarget.value;
					let itemOptions = pdp.getItemInfo().options
					let currentID = e.currentTarget.name;
					let existingItemOption = _.filter(itemOptions, function (option) {
						return option.cartOptionId == currentID;
					});
					let existingValue = existingItemOption[0].value?existingItemOption[0].value.internalid:'' ;
					setTimeout(() =>
					{
						let selectedValue = value;
						if ((existingValue == selectedValue) 
							&& (!!existingValue) 
							&& (currentID !='custcol_ag_bankpersonlizationfont') 
							&& (currentID !='custcol_ag_logolayout')
							&& (currentID !='custcol_ag_companypersonlizationfont')
							&& (currentID !='custcol_ag_companypersonlizationcolor'))  {
							pdp.setOption(currentID,'')
						}else{
							pdp.setOption(currentID,value)
							}
					}, 75);
					setTimeout(() => {
						let selectedLogoOption = this.model.get('custcol_tag_logo_option');
						if (value && value != '' && currentID === 'custcol_tag_logo_option' || selectedLogoOption && selectedLogoOption != '') {
							$(".logo-option").show();
						} else {
							$(".logo-option").hide();
							pdp.setOption('custcol_ag_logoupload', null)
						}
						e.currentTarget.checked = true;
					}, 75);
					if (currentID === 'custcol_ag_ezshield') {
						pdp.setOption('custcol_tag_eligible_for_ezshield', value);
						if (value === '1') {
							pdp.setOption('custcol_tag_ezshield_ref_item', '13970');
						}
						else if (value === '2') {
							pdp.setOption('custcol_tag_ezshield_ref_item', '');
						}
						else {
							pdp.setOption('custcol_tag_ezshield_ref_item', '');
						}
					}
					if (currentID === 'custcol_ag_logooptionselectbox') {
						pdp.setOption('custcol_tag_logo_option', value);
						if (value === '3') {
							pdp.setOption('custcol_tag_logo_option_item', '13974');
						}
						else {
							pdp.setOption('custcol_tag_logo_option_item', '');
						}
					}
					if (currentID === 'custcol_ag_companypersonlizationcolor') {
						var selectElement = document.getElementById("in-modal-custcol_ag_companypersonlizationcolor");
						var selectedValue = selectElement.value;
						if (selectedValue !== "1") {
							pdp.setOption('custcol_tag_logo_option_item', '13974');
						}
						else if (value === "3") {
							pdp.setOption('custcol_tag_logo_option_item', '13974');
						}
					}
					} catch (error)
					{
						console.log('Error:', error);
					}
			},
showLogoOptionPersonalization: function showLogoOptionPersonalization() {
				var checkValue = document.getElementById("personalized-logo-checkbox").checked ? true : false;
				var self = this;
				if (checkValue) {
					$('.pdp-configurator-logo-block').show();
				}
				else {
					$('.pdp-configurator-logo-block').hide();
					$('#custcol_ag_logooptionselectbox-dataid').val('no');
					$('.msgafteruploadfield').hide();
					$('#fileuploadfield').val('');
					
					
					
				}

			},

Leave a comment

Your email address will not be published. Required fields are marked *