How do I hide Cash on Delivery by order history?
On this page
Four conditions look at the customer behind the checkout:
- Customer orders: how many orders the logged-in customer has placed in your store. Use a Maximum of 0 for first-time buyers.
- Customer total spent: what the logged-in customer has spent in your store, in your store currency.
- Open COD orders: the customer’s Cash on Delivery orders of the last 60 days that are not cancelled, not archived and not fully fulfilled.
- Cancelled COD orders: the customer’s cancelled Cash on Delivery orders of the last 60 days.
Example: no Cash on Delivery after a cancelled COD order
- Open Rules and click Add rule. Name it, for example, “No COD after a cancelled COD order”.
- Click Add condition, choose Cancelled COD orders and enter a Minimum of 1.
- Under Action, keep Hide payment methods, set Name match to Name contains and enter
Cash on Deliveryas Name text. - Turn on Switched on, click Save, and make sure the Payment methods card on Rules is turned on.
The preset Hide COD while a COD order is open builds the same kind of rule with Open COD orders.
Where the COD counts come from
Each time an order is created, updated or cancelled, the app reads that customer’s orders of the last 60 days and counts the Cash on Delivery orders that are open and the ones that were cancelled. It saves the two numbers on the customer in your store, where checkout reads them.
- Open means the order is not cancelled, not archived and not fully fulfilled. Fulfil, archive or cancel an order and it stops counting as open.
- Cancelled counts every cancelled Cash on Delivery order. When a buyer refuses a Cash on Delivery parcel at the door, cancel the order in Shopify so it counts. A refund or return alone does not count.
- An order counts as Cash on Delivery when one of its payment names contains one of the names under Settings › Cash on Delivery names (without letter case). The list starts with common names such as “Cash on Delivery” (which also counts Shopify’s “Cash on Delivery (COD)”), “Nachnahme”, “Contrassegno”, “Pobranie” and “Ramburs”; add the names your store uses and click Save in the save bar at the top of the page. When you use the Hide COD while a COD order is open preset with a payment method these names do not count, the preset warns you.
- Only orders of the last 60 days count. When the oldest counted order turns 60 days old, the app counts that customer again, so a cancelled order stops hiding Cash on Delivery after 60 days.
- Counting only runs while the Payment methods card is turned on and a switched-on rule uses Open COD orders or Cancelled COD orders. When you save new Cash on Delivery names or switch such a rule on again, the app counts every customer that already has counts again. A customer whose orders the app has not counted yet is counted the next time one of their orders is created, updated or cancelled.
- The app’s server keeps only the customer ID and the date of the next count for customers whose counts are not zero; the orders themselves are never stored.
Guests
A buyer who is not logged in has no order history at checkout: rules see a customer with no orders, no spending and no COD orders. To treat guests differently, add a Customer login condition, for example “The buyer is not logged in”, to its own rule.