Auto-publish products tagged with the current day, with Mechanic.

Mechanic is a development and ecommerce automation platform for Shopify. :)

Auto-publish products tagged with the current day

Use this task to automatically roll out your products on specific days of the week. This task runs every midnight, in your shop's local timezone, and it scans your catalog for unpublished products tagged with the current day of the week (e.g. "Monday", "tuesday", etc).

Runs Occurs every day at midnight (in local time) and Occurs when a user manually triggers the task.

15-day free trial – unlimited tasks

Documentation

Use this task to automatically roll out your products on specific days of the week. This task runs every midnight, in your shop's local timezone, and it scans your catalog for unpublished products tagged with the current day of the week (e.g. "Monday", "tuesday", etc).

This task runs every midnight, in your shop's local timezone, and it scans your catalog for unpublished products tagged with the current day of the week (e.g. "Monday", "tuesday", etc).

You can also run this task manually, to publish any unpublished products tagged with the current day of the week.

Developer details

Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Shopifolks, everybody.

That’s why we make it easy to configure automation without code, why we make it easy to tweak the underlying code once tasks are installed, and why we publish it all here for everyone to learn from.

(By the way, have you seen our documentation? Have you joined the Slack community?)

Open source
View on GitHub to contribute to this task
Subscriptions
mechanic/scheduler/daily
mechanic/user/trigger
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Code
{% if event.preview %}
  {
    "action": {
      "type": "shopify",
      "options": [
        "update",
        [
          "product",
          1234567890
        ],
        {
          "published": true
        }
      ]
    }
  }
{% else %}
  {% assign dow_tag = "now" | date: "%A" | downcase %}
  {"log": {{ "Publishing unpublished products tagged with '" | append: dow_tag | append: "'" | json }}}

  {% for product in shop.products.unpublished %}
    {% assign product_tags = product.tags | downcase | split: ", " %}
    {% if product_tags contains dow_tag %}
      {
        "action": {
          "type": "shopify",
          "options": [
            "update",
            [
              "product",
              {{ product.id | json }}
            ],
            {
              "published": true
            }
          ]
        }
      }
    {% endif %}
  {% endfor %}
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more