${thcLow} mg`; var thcPercent = thcLow/10 + " %"; } else { var thc = `THC
${thcLow} - ${thcHigh} mg`; var thcPercent = thcLow/10 + " - " + thcHigh/10 + " %"; } category[0].innerHTML = thc; try{ category[0].innerHTML += getTrailingUnitType(productDetails.type.name, productDetails.title); if (productDetails.ample_category == "Dried Flower" || productDetails.ample_category == "Pre Rolls") category[0].innerHTML += "
" + thcPercent; } catch(e){} // set CBD var cbdLow = Math.round(productDetails.cannabinoids.cbd.low == null ? 0 : productDetails.cannabinoids.cbd.low); var cbdHigh = Math.round(productDetails.cannabinoids.cbd.high == null ? 0 : productDetails.cannabinoids.cbd.high); if(cbdLow == cbdHigh) { var cbd = `CBD
${cbdHigh} mg`; var cbdPercent = "
" + cbdLow/10 + " %"; } else { var cbd = `CBD
${cbdLow} - ${cbdHigh} mg`; var cbdPercent = "
" + cbdLow/10 + " - " + cbdHigh/10 + " %"; } category[1].innerHTML = cbd; try{ category[1].innerHTML += getTrailingUnitType(productDetails.type.name, productDetails.title); if (productDetails.ample_category == "Dried Flower" || productDetails.ample_category == "Pre Rolls") category[1].innerHTML += cbdPercent; } catch(e){} // set Strain category[2].innerHTML= productDetails.skus.strain== null ? "" : productDetails.skus.strain; var cannabinoidProfile = document.querySelector('.product-cannabinoids-profile'); cannabinoidProfile.innerHTML = ""; if (productDetails.cannabinoids){ // var cannabinoidsMap = filterCannabinoidProfile(productDetails.skus.cannabinoids); var cannabinoidsMap = new Map(Object.entries(productDetails.cannabinoids)); for (var [key, valueJs] of cannabinoidsMap) { if (key == "thc" || key == "cbd") continue; var cbgText = valueJs; /* var cbgLow = Math.round(valueJs.low == null ? 0 : valueJs.low); var cbgHigh = Math.round(valueJs.high == null ? 0 : valueJs.high); if (cbgLow == cbgHigh) var cbgText = cbgLow + " mg"; else var cbgText = cbgLow + " - " + cbgHigh + " mg";*/ var title = document.createElement('div'); title.style = "color:black;padding-right: 3px; width: auto; font-size: 0.9rem;font-weight:bold"; title.innerHTML = key.toLocaleUpperCase(); var value = document.createElement('h6'); value.style = "width: auto;font-size: 0.9rem !important;margin-bottom:0;font-weight:bold"; value.innerHTML = cbgText; /* try { value.innerHTML += getTrailingUnitType(productDetails.type.name, productDetails.title); } catch (e) {} */ var newDiv = document.createElement('div'); newDiv.style = "display: flex;align-items: baseline;"; newDiv.appendChild(title); newDiv.appendChild(value); try { cannabinoidProfile.appendChild(newDiv); } catch (e) { console.log(e); } } } } catch (e) { console.log(e); }}function setUpMinorCanab(productDetails){ try{ let cbn = document.getElementById('cbn'); let thc_a = document.getElementById('thc_a'); let delta_8_thc = document.getElementById('delta_8_thc'); let cbnValue = productDetails.minor_cannabinoids.cbn; let thc_aValue = productDetails.minor_cannabinoids.thc_aValue; let delta_8_thcValue = productDetails.minor_cannabinoids.delta_8_thc; if(cbnValue){ cbn.style = "display: block;"; cbn.children[0].children[1].innerHTML = cbnValue; } if(thc_aValue){ thc_a.style = "display: block;"; thc_a.children[0].children[1].innerHTML = thc_aValue; } if(delta_8_thcValue){ delta_8_thc.style = "display: block;"; delta_8_thc.children[0].children[1].innerHTML = delta_8_thcValue; } }catch(e){ console.log("---------------- setUpMinorCanab failed --------------- " + e); }}async function setUpPrice(productDetails) { try{ setTimeout(()=>{ document.querySelector('.price-preview').innerHTML=formatter.format(productDetails.skus.price.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})).replace("CA", ""); }, 250); document.querySelector('.price-preview').style="color:black ;font-weight:bold;"; } catch (e){ console.log(e) ; }}async function setupDeduction(productDetails){ try{ var deduction = document.getElementById('deduction-amount'); deduction.style = "padding-left: 10px; font-weight: bold;"; deduction.id = "deduction-amount"; deduction.innerHTML = deduction.innerHTML.replace(/[0-9.]+/g, '').replace('g','') + " " + productDetails.skus.rx_deduction + "g"; } catch(e){ console.log(e); }}function setUpTerpeneColorsMap(){ colorMap.set('Alpha-Pinene', '#04724D'); colorMap.set('A-Pinene', '#04724D'); colorMap.set('a-Pinene', '#04724D'); colorMap.set('Alpha-Bisabolol', '#FDD303'); colorMap.set('Bisabolol', '#FDD303'); colorMap.set('Borneol', '#FFF102'); colorMap.set('Alpha-Humulene', '#F1995D'); colorMap.set('a-Humulene', '#F1995D'); colorMap.set('Beta-Eudesmol', '#EAEAEA'); colorMap.set('Beta-Myrcene', '#039BE5'); colorMap.set('Myrcene', '#039BE5'); colorMap.set('Beta-Pinene', '#0E7C7B'); colorMap.set('B-Pinene', '#0E7C7B'); colorMap.set('b-Pinene', '#0E7C7B'); colorMap.set('Camphene', '#D6DF24'); colorMap.set('Caryophyllene', '#595959'); colorMap.set('d-Limonene', '#059129'); colorMap.set('Limonene', '#059129'); colorMap.set('Alpha-Cedrene', '#C95A49'); colorMap.set('a-Cedrene', '#C95A49'); colorMap.set('Cedrene', '#C95A49'); colorMap.set('Eucalyptol', '#2BB672'); colorMap.set('Carene', '#8DC641'); colorMap.set('Geraniol', '#DD0564'); colorMap.set('Citronellol', '#028C41'); colorMap.set('Guaiol', '#67b694'); colorMap.set('Geraniol', '#00A79F'); colorMap.set('Humulene', '#F1995D'); colorMap.set('Terpineol', '#DD0564'); colorMap.set('Linalool', '#9F84BD'); colorMap.set('Nerolidol', '#F5F27E'); colorMap.set('Ocimene', '#FFCC80'); colorMap.set('Beta-Ocimene', '#FFCC80'); colorMap.set('Carene', '#255E91'); colorMap.set('Phytol', '#FFFF00'); colorMap.set('Terpinolene', '#FFC200'); colorMap.set('Trans-Beta-Ocimene', '#BFBFBF'); colorMap.set('Trans-Phytol', '#990000'); colorMap.set('Fenchyl Alconol', '#E7E6E6'); colorMap.set('Valencene', '#ED7D31'); colorMap.set('Beta-Caryophyllene', '#5D5951'); colorMap.set('b-Caryophyllene', '#5D5951'); colorMap.set('Farnesene', '#e9a447'); colorMap.set('Trans-Caryophyllene', '#595959'); colorMap.set('Menthol','#f5f27e') ; colorMap.set('Cedrol','#3c7759') ; colorMap.set('Farnesene','#e9a447') ; colorMap.set('Terpinene','#c88762') ; colorMap.set('Phellandrene','#C5EADA') ; colorMap.set('Other','#000000') ;}async function checkLanguage(){ if (french){ try { document.getElementById('description').children[0].classList.add('hide-section') ; document.getElementById('description').children[1].classList.remove('hide-section') ; } catch (e) {} } document.getElementById('product-categories').children[2].innerHTML = "Hybrid";}async function setupFavouriteBtn() { if (!localStorage.getItem("user-profile")) return ; var userProfile = JSON.parse(atob(localStorage.getItem("user-profile"))); var product = await getProductByHandle(); if(document.querySelector('.favourite-btn-product-page')) document.querySelector('.favourite-btn-product-page').setAttribute("data-ample-id",product.ample_id); for (var i =0 ; i< userProfile.favourite_products.length ; i++){ if (userProfile.favourite_products[i].ample_id == product.ample_id) { document.querySelector('.favourite-btn-product-page').classList.add("favourite-btn-checked"); } }}async function filterProduct(){ var backGrey = document.createElement('div'); backGrey.style = "position: fixed; width: 100%; height: 100vh; background: black; opacity: 0.5; z-index: 9999 !important;" var loader = document.createElement('div'); loader.style = "z-index: 9999; position: fixed;"; loader.classList.add('loader'); document.body.insertBefore(loader, document.body.firstChild); document.body.insertBefore(backGrey, document.body.firstChild); while (!localStorage.getItem('user-products') || localStorage.getItem('user-products') == 'null' ) { await new Promise(r => setTimeout(r, 2)); } setupFavouriteBtn(); setUpTerpeneColorsMap(); setupComponents(); checkLanguage(); filterProductSKUs(); initAddToCart(); setupRecommendedProducts(); backGrey.remove(); loader.remove();}async function changeQuantity(){ while(!document.getElementById('updates_product-template').value){ await new Promise(r => setTimeout(r, 2)); } var quantity = parseFloat(document.getElementById('updates_product-template').value); if(currentSkus && quantity){ setTimeout(()=>{ document.querySelector('.price-preview').innerHTML=formatter.format((parseFloat(currentSkus.skus.price)*quantity).toFixed(2)).replace("CA", ""); },500); } } async function getProductByHandle(){ while(!localStorage.getItem('user-products') || localStorage.getItem('user-products') == 'null'){ await new Promise(r => setTimeout(r, 10)); } var allProducts = JSON.parse(localStorage.getItem('user-products')); var current_handle = "mtl-cannabis-strawberry-n-mintz"; return allProducts.find((element) => { return element.handle == current_handle; } ); } async function AddBackEndVariants() { while(!document.querySelector(".product-select-input-page")) { await new Promise(r => setTimeout(r, 10)); } var selector = document.querySelector('.product-select-input-page') ; for (var i =0 ; i < selector.length ; i++){ selector[i].remove() ; i-- ; } var product = await getProductByHandle() ; if (product) { for (var i =0 ; i< product.skus.length ; i++){ createNewVariant(product.skus[i].shopify_id , product.skus[i].title ,i) ; } } var variants = document.querySelector('.amount-wrapper').children ; if (variants.length > 0) variants[0].click() ; } async function changeVariant(obj){ var index = parseInt(obj.getAttribute('index')) ; var buttons = document.querySelector('.amount-wrapper').children ; for (var i=0 ; i
Recommended Products
Are you 19 years of age or older?
18+ in Alberta and 21 + in Quebec
Sorry, you aren't of legal age to enter the webist
By entering this website, you certify that you are of legal consumption age in the province in which you reside