Image
Arigato Automation
+
Update one or more product field values

Set URL (handle) to include SKU in Shopify by using Arigato Automation

Enhance your product URLs by automatically incorporating the SKU, ensuring efficient and organized product identification in your Shopify store.

This workflow fires when a product is created or updated. It combines the SKU of the product with the product's title. 

There are many variations you can do with this automation. For example, you could choose to set the URL (handle) to include a metafield or a tag instead of using the SKU. 

It's reassuring to know that Shopify handles any redirects that you might need when URLs change in your store.

Here are a few very handy tips that you should know about when customizing this automation

First, you should know that all products in Shopify use a one-to-many relationship. One product has many variants. This is hidden to the administrator in Shopify for the first variant but it becomes important in this case.

Since the SKU you set on the first product is actually attached to the first variant and not the product itself, you need to access that first variant to get the SKU. In the app, if you access the SKU token from the token browser, it will automatically give you a loop of all the variants, but we just want the first item in the loop, so we access that directly by going right for product.variants[0].sku

Image of SKU and ISBN in Shopify

You might also notice that we're not adding any hyphens in our setting. We're doing that because this is the most flexible approach and because Shopify handles it for us automatically.

For example, let's say that we don't have a SKU set on our product when it gets saved. Rather than the URL becoming something odd with a starting hyphen, instead, it naturally starts without a space or a hyphen and still looks right and works correctly.

Setting handle to SKU and Product Title

Usually, it's a good idea to include a condition on the workflow, so it doesn't fire if it doesn't need to. In this case, it can be challenging and requires some coding in the condition to account for the variations mentioned above. In order for the condition test to work, we need to create the entire handle, exactly as it would be done by Shopify. Let's break down our example with how that can be done.

Here's what you would enter into the condition to make sure that the workflow only fires when it needs to change the URL. Note that Arigato Automation uses Twig, not Liquid for syntax. Twig is very similar to Liquid.

{% set url = product.variants[0].sku ~ ' ' ~ product.title %} {{ url | to_handle }}

That's a bit much, let's think it through. We're creating a variable from the first item in the list of variants and taking the SKU from it. The next bit is adding a space in that variable (that's the ~ ' ' ~ part) then adding the title to it. Finally, our variable is printed while running it through our to_handle function to get the exact handle that Shopify would set.  

When a product is created or updated
+
Update one or more product field values
=
Workflow Completed

Create custom workflows to overcome unique challenges

Make your own flexible automations that conform to your needs with our easy-to-use workflow builder. 

Start now

Image

Craft the perfect message with dynamic content

Insert dynamic content from your Shopify store just about anywhere in the app.

Start Now

Image

Preview your work as you go

Pick a test item and see exactly what your work will look like when it goes live. 

Start Now

Image

Keep your trains running on time with scheduled workflows

Relax, Arigato will get those repeat tasks done while you sleep.

Start Now

Image

Roll up your sleeves and whip up a little (or a lot) of custom code

Zero in on exactly what you want out of the app with infinite possibilities in Custom Actions, HTTP Requests, Shopify Graph QL & Admin API requests.

Start Now

REVIEWS

Millions of Actions Served

See what other merchants have to say about how Arigato and the Bonify Team save them time & money and reduce headaches. 

See All Reviews

An absolute key app for us. Not only can you select the item/ order/ object you're interested in seeing (and get a full breakdown of the fields contained), but the preview of the information you're testing/ trying to output is essential to ensure an automation runs as intended!

Fairfax & Favor

I cannot rave enough about the Arigato automation app - it is an absolute must-have for any Shopify store looking to simplify operations. It has automated so many of our tasks, from sending B2B email notifications and updating customer data to managing inventory, creating custom metafields, updating collections, generating reports, the list goes on & on.

House of Léon

When I began using the Arigato Automation app, it was evident that this tool was a game-changer. Designed with utmost precision, it effortlessly bridges the gap between complex tasks and simplified automation, making it an indispensable ally for anyone looking to streamline their operations.

Jeans4you.shop

200% recommended! Seriously, you never know you needed Arigato until you actually use it. It is one of the most versatile and powerful tool on Shopify.

Patisserie La Lune

Ready to get started?

Sign up today for a 14 day free trial. Our world class support team is at your service. 

Get for Shopify