kbradfield Posted September 23 Share Posted September 23 Site URL: https://www.moffattgracedesign.com/home-collection Hello! I recently had a custom solution created for a clients site by a developer who reached out via this forum. I can no longer get ahold of them and need one last thing changed that I can't quite figure out. I'm looking for someone who understands code/custom solutions on SS to help me out with 1 last task. The developer created 2 stores within one website for us. One operates as a regular ecommerce store, the other as a quote builder. I need the quantity (i.e. inventory available) shown on one store and removed from the other. Two stores are here: https://www.moffattgracedesign.com/staging-rentals-store (Password: StagingRentals2024) https://www.moffattgracedesign.com/home-collection On the Staging Rentals, I need the quantity left as it is. On the Home Collection shop, I want it removed but also to have scarcity tags like "Only 3 left!". Is there anyone here who can help me out? Happy to give contributor access to someone who can help. Thank you!!! Link to comment
tuanphan Posted September 24 Share Posted September 24 I see you solved it? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
kbradfield Posted September 24 Author Share Posted September 24 6 hours ago, tuanphan said: I see you solved it? Thanks for responding! No unfortunately I haven't. What I need is the "1 available" indicator to NOT show on the Home Collection store. What should show on the Home Collection store is "scarcity indicators" like "only 1 left!" but only if the stock is under 2. Do you think you'd be able to help with that please? 🙂 Link to comment
Lesum Posted September 24 Share Posted September 24 @kbradfield Hi! Can you try adding this code in Website > Pages > Website Tools > Code Injection > Footer? Add the code at the very end of everything you currently have in the Code Injection > Footer section. <script> $(document).ready(function() { $('.collection-668d941b0e76433a1f2404fe .product-scarcity').each(function() { var scarcityText = $(this).text().trim(); var availableNumber = parseInt(scarcityText); if (availableNumber > 1) { $(this).hide(); } else if (availableNumber === 1) { $(this).text('Only 1 left!'); } }); }); </script> Let me know how it goes! tuanphan 1 If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee? Link to comment
kbradfield Posted September 24 Author Share Posted September 24 45 minutes ago, Lesum said: @kbradfield Hi! Can you try adding this code in Website > Pages > Website Tools > Code Injection > Footer? Add the code at the very end of everything you currently have in the Code Injection > Footer section. <script> $(document).ready(function() { $('.collection-668d941b0e76433a1f2404fe .product-scarcity').each(function() { var scarcityText = $(this).text().trim(); var availableNumber = parseInt(scarcityText); if (availableNumber > 1) { $(this).hide(); } else if (availableNumber === 1) { $(this).text('Only 1 left!'); } }); }); </script> Let me know how it goes! That worked!!! Thank you soo so much I really appreciate your help. Lesum 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment