September 28, 2022
#html-body [data-pb-style=WJ0WVEK]{justify-content:flex-start;display:flex;flex-direction:column;background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}
Exercising when wearing glasses can be an unpleasant experience. It can feel uncomfortable, create potential safety issues and really affect the quality of your workout.
If you experience problems with your glasses steaming up, slipping down your nose, or falling off completely, then read on. We have put together some helpful tips that will make exercising when wearing glasses a whole lot easier.
Wear Sports Glasses
.product-items .glide__slide {
max-width: calc((100% - 30px)/4);
margin-left: 5px;
margin-right: 5px;
}
@media (max-width: 1280px) {
.product-items .glide__slide {
max-width: calc(100% /3);
}
}
@media (max-width: 1024px) {
.product-items .glide__slide {
max-width: calc(100%/2);
}
}
@media (max-width: 740px) {
.product-items .glide__slide {
max-width: calc(10/11*100%);
}
}
Eligible for Speedy Shipping:
This product qualifies for our Speedy Shipping service! Your order will be sent via Royal Mail Tracked 48hr, ensuring quick and reliable delivery straight to your door.
Coach CFU05 Prescription Sunglasses
function initPriceBox__6a6510c139078()
{
return {
additionalPriceElement : document.querySelector('#regular-price_' + 157942),
regularPrice : 97,
updatePrice(priceData) {
const regularPriceLabel = this.$root.querySelector('.normal-price .price-label');
const regularPriceElement = this.$root.querySelector('.normal-price [data-price-type=finalPrice].price-wrapper .price');
const basePriceElement = this.$root.querySelector('.normal-price [data-price-type=basePrice].price-wrapper .price');
if (regularPriceLabel) {
if (priceData.finalPrice.amount < priceData.oldPrice.amount) {
regularPriceLabel.classList.add('hidden');
} else {
regularPriceLabel.classList.remove('hidden');
}
}
regularPriceElement.innerText = hyva.formatPrice(priceData.finalPrice.amount);
basePriceElement && (basePriceElement.innerText = hyva.formatPrice(priceData.basePrice.amount));
if (this.additionalPriceElement) {
if (priceData.finalPrice.amount === this.regularPrice) {
this.additionalPriceElement.classList.add('hidden');
} else if (priceData.finalPrice.amount < this.regularPrice) {
this.additionalPriceElement.classList.remove('hidden');
}
}
}
}
}
function initConfigurableSwatchOptions_157942() {
const configurableOptionsComponent = initConfigurableOptions(
'157942',
{"attributes":{"93":{"id":"93","code":"color","label":"Colour","options":[{"id":"15356","label":"Gold1","products":["156468"]}],"position":"0"},"156":{"id":"156","code":"a01_size_option","label":"Size Option","options":[{"id":"1598","label":"58-16-140","products":["156468"]}],"position":"1"}},"template":"\u00a3","currencyFormat":"\u00a3%s","optionPrices":{"156468":{"baseOldPrice":{"amount":80.833333333333},"oldPrice":{"amount":97},"basePrice":{"amount":80.833333333333},"finalPrice":{"amount":97},"tierPrices":[],"msrpPrice":{"amount":0}}},"priceFormat":{"pattern":"\u00a3%s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":false},"prices":{"baseOldPrice":{"amount":80.833333333333},"oldPrice":{"amount":97},"basePrice":{"amount":80.833333333333},"finalPrice":{"amount":97}},"productId":"157942","chooseText":"Choose an Option...","images":[],"index":{"156468":{"93":"15356","156":"1598"}},"salable":[],"canDisplayShowOutOfStockStatus":false,"preSelectedGallery":[],"supplier_colour_data":{"colour_attribute_id":93,"mapping":{"156468":"Gold"}},"additional_product_data":{"configurable":{"id":"157942","sku":"HC7194","custom_options":null},"simples":{"156468":{"sku":"HC7194-9005I7-58-16-140"}}}} );
const swatchOptionsComponent = initSwatchOptions({"93":{"15356":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/g\/o\/gold_57.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/g\/o\/gold_57.png","label":"Gold1"},"additional_data":"{\"swatch_input_type\":\"visual\",\"update_product_preview_image\":\"1\",\"use_product_image_for_swatch\":\"0\"}"}});
return Object.assign(
configurableOptionsComponent,
swatchOptionsComponent,
{
mediaCallback: "https\u003A\u002F\u002Fwww.spex4less.com\u002Fswatches\u002Fajax\u002Fmedia\u002F",
changeOption(optionId, value, skipUpdateGallery) {
if (value === '') {
this.selectedValues = this.removeAttrFromSelection(this.selectedValues, optionId)
} else {
this.selectedValues[optionId] = value;
}
this.findSimpleIndex();
this.findAllowedAttributeOptions();
this.updatePrices();
!skipUpdateGallery && this.updateGallery();
let candidates = this.findProductIdsForPartialSelection(this.selectedValues);
window.dispatchEvent(new CustomEvent('listing-configurable-selection-changed', {
detail: {
productId: this.productId,
optionId,
value,
productIndex: this.productIndex,
selectedValues: this.selectedValues,
candidates: candidates,
skuCandidates: this.optionConfig.sku ? Object.values(candidates).map(id => this.optionConfig.sku[id]) : [],
}
}));
},
updateGallery() {
if (!this.productIndex) {
return;
}
fetch(`${this.mediaCallback}?product_id=${this.productIndex}&parent_id=${this.productId}&isAjax=true`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
}
).then(response => {
return response.json()
}
).then(data => {
if (data.errors) {
// non critical failure only console logged
console.warn(data.errors);
} else {
const image = data && data.medium;
image && window.dispatchEvent(
new CustomEvent(
"update-gallery-157942",
{detail: image}
)
);
}
}).catch(error => {
console.warn(error)
});
},
preselectQuerystringItems() {
// pre-select option like ?size=167
const urlQueryParams = new URLSearchParams(window.location.search.replace('?', ''));
Object.values(this.optionConfig.attributes).map(attribute => {
// Don't update images on load, since PLPs already set the main image to the selected options
const skipUpdateGallery = true;
urlQueryParams.get(attribute.code) &&
this.changeOption(attribute.id, urlQueryParams.get(attribute.code), skipUpdateGallery);
});
},
mouseDown: false,
startX: 0,
maxScroll: 0,
scrollLeft: null,
slider: null,
scrollEvents: {
['@mousedown'](e) {
this.slider = e.target.closest('.snap');
if (!this.slider) {
return;
}
this.maxScroll = this.slider.scrollWidth - this.slider.offsetWidth;
this.startX = e.pageX - this.slider.offsetLeft;
this.scrollLeft = this.slider.scrollLeft;
this.mouseDown = true;
},
['@mouseout.self']() {
this.mouseDown = false;
},
['@mouseup']() {
this.mouseDown = false;
},
['@mousemove'](e) {
e.preventDefault();
if (!this.mouseDown) {
return;
}
const x = e.pageX - this.slider.offsetLeft;
const scroll = x - this.startX;
const scrollLeft = this.scrollLeft - scroll;
if (scrollLeft > this.maxScroll) {
this.slider.scrollLeft = this.maxScroll;
return
}
this.slider.scrollLeft = this.scrollLeft - scroll;
},
['@onselectstart']() {
return false;
}
},
resizeEvent() {
Array.from(this.$root.querySelectorAll('.snap')).forEach(slider => {
slider.scrollLeft = 0;
})
}
}
);
}
As low as
£97.00
Coach HC6302U Glasses
function initPriceBox__6a6510c14bf3e()
{
return {
additionalPriceElement : document.querySelector('#regular-price_' + 157931),
regularPrice : 89,
updatePrice(priceData) {
const regularPriceLabel = this.$root.querySelector('.normal-price .price-label');
const regularPriceElement = this.$root.querySelector('.normal-price [data-price-type=finalPrice].price-wrapper .price');
const basePriceElement = this.$root.querySelector('.normal-price [data-price-type=basePrice].price-wrapper .price');
if (regularPriceLabel) {
if (priceData.finalPrice.amount < priceData.oldPrice.amount) {
regularPriceLabel.classList.add('hidden');
} else {
regularPriceLabel.classList.remove('hidden');
}
}
regularPriceElement.innerText = hyva.formatPrice(priceData.finalPrice.amount);
basePriceElement && (basePriceElement.innerText = hyva.formatPrice(priceData.basePrice.amount));
if (this.additionalPriceElement) {
if (priceData.finalPrice.amount === this.regularPrice) {
this.additionalPriceElement.classList.add('hidden');
} else if (priceData.finalPrice.amount < this.regularPrice) {
this.additionalPriceElement.classList.remove('hidden');
}
}
}
}
}
function initConfigurableSwatchOptions_157931() {
const configurableOptionsComponent = initConfigurableOptions(
'157931',
{"attributes":{"93":{"id":"93","code":"color","label":"Colour","options":[{"id":"15355","label":"Brown1","products":["156411"]}],"position":"0"},"156":{"id":"156","code":"a01_size_option","label":"Size Option","options":[{"id":"1105","label":"54-17-145","products":["156411"]}],"position":"1"}},"template":"\u00a3","currencyFormat":"\u00a3%s","optionPrices":{"156411":{"baseOldPrice":{"amount":74.166666666667},"oldPrice":{"amount":89},"basePrice":{"amount":74.166666666667},"finalPrice":{"amount":89},"tierPrices":[],"msrpPrice":{"amount":0}}},"priceFormat":{"pattern":"\u00a3%s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":false},"prices":{"baseOldPrice":{"amount":74.166666666667},"oldPrice":{"amount":89},"basePrice":{"amount":74.166666666667},"finalPrice":{"amount":89}},"productId":"157931","chooseText":"Choose an Option...","images":[],"index":{"156411":{"93":"15355","156":"1105"}},"salable":[],"canDisplayShowOutOfStockStatus":false,"preSelectedGallery":[],"supplier_colour_data":{"colour_attribute_id":93,"mapping":{"156411":"Brown"}},"additional_product_data":{"configurable":{"id":"157931","sku":"HC6302U","custom_options":null},"simples":{"156411":{"sku":"HC6302U-5968-54-17-145"}}}} );
const swatchOptionsComponent = initSwatchOptions({"93":{"15355":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/b\/r\/brown_18.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/b\/r\/brown_18.png","label":"Brown1"},"additional_data":"{\"swatch_input_type\":\"visual\",\"update_product_preview_image\":\"1\",\"use_product_image_for_swatch\":\"0\"}"}});
return Object.assign(
configurableOptionsComponent,
swatchOptionsComponent,
{
mediaCallback: "https\u003A\u002F\u002Fwww.spex4less.com\u002Fswatches\u002Fajax\u002Fmedia\u002F",
changeOption(optionId, value, skipUpdateGallery) {
if (value === '') {
this.selectedValues = this.removeAttrFromSelection(this.selectedValues, optionId)
} else {
this.selectedValues[optionId] = value;
}
this.findSimpleIndex();
this.findAllowedAttributeOptions();
this.updatePrices();
!skipUpdateGallery && this.updateGallery();
let candidates = this.findProductIdsForPartialSelection(this.selectedValues);
window.dispatchEvent(new CustomEvent('listing-configurable-selection-changed', {
detail: {
productId: this.productId,
optionId,
value,
productIndex: this.productIndex,
selectedValues: this.selectedValues,
candidates: candidates,
skuCandidates: this.optionConfig.sku ? Object.values(candidates).map(id => this.optionConfig.sku[id]) : [],
}
}));
},
updateGallery() {
if (!this.productIndex) {
return;
}
fetch(`${this.mediaCallback}?product_id=${this.productIndex}&parent_id=${this.productId}&isAjax=true`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
}
).then(response => {
return response.json()
}
).then(data => {
if (data.errors) {
// non critical failure only console logged
console.warn(data.errors);
} else {
const image = data && data.medium;
image && window.dispatchEvent(
new CustomEvent(
"update-gallery-157931",
{detail: image}
)
);
}
}).catch(error => {
console.warn(error)
});
},
preselectQuerystringItems() {
// pre-select option like ?size=167
const urlQueryParams = new URLSearchParams(window.location.search.replace('?', ''));
Object.values(this.optionConfig.attributes).map(attribute => {
// Don't update images on load, since PLPs already set the main image to the selected options
const skipUpdateGallery = true;
urlQueryParams.get(attribute.code) &&
this.changeOption(attribute.id, urlQueryParams.get(attribute.code), skipUpdateGallery);
});
},
mouseDown: false,
startX: 0,
maxScroll: 0,
scrollLeft: null,
slider: null,
scrollEvents: {
['@mousedown'](e) {
this.slider = e.target.closest('.snap');
if (!this.slider) {
return;
}
this.maxScroll = this.slider.scrollWidth - this.slider.offsetWidth;
this.startX = e.pageX - this.slider.offsetLeft;
this.scrollLeft = this.slider.scrollLeft;
this.mouseDown = true;
},
['@mouseout.self']() {
this.mouseDown = false;
},
['@mouseup']() {
this.mouseDown = false;
},
['@mousemove'](e) {
e.preventDefault();
if (!this.mouseDown) {
return;
}
const x = e.pageX - this.slider.offsetLeft;
const scroll = x - this.startX;
const scrollLeft = this.scrollLeft - scroll;
if (scrollLeft > this.maxScroll) {
this.slider.scrollLeft = this.maxScroll;
return
}
this.slider.scrollLeft = this.scrollLeft - scroll;
},
['@onselectstart']() {
return false;
}
},
resizeEvent() {
Array.from(this.$root.querySelectorAll('.snap')).forEach(slider => {
slider.scrollLeft = 0;
})
}
}
);
}
As low as
£89.00
Coach HC5211 Glasses
function initPriceBox__6a6510c1514f4()
{
return {
additionalPriceElement : document.querySelector('#regular-price_' + 157923),
regularPrice : 96,
updatePrice(priceData) {
const regularPriceLabel = this.$root.querySelector('.normal-price .price-label');
const regularPriceElement = this.$root.querySelector('.normal-price [data-price-type=finalPrice].price-wrapper .price');
const basePriceElement = this.$root.querySelector('.normal-price [data-price-type=basePrice].price-wrapper .price');
if (regularPriceLabel) {
if (priceData.finalPrice.amount < priceData.oldPrice.amount) {
regularPriceLabel.classList.add('hidden');
} else {
regularPriceLabel.classList.remove('hidden');
}
}
regularPriceElement.innerText = hyva.formatPrice(priceData.finalPrice.amount);
basePriceElement && (basePriceElement.innerText = hyva.formatPrice(priceData.basePrice.amount));
if (this.additionalPriceElement) {
if (priceData.finalPrice.amount === this.regularPrice) {
this.additionalPriceElement.classList.add('hidden');
} else if (priceData.finalPrice.amount < this.regularPrice) {
this.additionalPriceElement.classList.remove('hidden');
}
}
}
}
}
function initConfigurableSwatchOptions_157923() {
const configurableOptionsComponent = initConfigurableOptions(
'157923',
{"attributes":{"93":{"id":"93","code":"color","label":"Colour","options":[{"id":"15356","label":"Gold1","products":["156358"]}],"position":"0"},"156":{"id":"156","code":"a01_size_option","label":"Size Option","options":[{"id":"406","label":"53-19-145","products":["156358"]}],"position":"1"}},"template":"\u00a3","currencyFormat":"\u00a3%s","optionPrices":{"156358":{"baseOldPrice":{"amount":80},"oldPrice":{"amount":96},"basePrice":{"amount":80},"finalPrice":{"amount":96},"tierPrices":[],"msrpPrice":{"amount":0}}},"priceFormat":{"pattern":"\u00a3%s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":false},"prices":{"baseOldPrice":{"amount":80},"oldPrice":{"amount":96},"basePrice":{"amount":80},"finalPrice":{"amount":96}},"productId":"157923","chooseText":"Choose an Option...","images":[],"index":{"156358":{"93":"15356","156":"406"}},"salable":[],"canDisplayShowOutOfStockStatus":false,"preSelectedGallery":[],"supplier_colour_data":{"colour_attribute_id":93,"mapping":{"156358":"Gold"}},"additional_product_data":{"configurable":{"id":"157923","sku":"HC5211","custom_options":null},"simples":{"156358":{"sku":"HC5211-9492-53-19-145"}}}} );
const swatchOptionsComponent = initSwatchOptions({"93":{"15356":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/g\/o\/gold_57.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/g\/o\/gold_57.png","label":"Gold1"},"additional_data":"{\"swatch_input_type\":\"visual\",\"update_product_preview_image\":\"1\",\"use_product_image_for_swatch\":\"0\"}"}});
return Object.assign(
configurableOptionsComponent,
swatchOptionsComponent,
{
mediaCallback: "https\u003A\u002F\u002Fwww.spex4less.com\u002Fswatches\u002Fajax\u002Fmedia\u002F",
changeOption(optionId, value, skipUpdateGallery) {
if (value === '') {
this.selectedValues = this.removeAttrFromSelection(this.selectedValues, optionId)
} else {
this.selectedValues[optionId] = value;
}
this.findSimpleIndex();
this.findAllowedAttributeOptions();
this.updatePrices();
!skipUpdateGallery && this.updateGallery();
let candidates = this.findProductIdsForPartialSelection(this.selectedValues);
window.dispatchEvent(new CustomEvent('listing-configurable-selection-changed', {
detail: {
productId: this.productId,
optionId,
value,
productIndex: this.productIndex,
selectedValues: this.selectedValues,
candidates: candidates,
skuCandidates: this.optionConfig.sku ? Object.values(candidates).map(id => this.optionConfig.sku[id]) : [],
}
}));
},
updateGallery() {
if (!this.productIndex) {
return;
}
fetch(`${this.mediaCallback}?product_id=${this.productIndex}&parent_id=${this.productId}&isAjax=true`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
}
).then(response => {
return response.json()
}
).then(data => {
if (data.errors) {
// non critical failure only console logged
console.warn(data.errors);
} else {
const image = data && data.medium;
image && window.dispatchEvent(
new CustomEvent(
"update-gallery-157923",
{detail: image}
)
);
}
}).catch(error => {
console.warn(error)
});
},
preselectQuerystringItems() {
// pre-select option like ?size=167
const urlQueryParams = new URLSearchParams(window.location.search.replace('?', ''));
Object.values(this.optionConfig.attributes).map(attribute => {
// Don't update images on load, since PLPs already set the main image to the selected options
const skipUpdateGallery = true;
urlQueryParams.get(attribute.code) &&
this.changeOption(attribute.id, urlQueryParams.get(attribute.code), skipUpdateGallery);
});
},
mouseDown: false,
startX: 0,
maxScroll: 0,
scrollLeft: null,
slider: null,
scrollEvents: {
['@mousedown'](e) {
this.slider = e.target.closest('.snap');
if (!this.slider) {
return;
}
this.maxScroll = this.slider.scrollWidth - this.slider.offsetWidth;
this.startX = e.pageX - this.slider.offsetLeft;
this.scrollLeft = this.slider.scrollLeft;
this.mouseDown = true;
},
['@mouseout.self']() {
this.mouseDown = false;
},
['@mouseup']() {
this.mouseDown = false;
},
['@mousemove'](e) {
e.preventDefault();
if (!this.mouseDown) {
return;
}
const x = e.pageX - this.slider.offsetLeft;
const scroll = x - this.startX;
const scrollLeft = this.scrollLeft - scroll;
if (scrollLeft > this.maxScroll) {
this.slider.scrollLeft = this.maxScroll;
return
}
this.slider.scrollLeft = this.scrollLeft - scroll;
},
['@onselectstart']() {
return false;
}
},
resizeEvent() {
Array.from(this.$root.querySelectorAll('.snap')).forEach(slider => {
slider.scrollLeft = 0;
})
}
}
);
}
As low as
£96.00
Coach HC5209 Glasses
function initPriceBox__6a6510c1563ba()
{
return {
additionalPriceElement : document.querySelector('#regular-price_' + 157921),
regularPrice : 99,
updatePrice(priceData) {
const regularPriceLabel = this.$root.querySelector('.normal-price .price-label');
const regularPriceElement = this.$root.querySelector('.normal-price [data-price-type=finalPrice].price-wrapper .price');
const basePriceElement = this.$root.querySelector('.normal-price [data-price-type=basePrice].price-wrapper .price');
if (regularPriceLabel) {
if (priceData.finalPrice.amount < priceData.oldPrice.amount) {
regularPriceLabel.classList.add('hidden');
} else {
regularPriceLabel.classList.remove('hidden');
}
}
regularPriceElement.innerText = hyva.formatPrice(priceData.finalPrice.amount);
basePriceElement && (basePriceElement.innerText = hyva.formatPrice(priceData.basePrice.amount));
if (this.additionalPriceElement) {
if (priceData.finalPrice.amount === this.regularPrice) {
this.additionalPriceElement.classList.add('hidden');
} else if (priceData.finalPrice.amount < this.regularPrice) {
this.additionalPriceElement.classList.remove('hidden');
}
}
}
}
}
function initConfigurableSwatchOptions_157921() {
const configurableOptionsComponent = initConfigurableOptions(
'157921',
{"attributes":{"93":{"id":"93","code":"color","label":"Colour","options":[{"id":"15356","label":"Gold1","products":["156351"]}],"position":"0"},"156":{"id":"156","code":"a01_size_option","label":"Size Option","options":[{"id":"251","label":"49-19-140","products":["156351"]}],"position":"1"}},"template":"\u00a3","currencyFormat":"\u00a3%s","optionPrices":{"156351":{"baseOldPrice":{"amount":82.5},"oldPrice":{"amount":99},"basePrice":{"amount":82.5},"finalPrice":{"amount":99},"tierPrices":[],"msrpPrice":{"amount":0}}},"priceFormat":{"pattern":"\u00a3%s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":false},"prices":{"baseOldPrice":{"amount":82.5},"oldPrice":{"amount":99},"basePrice":{"amount":82.5},"finalPrice":{"amount":99}},"productId":"157921","chooseText":"Choose an Option...","images":[],"index":{"156351":{"93":"15356","156":"251"}},"salable":[],"canDisplayShowOutOfStockStatus":false,"preSelectedGallery":[],"supplier_colour_data":{"colour_attribute_id":93,"mapping":{"156351":"Gold"}},"additional_product_data":{"configurable":{"id":"157921","sku":"HC5209","custom_options":null},"simples":{"156351":{"sku":"HC5209-9407-49-19-140"}}}} );
const swatchOptionsComponent = initSwatchOptions({"93":{"15356":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/g\/o\/gold_57.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/g\/o\/gold_57.png","label":"Gold1"},"additional_data":"{\"swatch_input_type\":\"visual\",\"update_product_preview_image\":\"1\",\"use_product_image_for_swatch\":\"0\"}"}});
return Object.assign(
configurableOptionsComponent,
swatchOptionsComponent,
{
mediaCallback: "https\u003A\u002F\u002Fwww.spex4less.com\u002Fswatches\u002Fajax\u002Fmedia\u002F",
changeOption(optionId, value, skipUpdateGallery) {
if (value === '') {
this.selectedValues = this.removeAttrFromSelection(this.selectedValues, optionId)
} else {
this.selectedValues[optionId] = value;
}
this.findSimpleIndex();
this.findAllowedAttributeOptions();
this.updatePrices();
!skipUpdateGallery && this.updateGallery();
let candidates = this.findProductIdsForPartialSelection(this.selectedValues);
window.dispatchEvent(new CustomEvent('listing-configurable-selection-changed', {
detail: {
productId: this.productId,
optionId,
value,
productIndex: this.productIndex,
selectedValues: this.selectedValues,
candidates: candidates,
skuCandidates: this.optionConfig.sku ? Object.values(candidates).map(id => this.optionConfig.sku[id]) : [],
}
}));
},
updateGallery() {
if (!this.productIndex) {
return;
}
fetch(`${this.mediaCallback}?product_id=${this.productIndex}&parent_id=${this.productId}&isAjax=true`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
}
).then(response => {
return response.json()
}
).then(data => {
if (data.errors) {
// non critical failure only console logged
console.warn(data.errors);
} else {
const image = data && data.medium;
image && window.dispatchEvent(
new CustomEvent(
"update-gallery-157921",
{detail: image}
)
);
}
}).catch(error => {
console.warn(error)
});
},
preselectQuerystringItems() {
// pre-select option like ?size=167
const urlQueryParams = new URLSearchParams(window.location.search.replace('?', ''));
Object.values(this.optionConfig.attributes).map(attribute => {
// Don't update images on load, since PLPs already set the main image to the selected options
const skipUpdateGallery = true;
urlQueryParams.get(attribute.code) &&
this.changeOption(attribute.id, urlQueryParams.get(attribute.code), skipUpdateGallery);
});
},
mouseDown: false,
startX: 0,
maxScroll: 0,
scrollLeft: null,
slider: null,
scrollEvents: {
['@mousedown'](e) {
this.slider = e.target.closest('.snap');
if (!this.slider) {
return;
}
this.maxScroll = this.slider.scrollWidth - this.slider.offsetWidth;
this.startX = e.pageX - this.slider.offsetLeft;
this.scrollLeft = this.slider.scrollLeft;
this.mouseDown = true;
},
['@mouseout.self']() {
this.mouseDown = false;
},
['@mouseup']() {
this.mouseDown = false;
},
['@mousemove'](e) {
e.preventDefault();
if (!this.mouseDown) {
return;
}
const x = e.pageX - this.slider.offsetLeft;
const scroll = x - this.startX;
const scrollLeft = this.scrollLeft - scroll;
if (scrollLeft > this.maxScroll) {
this.slider.scrollLeft = this.maxScroll;
return
}
this.slider.scrollLeft = this.scrollLeft - scroll;
},
['@onselectstart']() {
return false;
}
},
resizeEvent() {
Array.from(this.$root.querySelectorAll('.snap')).forEach(slider => {
slider.scrollLeft = 0;
})
}
}
);
}
As low as
£99.00
Emporio Armani EA4282U Prescription Sunglasses
function initPriceBox__6a6510c15adaa()
{
return {
additionalPriceElement : document.querySelector('#regular-price_' + 157910),
regularPrice : 129,
updatePrice(priceData) {
const regularPriceLabel = this.$root.querySelector('.normal-price .price-label');
const regularPriceElement = this.$root.querySelector('.normal-price [data-price-type=finalPrice].price-wrapper .price');
const basePriceElement = this.$root.querySelector('.normal-price [data-price-type=basePrice].price-wrapper .price');
if (regularPriceLabel) {
if (priceData.finalPrice.amount < priceData.oldPrice.amount) {
regularPriceLabel.classList.add('hidden');
} else {
regularPriceLabel.classList.remove('hidden');
}
}
regularPriceElement.innerText = hyva.formatPrice(priceData.finalPrice.amount);
basePriceElement && (basePriceElement.innerText = hyva.formatPrice(priceData.basePrice.amount));
if (this.additionalPriceElement) {
if (priceData.finalPrice.amount === this.regularPrice) {
this.additionalPriceElement.classList.add('hidden');
} else if (priceData.finalPrice.amount < this.regularPrice) {
this.additionalPriceElement.classList.remove('hidden');
}
}
}
}
}
function initConfigurableSwatchOptions_157910() {
const configurableOptionsComponent = initConfigurableOptions(
'157910',
{"attributes":{"93":{"id":"93","code":"color","label":"Colour","options":[{"id":"15355","label":"Brown1","products":["156292"]}],"position":"0"},"156":{"id":"156","code":"a01_size_option","label":"Size Option","options":[{"id":"3471","label":"54-20-145","products":["156292"]}],"position":"1"}},"template":"\u00a3","currencyFormat":"\u00a3%s","optionPrices":{"156292":{"baseOldPrice":{"amount":107.5},"oldPrice":{"amount":129},"basePrice":{"amount":107.5},"finalPrice":{"amount":129},"tierPrices":[],"msrpPrice":{"amount":0}}},"priceFormat":{"pattern":"\u00a3%s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":false},"prices":{"baseOldPrice":{"amount":107.5},"oldPrice":{"amount":129},"basePrice":{"amount":107.5},"finalPrice":{"amount":129}},"productId":"157910","chooseText":"Choose an Option...","images":[],"index":{"156292":{"93":"15355","156":"3471"}},"salable":[],"canDisplayShowOutOfStockStatus":false,"preSelectedGallery":[],"supplier_colour_data":{"colour_attribute_id":93,"mapping":{"156292":"Brown"}},"additional_product_data":{"configurable":{"id":"157910","sku":"EA4282U","custom_options":null},"simples":{"156292":{"sku":"EA4282U-59939A-54-20-145"}}}} );
const swatchOptionsComponent = initSwatchOptions({"93":{"15355":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/b\/r\/brown_18.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/b\/r\/brown_18.png","label":"Brown1"},"additional_data":"{\"swatch_input_type\":\"visual\",\"update_product_preview_image\":\"1\",\"use_product_image_for_swatch\":\"0\"}"}});
return Object.assign(
configurableOptionsComponent,
swatchOptionsComponent,
{
mediaCallback: "https\u003A\u002F\u002Fwww.spex4less.com\u002Fswatches\u002Fajax\u002Fmedia\u002F",
changeOption(optionId, value, skipUpdateGallery) {
if (value === '') {
this.selectedValues = this.removeAttrFromSelection(this.selectedValues, optionId)
} else {
this.selectedValues[optionId] = value;
}
this.findSimpleIndex();
this.findAllowedAttributeOptions();
this.updatePrices();
!skipUpdateGallery && this.updateGallery();
let candidates = this.findProductIdsForPartialSelection(this.selectedValues);
window.dispatchEvent(new CustomEvent('listing-configurable-selection-changed', {
detail: {
productId: this.productId,
optionId,
value,
productIndex: this.productIndex,
selectedValues: this.selectedValues,
candidates: candidates,
skuCandidates: this.optionConfig.sku ? Object.values(candidates).map(id => this.optionConfig.sku[id]) : [],
}
}));
},
updateGallery() {
if (!this.productIndex) {
return;
}
fetch(`${this.mediaCallback}?product_id=${this.productIndex}&parent_id=${this.productId}&isAjax=true`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
}
).then(response => {
return response.json()
}
).then(data => {
if (data.errors) {
// non critical failure only console logged
console.warn(data.errors);
} else {
const image = data && data.medium;
image && window.dispatchEvent(
new CustomEvent(
"update-gallery-157910",
{detail: image}
)
);
}
}).catch(error => {
console.warn(error)
});
},
preselectQuerystringItems() {
// pre-select option like ?size=167
const urlQueryParams = new URLSearchParams(window.location.search.replace('?', ''));
Object.values(this.optionConfig.attributes).map(attribute => {
// Don't update images on load, since PLPs already set the main image to the selected options
const skipUpdateGallery = true;
urlQueryParams.get(attribute.code) &&
this.changeOption(attribute.id, urlQueryParams.get(attribute.code), skipUpdateGallery);
});
},
mouseDown: false,
startX: 0,
maxScroll: 0,
scrollLeft: null,
slider: null,
scrollEvents: {
['@mousedown'](e) {
this.slider = e.target.closest('.snap');
if (!this.slider) {
return;
}
this.maxScroll = this.slider.scrollWidth - this.slider.offsetWidth;
this.startX = e.pageX - this.slider.offsetLeft;
this.scrollLeft = this.slider.scrollLeft;
this.mouseDown = true;
},
['@mouseout.self']() {
this.mouseDown = false;
},
['@mouseup']() {
this.mouseDown = false;
},
['@mousemove'](e) {
e.preventDefault();
if (!this.mouseDown) {
return;
}
const x = e.pageX - this.slider.offsetLeft;
const scroll = x - this.startX;
const scrollLeft = this.scrollLeft - scroll;
if (scrollLeft > this.maxScroll) {
this.slider.scrollLeft = this.maxScroll;
return
}
this.slider.scrollLeft = this.scrollLeft - scroll;
},
['@onselectstart']() {
return false;
}
},
resizeEvent() {
Array.from(this.$root.querySelectorAll('.snap')).forEach(slider => {
slider.scrollLeft = 0;
})
}
}
);
}
As low as
£129.00
Emporio Armani EA4281U Prescription Sunglasses
function initPriceBox__6a6510c160a5b()
{
return {
additionalPriceElement : document.querySelector('#regular-price_' + 157909),
regularPrice : 118,
updatePrice(priceData) {
const regularPriceLabel = this.$root.querySelector('.normal-price .price-label');
const regularPriceElement = this.$root.querySelector('.normal-price [data-price-type=finalPrice].price-wrapper .price');
const basePriceElement = this.$root.querySelector('.normal-price [data-price-type=basePrice].price-wrapper .price');
if (regularPriceLabel) {
if (priceData.finalPrice.amount < priceData.oldPrice.amount) {
regularPriceLabel.classList.add('hidden');
} else {
regularPriceLabel.classList.remove('hidden');
}
}
regularPriceElement.innerText = hyva.formatPrice(priceData.finalPrice.amount);
basePriceElement && (basePriceElement.innerText = hyva.formatPrice(priceData.basePrice.amount));
if (this.additionalPriceElement) {
if (priceData.finalPrice.amount === this.regularPrice) {
this.additionalPriceElement.classList.add('hidden');
} else if (priceData.finalPrice.amount < this.regularPrice) {
this.additionalPriceElement.classList.remove('hidden');
}
}
}
}
}
function initConfigurableSwatchOptions_157909() {
const configurableOptionsComponent = initConfigurableOptions(
'157909',
{"attributes":{"93":{"id":"93","code":"color","label":"Colour","options":[{"id":"15355","label":"Brown1","products":["156287"]}],"position":"0"},"156":{"id":"156","code":"a01_size_option","label":"Size Option","options":[{"id":"108","label":"52-18-140","products":["156287"]}],"position":"1"}},"template":"\u00a3","currencyFormat":"\u00a3%s","optionPrices":{"156287":{"baseOldPrice":{"amount":98.333333333333},"oldPrice":{"amount":118},"basePrice":{"amount":98.333333333333},"finalPrice":{"amount":118},"tierPrices":[],"msrpPrice":{"amount":0}}},"priceFormat":{"pattern":"\u00a3%s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":false},"prices":{"baseOldPrice":{"amount":98.333333333333},"oldPrice":{"amount":118},"basePrice":{"amount":98.333333333333},"finalPrice":{"amount":118}},"productId":"157909","chooseText":"Choose an Option...","images":[],"index":{"156287":{"93":"15355","156":"108"}},"salable":[],"canDisplayShowOutOfStockStatus":false,"preSelectedGallery":[],"supplier_colour_data":{"colour_attribute_id":93,"mapping":{"156287":"Brown"}},"additional_product_data":{"configurable":{"id":"157909","sku":"EA4281U","custom_options":null},"simples":{"156287":{"sku":"EA4281U-64556G-52-18-140"}}}} );
const swatchOptionsComponent = initSwatchOptions({"93":{"15355":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/b\/r\/brown_18.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/b\/r\/brown_18.png","label":"Brown1"},"additional_data":"{\"swatch_input_type\":\"visual\",\"update_product_preview_image\":\"1\",\"use_product_image_for_swatch\":\"0\"}"}});
return Object.assign(
configurableOptionsComponent,
swatchOptionsComponent,
{
mediaCallback: "https\u003A\u002F\u002Fwww.spex4less.com\u002Fswatches\u002Fajax\u002Fmedia\u002F",
changeOption(optionId, value, skipUpdateGallery) {
if (value === '') {
this.selectedValues = this.removeAttrFromSelection(this.selectedValues, optionId)
} else {
this.selectedValues[optionId] = value;
}
this.findSimpleIndex();
this.findAllowedAttributeOptions();
this.updatePrices();
!skipUpdateGallery && this.updateGallery();
let candidates = this.findProductIdsForPartialSelection(this.selectedValues);
window.dispatchEvent(new CustomEvent('listing-configurable-selection-changed', {
detail: {
productId: this.productId,
optionId,
value,
productIndex: this.productIndex,
selectedValues: this.selectedValues,
candidates: candidates,
skuCandidates: this.optionConfig.sku ? Object.values(candidates).map(id => this.optionConfig.sku[id]) : [],
}
}));
},
updateGallery() {
if (!this.productIndex) {
return;
}
fetch(`${this.mediaCallback}?product_id=${this.productIndex}&parent_id=${this.productId}&isAjax=true`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
}
).then(response => {
return response.json()
}
).then(data => {
if (data.errors) {
// non critical failure only console logged
console.warn(data.errors);
} else {
const image = data && data.medium;
image && window.dispatchEvent(
new CustomEvent(
"update-gallery-157909",
{detail: image}
)
);
}
}).catch(error => {
console.warn(error)
});
},
preselectQuerystringItems() {
// pre-select option like ?size=167
const urlQueryParams = new URLSearchParams(window.location.search.replace('?', ''));
Object.values(this.optionConfig.attributes).map(attribute => {
// Don't update images on load, since PLPs already set the main image to the selected options
const skipUpdateGallery = true;
urlQueryParams.get(attribute.code) &&
this.changeOption(attribute.id, urlQueryParams.get(attribute.code), skipUpdateGallery);
});
},
mouseDown: false,
startX: 0,
maxScroll: 0,
scrollLeft: null,
slider: null,
scrollEvents: {
['@mousedown'](e) {
this.slider = e.target.closest('.snap');
if (!this.slider) {
return;
}
this.maxScroll = this.slider.scrollWidth - this.slider.offsetWidth;
this.startX = e.pageX - this.slider.offsetLeft;
this.scrollLeft = this.slider.scrollLeft;
this.mouseDown = true;
},
['@mouseout.self']() {
this.mouseDown = false;
},
['@mouseup']() {
this.mouseDown = false;
},
['@mousemove'](e) {
e.preventDefault();
if (!this.mouseDown) {
return;
}
const x = e.pageX - this.slider.offsetLeft;
const scroll = x - this.startX;
const scrollLeft = this.scrollLeft - scroll;
if (scrollLeft > this.maxScroll) {
this.slider.scrollLeft = this.maxScroll;
return
}
this.slider.scrollLeft = this.scrollLeft - scroll;
},
['@onselectstart']() {
return false;
}
},
resizeEvent() {
Array.from(this.$root.querySelectorAll('.snap')).forEach(slider => {
slider.scrollLeft = 0;
})
}
}
);
}
As low as
£118.00
Coach CAD54 Prescription Sunglasses
function initPriceBox__6a6510c165c63()
{
return {
additionalPriceElement : document.querySelector('#regular-price_' + 155411),
regularPrice : 110,
updatePrice(priceData) {
const regularPriceLabel = this.$root.querySelector('.normal-price .price-label');
const regularPriceElement = this.$root.querySelector('.normal-price [data-price-type=finalPrice].price-wrapper .price');
const basePriceElement = this.$root.querySelector('.normal-price [data-price-type=basePrice].price-wrapper .price');
if (regularPriceLabel) {
if (priceData.finalPrice.amount < priceData.oldPrice.amount) {
regularPriceLabel.classList.add('hidden');
} else {
regularPriceLabel.classList.remove('hidden');
}
}
regularPriceElement.innerText = hyva.formatPrice(priceData.finalPrice.amount);
basePriceElement && (basePriceElement.innerText = hyva.formatPrice(priceData.basePrice.amount));
if (this.additionalPriceElement) {
if (priceData.finalPrice.amount === this.regularPrice) {
this.additionalPriceElement.classList.add('hidden');
} else if (priceData.finalPrice.amount < this.regularPrice) {
this.additionalPriceElement.classList.remove('hidden');
}
}
}
}
}
function initConfigurableSwatchOptions_155411() {
const configurableOptionsComponent = initConfigurableOptions(
'155411',
{"attributes":{"93":{"id":"93","code":"color","label":"Colour","options":[{"id":"13051","label":"Purple \/ Violet","products":["154927"]},{"id":"116","label":"Pink","products":["154926"]},{"id":"112","label":"Blue","products":["154923"]},{"id":"10","label":"Black","products":["154922"]}],"position":"0"},"156":{"id":"156","code":"a01_size_option","label":"Size Option","options":[{"id":"247","label":"54-18-140","products":["154927","154926","154923","154922"]}],"position":"1"}},"template":"\u00a3","currencyFormat":"\u00a3%s","optionPrices":{"154927":{"baseOldPrice":{"amount":91.666666666667},"oldPrice":{"amount":110},"basePrice":{"amount":91.666666666667},"finalPrice":{"amount":110},"tierPrices":[],"msrpPrice":{"amount":0}},"154926":{"baseOldPrice":{"amount":91.666666666667},"oldPrice":{"amount":110},"basePrice":{"amount":91.666666666667},"finalPrice":{"amount":110},"tierPrices":[],"msrpPrice":{"amount":0}},"154923":{"baseOldPrice":{"amount":91.666666666667},"oldPrice":{"amount":110},"basePrice":{"amount":91.666666666667},"finalPrice":{"amount":110},"tierPrices":[],"msrpPrice":{"amount":0}},"154922":{"baseOldPrice":{"amount":91.666666666667},"oldPrice":{"amount":110},"basePrice":{"amount":91.666666666667},"finalPrice":{"amount":110},"tierPrices":[],"msrpPrice":{"amount":0}}},"priceFormat":{"pattern":"\u00a3%s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":false},"prices":{"baseOldPrice":{"amount":91.666666666667},"oldPrice":{"amount":110},"basePrice":{"amount":91.666666666667},"finalPrice":{"amount":110}},"productId":"155411","chooseText":"Choose an Option...","images":[],"index":{"154927":{"93":"13051","156":"247"},"154926":{"93":"116","156":"247"},"154923":{"93":"112","156":"247"},"154922":{"93":"10","156":"247"}},"salable":[],"canDisplayShowOutOfStockStatus":false,"preSelectedGallery":[],"supplier_colour_data":{"colour_attribute_id":93,"mapping":{"154927":"Violet","154926":"Pink","154923":"Blue","154922":"Black"}},"additional_product_data":{"configurable":{"id":"155411","sku":"HC8424U","custom_options":null},"simples":{"154927":{"sku":"HC8424U-59548H-54-18-140"},"154926":{"sku":"HC8424U-595313-54-18-140"},"154923":{"sku":"HC8424U-58664M-54-18-140"},"154922":{"sku":"HC8424U-50023C-54-18-140"}}}} );
const swatchOptionsComponent = initSwatchOptions({"93":{"10":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/b\/l\/black_20.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/b\/l\/black_20.png","label":"Black"},"116":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/p\/i\/pink_3.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/p\/i\/pink_3.png","label":"Pink"},"112":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/b\/l\/blue_1_.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/b\/l\/blue_1_.png","label":"Blue"},"13051":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/p\/u\/purple_9.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/p\/u\/purple_9.png","label":"Purple \/ Violet"},"additional_data":"{\"swatch_input_type\":\"visual\",\"update_product_preview_image\":\"1\",\"use_product_image_for_swatch\":\"0\"}"}});
return Object.assign(
configurableOptionsComponent,
swatchOptionsComponent,
{
mediaCallback: "https\u003A\u002F\u002Fwww.spex4less.com\u002Fswatches\u002Fajax\u002Fmedia\u002F",
changeOption(optionId, value, skipUpdateGallery) {
if (value === '') {
this.selectedValues = this.removeAttrFromSelection(this.selectedValues, optionId)
} else {
this.selectedValues[optionId] = value;
}
this.findSimpleIndex();
this.findAllowedAttributeOptions();
this.updatePrices();
!skipUpdateGallery && this.updateGallery();
let candidates = this.findProductIdsForPartialSelection(this.selectedValues);
window.dispatchEvent(new CustomEvent('listing-configurable-selection-changed', {
detail: {
productId: this.productId,
optionId,
value,
productIndex: this.productIndex,
selectedValues: this.selectedValues,
candidates: candidates,
skuCandidates: this.optionConfig.sku ? Object.values(candidates).map(id => this.optionConfig.sku[id]) : [],
}
}));
},
updateGallery() {
if (!this.productIndex) {
return;
}
fetch(`${this.mediaCallback}?product_id=${this.productIndex}&parent_id=${this.productId}&isAjax=true`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
}
).then(response => {
return response.json()
}
).then(data => {
if (data.errors) {
// non critical failure only console logged
console.warn(data.errors);
} else {
const image = data && data.medium;
image && window.dispatchEvent(
new CustomEvent(
"update-gallery-155411",
{detail: image}
)
);
}
}).catch(error => {
console.warn(error)
});
},
preselectQuerystringItems() {
// pre-select option like ?size=167
const urlQueryParams = new URLSearchParams(window.location.search.replace('?', ''));
Object.values(this.optionConfig.attributes).map(attribute => {
// Don't update images on load, since PLPs already set the main image to the selected options
const skipUpdateGallery = true;
urlQueryParams.get(attribute.code) &&
this.changeOption(attribute.id, urlQueryParams.get(attribute.code), skipUpdateGallery);
});
},
mouseDown: false,
startX: 0,
maxScroll: 0,
scrollLeft: null,
slider: null,
scrollEvents: {
['@mousedown'](e) {
this.slider = e.target.closest('.snap');
if (!this.slider) {
return;
}
this.maxScroll = this.slider.scrollWidth - this.slider.offsetWidth;
this.startX = e.pageX - this.slider.offsetLeft;
this.scrollLeft = this.slider.scrollLeft;
this.mouseDown = true;
},
['@mouseout.self']() {
this.mouseDown = false;
},
['@mouseup']() {
this.mouseDown = false;
},
['@mousemove'](e) {
e.preventDefault();
if (!this.mouseDown) {
return;
}
const x = e.pageX - this.slider.offsetLeft;
const scroll = x - this.startX;
const scrollLeft = this.scrollLeft - scroll;
if (scrollLeft > this.maxScroll) {
this.slider.scrollLeft = this.maxScroll;
return
}
this.slider.scrollLeft = this.scrollLeft - scroll;
},
['@onselectstart']() {
return false;
}
},
resizeEvent() {
Array.from(this.$root.querySelectorAll('.snap')).forEach(slider => {
slider.scrollLeft = 0;
})
}
}
);
}
£110.00
Coach CAD33 Prescription Sunglasses
function initPriceBox__6a6510c16d47b()
{
return {
additionalPriceElement : document.querySelector('#regular-price_' + 155409),
regularPrice : 104,
updatePrice(priceData) {
const regularPriceLabel = this.$root.querySelector('.normal-price .price-label');
const regularPriceElement = this.$root.querySelector('.normal-price [data-price-type=finalPrice].price-wrapper .price');
const basePriceElement = this.$root.querySelector('.normal-price [data-price-type=basePrice].price-wrapper .price');
if (regularPriceLabel) {
if (priceData.finalPrice.amount < priceData.oldPrice.amount) {
regularPriceLabel.classList.add('hidden');
} else {
regularPriceLabel.classList.remove('hidden');
}
}
regularPriceElement.innerText = hyva.formatPrice(priceData.finalPrice.amount);
basePriceElement && (basePriceElement.innerText = hyva.formatPrice(priceData.basePrice.amount));
if (this.additionalPriceElement) {
if (priceData.finalPrice.amount === this.regularPrice) {
this.additionalPriceElement.classList.add('hidden');
} else if (priceData.finalPrice.amount < this.regularPrice) {
this.additionalPriceElement.classList.remove('hidden');
}
}
}
}
}
function initConfigurableSwatchOptions_155409() {
const configurableOptionsComponent = initConfigurableOptions(
'155409',
{"attributes":{"93":{"id":"93","code":"color","label":"Colour","options":[{"id":"4","label":"Brown","products":["154917"]},{"id":"10","label":"Black","products":["154915"]}],"position":"0"},"156":{"id":"156","code":"a01_size_option","label":"Size Option","options":[{"id":"360","label":"55-17-140","products":["154917","154915"]}],"position":"1"}},"template":"\u00a3","currencyFormat":"\u00a3%s","optionPrices":{"154917":{"baseOldPrice":{"amount":86.666666666667},"oldPrice":{"amount":104},"basePrice":{"amount":86.666666666667},"finalPrice":{"amount":104},"tierPrices":[],"msrpPrice":{"amount":0}},"154915":{"baseOldPrice":{"amount":86.666666666667},"oldPrice":{"amount":104},"basePrice":{"amount":86.666666666667},"finalPrice":{"amount":104},"tierPrices":[],"msrpPrice":{"amount":0}}},"priceFormat":{"pattern":"\u00a3%s","precision":2,"requiredPrecision":2,"decimalSymbol":".","groupSymbol":",","groupLength":3,"integerRequired":false},"prices":{"baseOldPrice":{"amount":86.666666666667},"oldPrice":{"amount":104},"basePrice":{"amount":86.666666666667},"finalPrice":{"amount":104}},"productId":"155409","chooseText":"Choose an Option...","images":[],"index":{"154917":{"93":"4","156":"360"},"154915":{"93":"10","156":"360"}},"salable":[],"canDisplayShowOutOfStockStatus":false,"preSelectedGallery":[],"supplier_colour_data":{"colour_attribute_id":93,"mapping":{"154917":"Brown","154915":"Black"}},"additional_product_data":{"configurable":{"id":"155409","sku":"HC8422U","custom_options":null},"simples":{"154917":{"sku":"HC8422U-584174-55-17-140"},"154915":{"sku":"HC8422U-50023C-55-17-140"}}}} );
const swatchOptionsComponent = initSwatchOptions({"93":{"10":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/b\/l\/black_20.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/b\/l\/black_20.png","label":"Black"},"4":{"type":"2","value":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_image\/40x24\/b\/r\/brown_9.png","thumb":"https:\/\/www.spex4less.com\/media\/attribute\/swatch\/swatch_thumb\/110x90\/b\/r\/brown_9.png","label":"Brown"},"additional_data":"{\"swatch_input_type\":\"visual\",\"update_product_preview_image\":\"1\",\"use_product_image_for_swatch\":\"0\"}"}});
return Object.assign(
configurableOptionsComponent,
swatchOptionsComponent,
{
mediaCallback: "https\u003A\u002F\u002Fwww.spex4less.com\u002Fswatches\u002Fajax\u002Fmedia\u002F",
changeOption(optionId, value, skipUpdateGallery) {
if (value === '') {
this.selectedValues = this.removeAttrFromSelection(this.selectedValues, optionId)
} else {
this.selectedValues[optionId] = value;
}
this.findSimpleIndex();
this.findAllowedAttributeOptions();
this.updatePrices();
!skipUpdateGallery && this.updateGallery();
let candidates = this.findProductIdsForPartialSelection(this.selectedValues);
window.dispatchEvent(new CustomEvent('listing-configurable-selection-changed', {
detail: {
productId: this.productId,
optionId,
value,
productIndex: this.productIndex,
selectedValues: this.selectedValues,
candidates: candidates,
skuCandidates: this.optionConfig.sku ? Object.values(candidates).map(id => this.optionConfig.sku[id]) : [],
}
}));
},
updateGallery() {
if (!this.productIndex) {
return;
}
fetch(`${this.mediaCallback}?product_id=${this.productIndex}&parent_id=${this.productId}&isAjax=true`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
}
).then(response => {
return response.json()
}
).then(data => {
if (data.errors) {
// non critical failure only console logged
console.warn(data.errors);
} else {
const image = data && data.medium;
image && window.dispatchEvent(
new CustomEvent(
"update-gallery-155409",
{detail: image}
)
);
}
}).catch(error => {
console.warn(error)
});
},
preselectQuerystringItems() {
// pre-select option like ?size=167
const urlQueryParams = new URLSearchParams(window.location.search.replace('?', ''));
Object.values(this.optionConfig.attributes).map(attribute => {
// Don't update images on load, since PLPs already set the main image to the selected options
const skipUpdateGallery = true;
urlQueryParams.get(attribute.code) &&
this.changeOption(attribute.id, urlQueryParams.get(attribute.code), skipUpdateGallery);
});
},
mouseDown: false,
startX: 0,
maxScroll: 0,
scrollLeft: null,
slider: null,
scrollEvents: {
['@mousedown'](e) {
this.slider = e.target.closest('.snap');
if (!this.slider) {
return;
}
this.maxScroll = this.slider.scrollWidth - this.slider.offsetWidth;
this.startX = e.pageX - this.slider.offsetLeft;
this.scrollLeft = this.slider.scrollLeft;
this.mouseDown = true;
},
['@mouseout.self']() {
this.mouseDown = false;
},
['@mouseup']() {
this.mouseDown = false;
},
['@mousemove'](e) {
e.preventDefault();
if (!this.mouseDown) {
return;
}
const x = e.pageX - this.slider.offsetLeft;
const scroll = x - this.startX;
const scrollLeft = this.scrollLeft - scroll;
if (scrollLeft > this.maxScroll) {
this.slider.scrollLeft = this.maxScroll;
return
}
this.slider.scrollLeft = this.scrollLeft - scroll;
},
['@onselectstart']() {
return false;
}
},
resizeEvent() {
Array.from(this.$root.querySelectorAll('.snap')).forEach(slider => {
slider.scrollLeft = 0;
})
}
}
);
}
£104.00