Accessing Unavailable Products with Liquid

Highlighted
New Member
4 0 0

Hello,

I am trying to figure out how to have a product that is unavailable to customers, but has inventory, that I can access in product_template.liquid to check how many are left.

all_products['handle'] won't work if the product is unavailable but making the product available makes it so the customer has access to that product.

 

Does anyone know of a way to access unavailable products through code, or a way to hide a product from the customer when it is marked available?

-Andy

0 Likes
Highlighted
New Member
7 0 0

we can edit the product template file by liquid with help of adding tags to product and make that product available or not available based on tag.
I can help you on this you can have a look on my proven work record at https://upwork.com/fl/niraj1420

0 Likes
Highlighted
Shopify Partner
594 71 98

@arnedirlelwy 

Hi Andy,

You can simple create an alternate product template which basically doesn't; do anything and assign all such products, you want to make unavailable to this template.

Please see the documentation on how to create alternate template here, if you already do not know

https://shopify.dev/tutorials/customize-theme-create-alternate-templates

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution

Skype : lokendra.panwar1

To hire: email us at shopify@propero.in
0 Likes
New Member
4 0 0

If I am following correctly, that just changes the way the product page looks but the product still shows up on my Products page. Am i missing a step? 

 

For context:

What I am trying to achieve is a backorder system. So my actual product, when a variant inventory reaches 0, it checks a backorder inventory (the hidden version of the product), and then allows the customer to backorder the item. This way I can limit the amount of total backorders without limiting quantity for each variant. Basically a global pool of backstock with a limitation on total ordered.

0 Likes