Skip to content

Latest commit

 

History

History

auto-generate-skus

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Auto-generate SKUs

Tags: SKU

Save time by letting this task keep your SKUs up to date, generating them based on your product handle, and the initials of each variant option. Optionally, choose to have the task skip updating variants that already have SKUs. Useful for large catalogs, or for anyone who has a consistent SKU format.

Default options

{
  "skip_variants_that_already_have_skus__boolean": true,
  "product_options_to_keep_unabbreviated__array": null
}

Learn about task options in Mechanic

Subscriptions

shopify/products/create
shopify/products/update

Learn about event subscriptions in Mechanic

Documentation

Save time by letting this task keep your SKUs up to date, generating them based on your product handle, and the initials of each variant option. Optionally, choose to have the task skip updating variants that already have SKUs. Useful for large catalogs, or for anyone who has a consistent SKU format.

Please note: This task updates SKUs for all products, whether or not they're configured with options and variants.

This task automatically maintains SKUs by combining these elements and joining them with a dash:

  1. The last portion of the product handle (e.g. 503, if your product is available at myshop.com/products/stylish-shirt-503)
  2. The capital letters of the variant's first option, if there is one (e.g. H if the option is Heather gray, or HG if the option is Heather Gray)
  3. The capital letters of the variant's second option, if there is one
  4. The capital letters of the variant's third option, if there is one

(To use the product option's full value, instead of abbreviating it, add the option name to the "Product options to keep unabbreviated" list.)

To illustrate, a shirt available at myshop.com/products/stylish-shirt-503, with options for size and color, might have these SKUs auto-generated:

  • Medium, Black: 503-M-B
  • XL, Heather gray: 503-XL-H
  • Small, Red: 503-S-R

To update your product handle, so as to control the first portion of generated SKUs, open the product in the Shopify admin, scroll to the bottom of the page, click the edit icon next to "Search engine listing", and update the "URL handle" field to taste. :)

Installing this task

Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.

Contributions

Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.

Task requests

Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!