Guides

How to put discounted or high-margin products first in Shopify collections

Updated October 10, 2026

During a sale, the best deals should be the first thing shoppers see. The rest of the year, you may prefer to show the products that earn you the most. This guide shows how to sort collections by discount or by margin, automatically.

SortDiscount Percentage 8 + Stock Availability 6

Highlight your best deals

For a sale, create a sort with:

  • Discount Percentage, descending, weight 8: the biggest discounts come first.
  • Stock Availability, descending, weight 6: no sold-out deal at the top.

Other discount criteria

  • Discount Status: separates discounted products from the others, without ranking discounts between themselves.
  • Discount Amount: ranks by savings in money (compare-at price minus price).

Favor your most profitable products

Outside sales periods, add Profit Margin to your usual sort with a moderate weight, for example 3, next to Recent Sales and Stock Availability. Between two products that sell equally, the more profitable one comes first.

Profit Margin uses the Cost per item of your variants. Fill it in Shopify for every product, otherwise the price is used as the margin.

Switch after the sale

Create a separate sort for the sale and deactivate it when the sale ends; your usual sort takes over at its next run.

Frequently asked questions

How does MDPositions detect a discount?

From the compare-at price. A product is discounted when its compare-at price is higher than its price. Discount codes and automatic discounts applied at checkout are not taken into account.

How is the profit margin calculated?

Price minus cost, using the Cost per item set on your variants in Shopify. If a product has no cost, its price is used instead, so fill in costs for this criterion to be meaningful.

Percentage or amount?

Discount Percentage favors big relative discounts, often on cheaper items. Discount Amount favors big savings in money, often on expensive items. Pick the one that matches your campaign message.

Related guides