AR6050

$208.00
$249.00
Save $41.00
Colour
Size
Lens Colour
(function(){ const TAG = 'spz-custom-lamb-add-btn'; class SpzCustomLambAddBtn extends SPZ.BaseElement { constructor(element) { super(element); this.templates_ = null; this.action_ = null; this.selected_variant = '{"id":"3702e239-202c-41d7-b462-32da40a31e17","product_id":"7e06fc86-3380-43ac-8f8c-8a6bf9576cd2","title":"3014\/88 Black-54-19 150-Grey Mirror Silver Gradient","weight_unit":"kg","inventory_quantity":1,"sku":"","barcode":"8053672709407","position":1,"option1":"3014\/88 Black","option2":"54-19 150","option3":"Grey Mirror Silver Gradient","note":"Final Sale","image":{"src":"\/\/img.staticdj.com\/71b3c740221616a03e292ab12c8334f0.jpg","path":"71b3c740221616a03e292ab12c8334f0.jpg","width":1500,"height":1500,"alt":"","aspect_ratio":1},"wholesale_price":[{"price":208,"min_quantity":1}],"weight":"0.5","compare_at_price":"249","price":"208","retail_price":"249","available":true,"url":"\/products\/ar6050?variant=3702e239-202c-41d7-b462-32da40a31e17","available_quantity":1,"options":[{"name":"Colour","value":"3014\/88 Black"},{"name":"Size","value":"54-19 150"},{"name":"Lens Colour","value":"Grey Mirror Silver Gradient"}],"off_ratio":16,"flashsale_info":[],"sales":0}'; this.lens_process_id = ""; } buildCallback() { this.xhr_ = SPZServices.xhrFor(this.win); this.action_ = SPZServices.actionServiceForDoc(this.element); this.templates_ = SPZServices.templatesForDoc(this.element); this.getLambLensSteps_(true); this.setupAction_(); } mountCallback() { document.addEventListener('dj.variantChange', (event) => { const variant = event.detail.selected; if (variant.product_id == '7e06fc86-3380-43ac-8f8c-8a6bf9576cd2') { this.selected_variant = JSON.stringify(variant); } }); } fetchLambLensSteps() { const lens_process_id = location.search.replace('?', '').split('&').find(v => v.includes('lens_process_id')); const template_id = location.search.replace('?', '').split('&').find(v => v.includes('template_id')); const stepsUrl = '/api/fireant/product/7e06fc86-3380-43ac-8f8c-8a6bf9576cd2/steps' + ((lens_process_id ? `?${lens_process_id}` : '') || (template_id ? `?${template_id}` : '')); return fetch(stepsUrl).then((res)=>{ return res.json(); }).then((data)=>{ return data; }) } showProductBtn() { var addToCart = document.getElementById('add_to_cart_normal'); var productQuantityBtn = document.getElementById('product_info_quantity_normal'); addToCart && addToCart.classList.remove('hidden'); productQuantityBtn && productQuantityBtn.classList.remove('hidden'); } getLambLensSteps_(isInit) { try{ this.fetchLambLensSteps().then((data)=>{ if(data.errors) { if(isInit){ this.renderBtn(false); this.showProductBtn(); } }else{ if(isInit){ this.lens_process_id = data?.lens_process_id; let frameOnlyArr = data?.prescription_types?.options.filter((option)=>{ return option.prescription_type === 'Frame Only' }); let frameOnlyObj = frameOnlyArr.length > 0 ? frameOnlyArr[0] : {}; let available = true; if(available && (frameOnlyObj?.frame_only_display_at == 'product_detail' || frameOnlyObj?.frame_only_display_at == 'all')){ this.renderBtn({ ...frameOnlyObj, process_type: data.process_type }); }else{ this.renderBtn({ process_type: data.process_type }); } } } }); }catch(e){ this.renderBtn(false); this.showProductBtn(); } } renderBtn = (isRenderProcessBtn) => { return this.templates_ .findAndRenderTemplate(this.element, isRenderProcessBtn) .then((el) => { const children = this.element.querySelector('*:not(template)'); children && SPZCore.Dom.removeElement(children); this.element.appendChild(el); }); } handleClickFrameOnlyBtn_ = async () => { try { const reqBody = { product_id: "7e06fc86-3380-43ac-8f8c-8a6bf9576cd2", variant_id: JSON.parse(this.selected_variant)?.id, quantity: 1, properties: { lens_processing_id: this.lens_process_id, prescription_type: "Frame Only" } } const data = await this.xhr_.fetchJson('/api/fireant/v2/customize_cart', { method: "post", body: reqBody }); if(data.state === 'success') { this.atc_loading_ = false; this.element.removeAttribute('atc-loading'); this.triggerEvent_("dj.addToCart", data); window.location.href = "/cart"; } else { this.atc_loading_ = false; this.element.removeAttribute('atc-loading'); } } catch (e) { this.atc_loading_ = false; this.element.removeAttribute('atc-loading'); const toast = SPZCore.Dom.scopedQuerySelector(document, `#error-toast`); toast && SPZ.whenApiDefined(toast).then((api) => { e.then((result)=>{ api.showToast(result?.errors[0] || 'Unknown error'); }) }); } } trackAddToCart = () => { const params = { business_type: "product_plugin", function_name: "prescription_lens", plugin_name: "prescription_lens", module: "apps", tab_name: "process_btn", event_type: "click", event_developer: "jozy", event_info: JSON.stringify({ action_type: "frame_only_add_to_cart", product_id: '"7e06fc86-3380-43ac-8f8c-8a6bf9576cd2"', process_id: this.lens_process_id, process_type: "glasses", element_type: "button", element_name: "frame_only_btn" }) } window.spzutm && window.spzutm.registerParams('add_to_cart', params ); } setupAction_ = () => { this.registerAction('handleClickBtn', (invocation) => { this.saveAllFormProperties_(); const glassesInfo = { product:{ title: "AR6050", id: "7e06fc86-3380-43ac-8f8c-8a6bf9576cd2", image: {"src":"\/\/img.staticdj.com\/71b3c740221616a03e292ab12c8334f0.jpg","path":"71b3c740221616a03e292ab12c8334f0.jpg","width":1500,"height":1500,"alt":"","aspect_ratio":1}, selected_variant: JSON.parse(this.selected_variant) }, atcType: 'add_lens' }; const tempElement = document.getElementById('process-request-script'); tempElement && SPZ.whenApiDefined(tempElement).then(async (api) => { await api.requestLensProcess(glassesInfo, invocation.args.process_type); }); setTimeout(() => { const proceeBtn = document.getElementById('lens_add_to_cart'); proceeBtn && proceeBtn.classList.remove('pointer-events-none'); }, 3000); }); this.registerAction('handleClickFrameOnlyBtn', (invocation) => { this.trackAddToCart(); this.atc_loading_ = true; this.element.setAttribute('atc-loading',""); this.handleClickFrameOnlyBtn_(); }); } saveAllFormProperties_(){ const formEntries = this.getFormData_(); const properties = this.getFormAllProperties_(formEntries); // 获取的form所有properties存全局 window.app_lamb_form_properties = properties; } getFormData_() { const form = this.element.closest("form"); const formData = new FormData(form); const formEntries = Object.fromEntries(formData.entries()); return formEntries; } getFormAllProperties_(obj){ const result = {}; Object.entries(obj).forEach(([key, value]) => { if (key.startsWith("properties")) { result[key.substring(11, key.length - 1)] = value; } }); return result; } triggerEvent_(name, params) { const event = SPZUtils.Event.create( this.win, name, params, {bubbles: true} ); this.element.dispatchEvent(event); } isLayoutSupported = (layout) => { return layout == SPZCore.Layout.CONTAINER; } } SPZ.defineElement(TAG, SpzCustomLambAddBtn) })()
How to Measure your PD

HOW TO MEASURE PUPILLARY DISTANCE (PD)

HOW TO MEASURE PD?

To measure your pupillary distance (PD), follow these steps:

  1. Stand in front of a mirror with good lighting.
  2. Hold a ruler or PD measurement tool horizontally against your forehead, making sure it's straight and level. You can download the PD ruler here.
  3. Look straight ahead and focus on a distant object.
  4. With the ruler or measurement tool against your forehead, align the zero mark with the center of your right pupil. Make sure you're holding it firmly and keeping it level.
  5. Look straight ahead again and read the measurement where the center of your left pupil aligns with the ruler or measurement tool. This measurement is your pupillary distance.
  6. Repeat the process a couple of times to ensure accuracy. If the measurements differ, take an average of the results.

What is PD?

Your Pupillary Distance, or PD, is the distance in millimeters (mm) between the center of one pupil to the center of the other. A personalized fit starts with measuring your pupillary distance: it indicates which part of the lens you look through, ensuring optimal comfort and clarity.

Why is it important?

If your PD isn’t right, it can cause eye strain, fatigue, or simply not being able to see properly. The higher your prescription, the bigger the effect an incorrect PD can have. So get measuring!

SINGLE PD

DUAL PD

SINGLE PD is the pupillary distance between the center of one pupil to the other, which can be a distance PD or near PD. Distance PD can be used to order any type of prescription glasses except reading glasses. DUAL PD, or monocular PD, consists of two numbers and is the distance between the centers of each pupil to the bridge of the nose. Dual PD is usually written in the following notation: 32/30. The first number is always the right eye (OD) measurement, and the second number is the left eye (OS).

Details
window.__bright__ = { getMetaData_: () => { const metaData = [ {"value": "Women", "title": "Gender", "owner_resource": "product", "key": "gender", "namespace": "frame"}, {"value": "Adjustable Nosepads", "title": "Fitting", "owner_resource": "product", "key": "fitting", "namespace": "frame"}, {"value": "Metal", "title": "Front Material", "owner_resource": "product", "key": "front_material", "namespace": "frame"}, {"value": "Metal", "title": "Temple Material", "owner_resource": "product", "key": "temple_material", "namespace": "frame"}, {"value": "Full Rim", "title": "Rim", "owner_resource": "product", "key": "rim", "namespace": "frame"}, {"value": "", "title": "Rxable", "owner_resource": "product", "key": "rxable", "namespace": "frame"}, {"value": "Round", "title": "Frame Shape", "owner_resource": "product", "key": "shape", "namespace": "frame"}, {"value": "Black", "title": "Frame Color", "owner_resource": "product", "key": "color", "namespace": "frame"}, {"value": "", "title": "Wear frequency", "owner_resource": "product", "key": "_frequency", "namespace": "custom"}, ]; return metaData; }, getBlockData_: () => { const blockSettingData = { "frameWidth": { "value": "", }, "lensWidth": { "value": "54", }, "bridgeWidth": { "value": "19", }, "lensHeight": { "value": "49", }, "templeLength": { "value": "150", } }; return blockSettingData; } }; (function(){ const TAG = 'spz-custom-structured-logic'; class SpzCustomStructuredLogic extends SPZ.BaseElement { constructor(element) { super(element); this.xhr_ = SPZServices.xhrFor(this.win); } buildCallback = () => { this.setupAction_(); this.unit = 'mm'; this.variantChange_(); this.selectedData = this.getProductData_(); this.init_(); } static deferredMount() { return false; } isLayoutSupported = (layout) => { return layout == SPZCore.Layout.CONTAINER; } setupAction_ = () => { this.registerAction('changeUnit', (invocation) => { const changeUnit = invocation.args.data; this.unit = changeUnit; this.init_(); }); } init_ = () => { this.meteData_ = window.__bright__.getMetaData_(); this.blockData_ = window.__bright__.getBlockData_(); this.renderParameter_(); this.renderStructuredImg_(); this.renderTempleLength_(); this.renderBtn_(); } getProductData_ = () => { let pJson = document.getElementById('product-json'); if (pJson) { return JSON.parse(pJson.innerHTML); } if (typeof $ === 'function') { return $(document).data('djproduct'); } return undefined; } renderParameter_ = () => { const structuredParameterContainerRender = document.getElementById('structured-parameter-container-render'); SPZ.whenApiDefined(structuredParameterContainerRender).then(async (api) => { const parameter = []; this.meteData_.forEach(meta => { if (meta.owner_resource === 'product') { parameter.push({ title: meta.title, value: meta.value }); } else { parameter.push({ title: meta.title, value: meta.value[this.selectedData.selected.id] }); } }); api.render(parameter); }); } renderStructuredImg_ = () => { const glassesImgRender = document.getElementById('glasses-img-render'); SPZ.whenApiDefined(glassesImgRender).then(async (api) => { const parameter = {}; parameter.unit = this.unit; Object.keys(this.blockData_).forEach(key => { if (typeof this.blockData_[key].value === 'string') { parameter[key] = this.blockData_[key].value; } else { parameter[key] = this.blockData_[key].value[this.selectedData.selected.id]; } }); api.render(parameter); }); } renderTempleLength_ = () => { const lensImgRender = document.getElementById('lens-img-render'); SPZ.whenApiDefined(lensImgRender).then(async (api) => { let parameter = {}; parameter.unit = this.unit; if (this.blockData_.templeLength.value) { if (typeof this.blockData_.templeLength.value === 'string') { parameter.value = this.blockData_.templeLength.value; } else { parameter.value = this.blockData_.templeLength.value[this.selectedData.selected.id]; } } api.render(parameter); }); } renderBtn_ = () => { const conversionBtnRender = document.getElementById('conversion-btn-render'); conversionBtnRender && SPZ.whenApiDefined(conversionBtnRender).then(async (api) => { const parameter = {}; Object.keys(this.blockData_).forEach(key => { if (typeof this.blockData_[key].value === 'string') { parameter[key] = this.blockData_[key].value; } else { parameter[key] = this.blockData_[key].value[this.selectedData.selected.id]; } }); parameter.unit = this.unit; api.render(parameter); }) } variantChange_ = () => { document.addEventListener('dj.variantChange', (e) => { this.init_(); this.selectedData = e.detail; }); document.addEventListener('dj.editor.update', (e) => { this.init_(); }); } } SPZ.defineElement(TAG, SpzCustomStructuredLogic) })();