Hide products after a date has passed

Solved

Hide products after a date has passed

AmyJade
Tourist
3 0 2

Hi,

 

Apologies if this is an easy question, but I am new to shopify flow and I can see that it should be able to do what I want, but can't quite parse how.

 

My store sells a lot of event tickets (eg ticket to attend on 25/09/24). Currently I'm manually going in on the 26th to hide that product from the store to try and prevent the store getting too much clutter. Being human, I forget sometimes.

 

What I'd really like is a way to check my products for the event tag to see if it's an event, then check if the date it was tagged (SKu'd? don't really mind) with was yesterday's date (todays date and check at 11pm would also work?) and if so hide it.

Accepted Solution (1)

RPiii
Shopify Staff
44 7 17

This is an accepted solution.

One way to do this might be to create a product metafield definition for the event date and then include that value when defining the event in your shop. Then you could have a workflow that runs (and repeats) at a scheduled time, gets product data, and then for each returned product checks if the value of the event date metafield on the product is before the scheduled time the workflow ran and then hides the product (or deletes the product).

23-09-d8fhf-kej3x

View solution in original post

Replies 4 (4)

Kalen_Jordan
Shopify Partner
727 34 127

Do you already have the event's date as a tag or as the sku on the product?

AmyJade
Tourist
3 0 2

Currently no, but It would be a trivial matter to do so manually when creating the products.

RPiii
Shopify Staff
44 7 17

This is an accepted solution.

One way to do this might be to create a product metafield definition for the event date and then include that value when defining the event in your shop. Then you could have a workflow that runs (and repeats) at a scheduled time, gets product data, and then for each returned product checks if the value of the event date metafield on the product is before the scheduled time the workflow ran and then hides the product (or deletes the product).

23-09-d8fhf-kej3x

AmyJade
Tourist
3 0 2

Great, that looks like it should work, I've put it on one item to see if it runs over night, fingers crossed.