Minimal Theme message in product when needing longer delivery

Kerry_M
Tourist
8 0 1

i have swapped over to minimal theme as it looks much better with my products. but i have one major problem.  

i really need on items that are 0QTY & 'continue selling when sold out' to come up with a message - Allow 2-3  weeks for delivery. 

 

nothing is working on this theme for me yet and i need this before opening my store.  

 

Kerry_M_0-1625929977502.png

 

 

i've attached a sample of what i need. 

Anthony_David_
Trailblazer
214 27 85

Hi @Kerry_M ,

 

Welcome to the Shopify Community!

 

I understand that you want to have a custom message show when there is 0 items in stock.

 

I may be able to help you with this. I've updated your code to show the message, but please do verify that it works as intended.

 

Note: For the code to work, you must have these options checked for the 0 inventory products:

 

Anthony_David1_0-1625930380138.png

 

Try this code:

if (variant.inventory_management) {
            // Show how many items are left, if below 10
            if (variant.inventory_quantity < 10 && variant.inventory_quantity >= 0 && this.settings.stockSetting == 'true') {
              if (variant.inventory_quantity == 0){
              let alert = '<span id="variantQuantity-product-template__message">Item available from a supplier. Allow 2-3 weeks to deliver.</span>'
              this.settings.selectors.$variantQuantityMessage.html(alert);
              this.settings.selectors.$variantQuantity.addClass('is-visible');
              }else{
              this.settings.selectors.$variantQuantityMessage.html(theme.strings.product.only_left.replace('1', variant.inventory_quantity));
              this.settings.selectors.$variantQuantity.addClass('is-visible');
              }
            }
          }

 

Hope this helps, Also do share your store url

Thanks

Shopify Expert - Theme customization | Design | Marketing | Product Sales
Hire Me: anthonyuidesigner@gmail.com
Whatsapp ( Click on number )- +33 6 28 93 62 05
0 Likes
twinkleppc
Excursionist
29 3 4

Hello, 

Please share your store URL & password. 

Best, 

R

Ravi Thakor
Digital Marketing Specialist | twinkleppc.co
email: ravi@twinkleppc.co
0 Likes
Kerry_M
Tourist
8 0 1

that code didn't work. it all stayed black. unless i'm putting it in wrong please. 

but to my understanding Minimal doesn't have (variant.inventory_management).

 

https://wjzbvhphinc6nhom-57190809775.shopifypreview.com

"fawbro"

 

 

 

0 Likes
Kerry_M
Tourist
8 0 1

the above codes didnt't work. unless i'm putting in the wrong place.

 

https://www.lustlocker.com.au/?key=58e069e86971a2e8c88deac76fcc0ce7f771c3fff31a8bad1aae33aa4df3fafe

"fawbro"

0 Likes