Witty and insightful observations on the world? Sorry to disappoint, this is a techie blog purely for self reference - published online in the hope it will help others!

Post Affiliate Pro Shopify Saletracking

Post Affiliate Pro have a plugin for Shopify and a handy guide here -> https://www.postaffiliatepro.com/integration-methods/integration/shopify/ There are a few issues with their plugin though. Firstly there's no option to include a Campaign ID, so your clicks will default back the default campaign. Not too much of a problem if you don't have any commissions on clicks, but it is an issue if you do (and a big issue if your rates are different between campaigns). I've made a feature request (this is a bug imo though) to Quality Unit Support, maybe it'll get fixed by the time you read this. In this case you'd have to add the click tracking script into the theme, which is a ... Read more

Setting up Shopify on Theme Kit

The Shopify documentation is very thorough. That said, however extensive documentation is, there is always room for confusion. Let's take the set up for ThemeKit. You've created your private app in both your development site in your Shopify partners account, and also the live site What issues might confuse you. Let's work through them; Theme Id What is it? My first thought was that I had to generate this ID myself, but of course it has ... Read more

Shopify – Close Drawer On Scroll

It's obviously a design decision that's been taken at some point - when you open the cart drawer on Timber scrolling is disabled. Can't say I agree with it though, it's more usual UX to have a minicart or drawer close when the user starts scrolling. To re-enable scrolling you need to remove; From assets/timber.scss.liquid. I've used this answer to add a timer to stop the scroll event firing all the time and affecting performance. var scrollTimer = null; $(window).scroll(function () { if (scrollTimer) { clearTimeout(scrollTimer); // clear any previous pending timer } scrollTimer = setTimeout(handleScroll, 100); // set ... Read more

Shopify – Updating Cart Drawer When Open

Note: This applies to themes built on Timber, it may not work on your theme. This was easy to fix, but only because user Benecke who opened an issue on GitHub was good enough to come back later and update what he did to actually fix the issue. The only thing worse than not doing that is coming back and writing Thanks, problem solved! without actually explaining what they did to solve it. Damn those fools to hell!! https://github.com/Shopify/Timber/issues/618 And you'd include that at the end of the $.ajax({}) method in the snippets/ajaxify-cart.liquid file; // Add to cart. $.ajax({ url: _config.shopifyAjaxAddURL, dataType: 'json', type: 'post', data: $addToCartForm.serialize(), success: ... Read more

Exclude Variant Images in Shopify

To my chagrin, I cannot now find the post where I got this code - unknown generous developer, I apologise. This kind of illustrates a point though - I got lucky finding that post. If you are reading this, you got lucky finding this post. In terms of organisation, curation and outright findability, Shopify University is no Stackoverflow, that's for sure. There are even people selling Apps at $5 a month for this simple code change. You've got a product, you have product variants, those product variants have images, you don't want those images appearing in the main carousel/gallery for the product. So, how do you exclude product variant images in the product.liquid template? Easy; {% for image in product.images %} ... Read more

Advanced Custom Fields in Shopify

If you've spent any time developing Wordpress themes you'll more than likely have come across Advanced Custom Fields by Ellion Condon. Being a hater of content builder plugins I remember being resistant to it when I was first shown it by another developer. In the end I bought the Pro licence and I've used it on every theme I've built since. It's the first plugin I install, I find it indispensible. So when I started building Shopify themes, and realised pretty quickly that the theme structure was very similar to Wordpress, I looked for a way to handle meta data based options in the Shopify backend. Step forward Read more