SafeSale · Blog

Mixing collections, tags and vendors in one Shopify sale

What happens when a sale targets a collection, a tag and a vendor at once: the OR rule, why nothing is discounted twice, and how the variant cap counts.

Most sales start with one target. Twenty percent off the Summer collection. Then marketing asks for the clearance tag to be included, and the buyer asks whether the one brand that agreed to co-fund the promotion could ride along too. Now the sale targets a collection, a tag and a vendor, and the obvious question is what the app does with a product that matches more than one of them.

This post explains how SafeSale combines mixed targets, which products end up in the preview, why a product that matches twice is not discounted twice, and where the per-sale variant limit comes into it.

The four kinds of target

A SafeSale sale can be pointed at any mix of four things. Products, picked one by one in the Shopify resource picker. Collections, picked the same way, manual or automatic. Tags, typed as text. Vendors, also typed as text. Each of these is a list, and each list can be empty.

Under the hood the app turns the four lists into a single Shopify product search. Each product ID becomes an id: clause, each collection a collection_id: clause, each tag a tag: clause and each vendor a vendor: clause. Tag and vendor values are quoted, so a vendor called North Shore Supply Co. or a tag with a space in it is matched as a whole, not word by word.

Targets are joined with OR, not AND

This is the part worth remembering. The clauses are joined with OR. A product is in the sale when it matches any one of the selections. Add a tag to a sale that already targets a collection and the sale grows; it never shrinks. There is no way to express "products in this collection that also have this tag" from the SafeSale editor, and that is deliberate: AND semantics in a bulk price tool tend to produce sales that silently cover far fewer products than the person setting them up expected.

If you genuinely need the intersection, Shopify already has the tool for it. Create an automatic collection with two conditions, for example Product tag is equal to clearance and Product vendor is equal to the brand, and target only that collection. The collection does the narrowing; the sale stays simple.

What happens to a product that matches twice

Take a hoodie in the Summer collection, tagged clearance, made by the co-funding vendor. It matches all three targets. Shopify returns it once from the search, SafeSale lists it once in the preview, and each of its variants carries exactly one rule: the sale's percentage, or a per-variant override if you set one. There is no stacking, because there is nothing to stack. A target is a reason for a variant to be present, not a discount of its own.

That also means the preview is the honest count. If three targets overlap heavily, the preview will be much shorter than the sum of the three lists, and that is correct. The table in the editor is the list of variants that will actually change, with their current price next to the price the sale would set, so the overlap is visible before you publish rather than discovered in orders afterwards.

Two things that never make it in

  • Gift cards. Every catalog search the app runs is wrapped in gift_card:false. A gift card product tagged clearance by accident, or filed under a vendor you target, is skipped. We wrote about why in gift cards during a Shopify sale.
  • Everything, when no target is set. A sale with four empty lists matches nothing. The app does not fall back to the whole catalog. If you want the whole catalog on sale, target the All products collection or a collection that covers it, so that the decision is explicit and shows up in the sale's record.

How the variant cap counts mixed targets

Each plan caps how many variants one sale may touch: 2,000 on Starter, 20,000 on Pro. The cap is applied to the deduplicated list, the same list the preview shows. A product matched by three targets uses its variants once. When a sale is over the limit, the message says how many variants it has and what the plan allows, so the fix is to drop a target, split the sale, or move up a plan. The reasoning behind having a hard limit at all is in the hard cap and confirmation threshold settings.

One practical consequence: a vendor target is a cheap way to add a lot of variants. A brand with 40 products in eight sizes is 320 variants in one line of the editor. If a mixed sale comes back over the cap, the vendor list is the first place to look.

Mixed targets in each mode

In automatic discount mode SafeSale passes the resolved product IDs, collection IDs, tags and vendors to the discount function, which applies the same OR rule at checkout: a line qualifies when its product matches any of them. Prices in the catalog never change, and the discount shows as a line on the cart. In price-rewrite mode the app walks the deduplicated variant list and writes the sale price and compare-at price to each variant, in batches of up to 250 variants per product, then restores every one of them from its snapshot when the sale ends. Which of the two modes suits a given promotion is covered in automatic discount versus compare-at rewrite.

A sensible way to build a mixed sale

  • Start with the widest target and read the preview count. For a brand promotion that is the vendor; for a seasonal sale it is the collection.
  • Add the narrower targets one at a time and watch how much the count moves. A tag that adds three variants is probably already covered by the collection, and leaving it out keeps the sale easier to explain later.
  • Scan the preview for lines that should not move and give them a fixed-price or 0% override, as described in the single-brand sale post.
  • If the count is over your plan cap, split by target rather than by hand: one sale for the collection, one for the vendor, same dates.

Mixed targets are the normal case, not the edge case, and the rule behind them is short: any match brings a product in, every product is counted once, gift cards stay out. SafeSale shows you the resulting list before anything is published, so the overlap is something you read, not something you guess.

Frequently asked questions

If a product is in two targeted collections, is it discounted twice?

No. The targets are combined with OR, so a product that matches a collection, a tag and a vendor at the same time is matched once and appears once in the preview. A sale has one rule per variant, and that rule is applied one time, whichever target brought the variant in.

Does adding a tag narrow the sale to products that also match the collection?

No, it widens it. Every selection you add to a SafeSale sale is another way into the sale, not another condition a product must satisfy. If you need the intersection, build an automatic collection in Shopify with both conditions and target only that collection.

Are gift cards ever included when I target a tag or a vendor?

No. SafeSale adds gift_card:false to every catalog search it runs, so a gift card product is skipped even if it carries the tag or belongs to the vendor you selected. Customers can still spend gift cards during the sale as usual.

How does the per-sale variant limit count a product matched by two targets?

Once. The limit (2,000 variants per sale on Starter, 20,000 on Pro) is checked against the deduplicated list of variants the preview shows, so overlapping targets never inflate the count. If a sale is over the limit, the error names the number of variants and the plan cap.