Move out of stock products to the end of the catalog product list

ctsimon
New Member
7 0 0

I need to push out of stock products to the end of catalog list

Please guide me how to solve this problem, or that file to dig. Our organization can't use an app and it takes several months to vet an app before we can install in admin.

I found this app which has the features that i am looking for: https://apps.shopify.com/push-down-hide-out-of-stock

Replies 3 (3)
PaulNewton
Shopify Partner
3442 226 664

Merchants that need a customization like this can contact me at paull.newton+shopifyforums@gmail.com  with this topic url, store-url, theme name and any relevant use-case details.

Always backups themes and files before making changes!

For collections with more than 50 products you have to adjust the pagination per product skipped which gets a more advanced than the simpler instructions for <50.

 

For collections with less than 50 products! find the productloop in the relevant collection template and duplicate it so there are two loops one after the other.

i.e. {% for product in collection.products...

Careful do not put one loops codes in the other look for the correct closing {% endfor %} tags, follow the nesting methodically.

In the first loop, after the opening {% for %} tag , skip any products that are not available 

 

{%- unless product.available -%} {%- continue -%} {%- endunless -%}

 

In the second product loop, after the opening {% for %} tag , skip any products that are available 

 

{%- if product.available -%} {%- continue -%} {%- endif -%}

 

 

 

 

If you need regular things like this and approval takes awhile get an automation app like usemechanic

https://tasks.mechanic.dev/move-out-of-stock-products-to-the-end-of-a-collection 

 

Join the discussion - What was learned this Black Friday?


Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org

Problem Solved? ✔Accept and Like solutions to help future merchants

Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
ctsimon
New Member
7 0 0

Thanks, how would i do it for this site? I couldn't find a collection.product file 
https://www.woodscanada.com/

PaulNewton
Shopify Partner
3442 226 664

Which file has the correct product loop varies wildly by theme.

Look for code similar to what I posted already:

i.e. {% for product in collection.products...

Join the discussion - What was learned this Black Friday?


Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org

Problem Solved? ✔Accept and Like solutions to help future merchants

Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com