Skip to content

Latest commit

 

History

History

sync-inventory-levels-to-variant-metafields

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Sync inventory levels to variant metafields

Tags: Inventory, Metafields, Products, Sync, Variants

Use this task to easily make your inventory levels available in your online storefront theme. This task monitors for changes to inventory, and copies inventory availability figures to metafields on the related variant.

Default options

{
  "metafield_namespace__required": null,
  "location_ids_and_metafield_keys__keyval_required": null
}

Learn about task options in Mechanic

Subscriptions

shopify/inventory_levels/connect
shopify/inventory_levels/update
mechanic/user/trigger
mechanic/shopify/bulk_operation

Learn about event subscriptions in Mechanic

Documentation

Use this task to easily make your inventory levels available in your online storefront theme. This task monitors for changes to inventory, and copies inventory availability figures to metafields on the related variant.

This task runs automatically, whenever an inventory level is adjusted or whenever a variant is stocked for the first time at a new location.

Run this task manually to backfill metafields for all variants that are stocked in the locations you've configured in this task.

"Location IDs and metafield keys" is a keyval option, where the left-hand side (the key) should contain your location IDs, and the right-hand side (the value) should contain the "metafield key" that you want to associate with each location (e.g. "1234567890" <> "shop", "2345678901" <> "warehouse").

Learn how to find location IDs here.

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!