Automatically Change Featured Product By Tag?

So we have a weekly sale on a single item which is displayed on our homepage using the Featured Item… box… thing? (Technical term, I am obviously quite savvy.) The item changes every week, and the sale part is done automatically through the Sales & Discounts app. What I’d like to do, is also have that featured listing automatically change on the homepage so I don’t have to be manually switching it at exactly 6pm on the dot every week. The app can apply (and remove) tags to the listing for the duration of the sale.

So (tl;dr) my question is, is there anyway to have the item in the Featured Item box thing display based on my WEEKLY-SALE tag?

If that makes sense? I’m probably make this a lot more complicated than it needs to be lol. I seem to only be able to set by specific item and not by tag. Or if there’s any other way to achieve this?

Thanks in advance for any help!

Hey Josh, I absolutely need further assistance! Lol. That would be great, if this is something you know how to do, I need all of the help, thanks so much!

Oh, sorry, I’m not really comfortable with that :sweat_smile: I thought you meant it was something you could walk me through here.

My mistake, thanks for your time anyway!

That would be great :blush: If you don’t mind providing the code, I could make the adjustments to my theme files myself. I really appreciate your help!

You’re right that doing this purely in the theme gets messy fast, especially if it’s changing on a schedule.

A cleaner approach is to separate logic from display:

• Use automation to control a product tag (e.g. featured-weekly)
• Let your theme show the featured product based on that tag

That way you’re not editing theme code every time the featured product changes, the theme just reacts to the tag.

Some merchants handle the tagging side with a rule-based tagging app that can automatically add/remove a tag on a schedule or based on conditions (price changes, collections, manual flags, etc.), and then keep the homepage in sync.

It’s much easier to maintain long-term than hard-coding featured products directly into the theme.

@cpk_jenna

Which Shopify theme are you using? Please share the theme name. If possible, please share your featured product section code.

Thanks!

There is no simple solution to this without coding.

The simplest option would be to create a collection to include products tagged with this tag, then create a copy of the “Featured product” section where the product will be fetched not from the section settings, but rather “first product of that collection”.

When tag is removed from the old special product and set on the new special, the collection will auto-update and the code will pick up a new product.

You can also simply use “Featured products” section and use that same collection – this would show new product card every week, but would not be a full “featured product” section experience, rather a link to that product.

Finally, there is a cumbersome solution without code editing:)

You can use a Dynamic Source to define a product for the “Featured product” section.
The reference can come from the metaobject in the store.
So you can create a Flow which will run weekly, find a product by tag and update that metaobject with reference to this newly found product.
This would work with any 2.0(supporting dynamic sources) theme