news

Saturday, August 27, 2022

Victoria Myers

Good morning lovely knitters!  If yesterday was any indication, loads of you took your kids off to college this last week and now, instead of spending hours doing laundry and helping them pack, you can knit!!  Heeee!  And if you are missing them too much, you can always start a snuggly blanket for those dorm rooms and that'll definitely help!

And we've got a bunch of NEW Mad Balls for you!!

We also received NEW Katia Cotton Merino Glam - sorry that I didn't get it online yet (I've got a visitor this weekend), so you'll have to pop in and see this sparkly delight!

I've also started dyeing for our wildly popular Hilo Temperature Cowl kit - the kits are quite ready yet, but as it is a pretty time consuming process I'm trying to get an early start because I have no idea how much time I'll really have when the blissfull cool breezes of fall blow in!  If you want a Hilo kit - pre-order one now!  Also, if you are working on one and are running out of a color, there's now an option to order bonus mini skeins.  The weather never likes to behave quite the way we think!

There's also only a few days left to grab a Starburst Kit while it is still our featured pattern!  SO pretty and fun - you'll love it!

 

Island Yarn 
189 Main Street
Maynard, MA  01754
Hours: Wednesday 12 - 5, Thursday 12 - 6, Friday and Saturday, 12-5

Leave a Comment

Please note, comments must be approved before they are published

const selectVariantByClickingImage = { // Create variant images from productJson object _createVariantImage: function (product) { const variantImageObject = {}; product.variants.forEach((variant) => { if ( typeof variant.featured_image !== 'undefined' && variant.featured_image !== null ) { const variantImage = variant.featured_image.src .split('?')[0] .replace(/http(s)?:/, ''); variantImageObject[variantImage] = variantImageObject[variantImage] || {}; product.options.forEach((option, index) => { const optionValue = variant.options[index]; const optionKey = `option-${index}`; if ( typeof variantImageObject[variantImage][optionKey] === 'undefined' ) { variantImageObject[variantImage][optionKey] = optionValue; } else { const oldValue = variantImageObject[variantImage][optionKey]; if (oldValue !== null && oldValue !== optionValue) { variantImageObject[variantImage][optionKey] = null; } } }); } }); return variantImageObject; }, _updateVariant: function (event, id, product, variantImages) { const arrImage = event.target.src .split('?')[0] .replace(/http(s)?:/, '') .split('.'); const strExtention = arrImage.pop(); const strRemaining = arrImage.pop().replace(/_[a-zA-Z0-9@]+$/, ''); const strNewImage = `${arrImage.join('.')}.${strRemaining}.${strExtention}`; if (typeof variantImages[strNewImage] !== 'undefined') { product.variants.forEach((option, index) => { const optionValue = variantImages[strNewImage][`option-${index}`]; if (optionValue !== null && optionValue !== undefined) { const selects = document.querySelectorAll('#'+ id + ' [class*=single-option-selector]'); const options = selects[index].options; for (let option, n = 0; (option = options[n]); n += 1) { if (option.value === optionValue) { selects[index].selectedIndex = n; selects[index].dispatchEvent(new Event('change')); break; } } } }); } }, _selectVariant: function() { const productJson = document.querySelectorAll('[id^=ProductJson-'); if (productJson.length > 0) { productJson.forEach((product) => { const sectionId = product.id.replace("ProductJson-", "shopify-section-"); const thumbnails = document.querySelectorAll('#'+ sectionId + ' img[src*="/products/"]'); if (thumbnails.length > 1) { const productObject = JSON.parse(product.innerHTML); const variantImages = this._createVariantImage(productObject); // need to check variants > 1 if (productObject.variants.length > 1) { thumbnails.forEach((thumbnail) => { thumbnail.addEventListener('click', (e) => this._updateVariant(e, sectionId, productObject, variantImages), ); }); } } }); } }, }; if (document.readyState !== 'loading') { selectVariantByClickingImage._selectVariant(); } else { document.addEventListener( 'DOMContentLoaded', selectVariantByClickingImage._selectVariant(), ); }