Dylan Hunt Free Shopify Scripts and Shopify Liquid Tutorials

This site is a collection of guides for highly requested and searched features that you can do with Shopify, but there isn't a lot of documentation on. I love hearing comments and feedback on the current guides, how they can be made better, and what new ideas you would love to see.

I started learning to code while working at Shopify and I have been practicing a ton while working on a number of projects.

I plan to blog about HTML, CSS, JS, and Ruby on Rails. If there are any guides you would like to see, please reach out on the About page.

Happy Coding!

- Dylan Hunt

by: Dylan Hunt | Published: January 01, 2017 20:46

Just wanted to share this link with anyone that wants to get started with Digital Ocean. I use them for all of my hosting due to ease of use, simple interface and reliability. If anyone wants to get started here is a link that will give you a $10 credit upon signup which covers the first two months for a small droplet: Discount Link


by: Dylan Hunt | Published: December 08, 2016 16:42

There are a lot of people asking for more information on how to discount returning customers, so I wrote this script to give a discount based on the number of orders the customer has placed. This script is for people who have placed over 2 orders, and a platinum discount if you've placed over 5, but can be modified for any amount.
If you have any other scripts you're wondering about just ask in the comments.


by: Dylan Hunt | Published: November 30, 2016 16:48

This content is unfortunately outdated, and I have personally moved all of my retargeting to This site


Very commonly with Shopify Plus (since they give you up to 3 stores for internationalization), we will need to redirect people to other sites based on where they are. So here is a script you can use to automatically redirect someone to a separate domain if they are from a certain country:

This can also be done in a way that doesn't redirect them right away, but displays a popup asking them if they want to go to the other store.

Feel free to reach out to me directly for questions about further customization


by: Dylan Hunt | Published: November 28, 2016 02:13

I know its really annoying to add target="_blank" to every external link in your website, so I wanted to share this code you can use to make every link open in a new tab. Just put this code right above the closing tag in your theme.liquid. This guide is for Shopify, but you can modify it by replacing the {{ shop.url }} with your own URL.

Enjoy keeping people on your website longer!


by: Dylan Hunt | Published: November 21, 2016 00:12

When I was making this website I almost chose not to use gists because they wouldn't load for me with turbolinks, but then I was able to find a solution that works every time, and hopefully it is still working and you can read this post.

1. Change the formatting of your gists from the before to the after shown below:

2. Add this coffee script to your applications main js file

Note the turbolinks load function, that ensures it reloads EVERY TIME, not just when the page fully reloads

3. Add this styling so they look identical and the spacing formats the way you want it to

That's it, you're ready to load your github gists while keeping turbolinks on your site, and they look nearly identical.


by: Dylan Hunt | Published: November 10, 2016 22:29

People are charging a lot to make these, so with the help of OnlyGrowth I worked to make a ton of these that people can copy and paste to use on their stores. This is for Shopify Plus only right now.

More scripts can be downloaded on this site here: Liquid and Scripts

1. Getting started with Buy 2 Get 1 Free

2. Next we move on to Buy 1 Get 1 For $X

3. Want to give a % discount instead? Buy 1 Get 1 For X% Off

4. Love tiered pricing? Buy X quantity of a product, Get $Y off

5. More tiered pricing! Buy X quantity of a product, Get Y% off

6. Offer a discount on a certain product Tag! X% off all products with Y tag

7. More product tag discounts! $X off all products with Y tag

8. Spend at least $X (value in cart), Get $Y off

9. Spend at least $X (value in cart), Get Y% off

10. Get $X off on first purchase

11. Get X% off on first purchase

12. Have purchased at least X orders, Get Y% off

13. Have purchased at least X orders, Get $Y off

14. X$ off if customer accepts marketing

15. % off on W if X, Y, Z in cart

15. $ off on W if X, Y, Z in cart


Need help implementing any of these guides?

Contact Me