
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.

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.

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.

Setting up Cash on Delivery (COD) with a fee can be tricky for Shopify merchants. But with the Payflow app, it’s easy! Streamline the process and create a smooth, hassle-free experience for your customers—without the stress.

Displaying sold-out products can lead to frustration for customers who are looking for available items. In this guide, we will show you how to hide sold-out products from your Shopify collections entirely by modifying your theme code.
Interested in collaborating on a project?