
How to Set Discounts for Card Payments Only on Shopify 💳
Learn how to create conditional discounts based on payment method in Shopify. Hide COD, target prepaid payments only, and control when discounts apply using Payflow.


If you have products that are currently out of stock, it can be beneficial to display them at the end of the product list in your collection. This way, you ensure that customers see the available items first, followed by the out-of-stock products. In this article, I will show you how to easily achieve this by modifying the code in the collection template on Shopify.
Customers often want to see available products and make quick decisions about what they can buy. Having sold-out products at the top of the list can be frustrating and time-consuming. Even if a product is sold out, it may still be important to display it, but it shouldn't be a priority. That's why it's a good idea to place sold-out items at the end of the list.
{% for product in collection.products %}.{% assign available_products = collection.products | where: 'available' %}
{% assign out_of_stock_products = collection.products | where: 'available', false %}
{% assign products = available_products | concat: out_of_stock_products %}
{%- for product in products limit: section.settings.products_count -%}
<!-- Your code for displaying products -->
{%- endfor -%}This code splits the products into available and sold-out, then merges them back into a single list. Sold-out products will appear after the in-stock ones.
This modification will help keep your collections organized and user-friendly. Customers will be able to browse available products more easily without being distracted by sold-out items.
If you want to ensure that sold-out products don't appear in collections at all, we also have a detailed guide for that. In the article How to completely hide sold-out products in Shopify collections, you'll learn how to make this adjustment just as easily and quickly by modifying the template.
Moving them keeps sold-out products visible — useful for SEO and for customers who still want to see them — while making sure available items appear first so shoppers can decide quickly.
No. A small theme code edit splits the collection into available and out-of-stock products and merges them back so sold-out items show last. It avoids monthly fees and the extra manual collections many apps create.
In your collection template — often collection.liquid, main-collection.liquid, or main-collection-product-grid.liquid — replace the product loop with the version that concatenates available products followed by out-of-stock ones.
No. It is a lightweight Liquid change rendered with your theme, so there is no app overhead or extra background syncing.

Learn how to create conditional discounts based on payment method in Shopify. Hide COD, target prepaid payments only, and control when discounts apply using Payflow.

By adding a payment QR code, you let customers from the Czech Republic and Slovakia pay easily by transfer right after completing their order. Setup in the Payflow app is simple and can be done in just a few minutes.

Streamline your Shopify store with Mailstep thanks to automatic COD rounding, EUR COD processing for Slovakia, fixing faulty shipments, and the Globe app for pickup points.

Chargebacks can cause significant financial losses for online stores. In this article, we'll show you how to effectively minimize the risk of fraudulent transactions using the right payment settings and automation in Shopify Flow.
Interested in collaborating on a project?