Jump to content

Looking for some help with a custom e-commerce solution. Remove quantity available from one store and not the other!

Recommended Posts

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
6 hours ago, tuanphan said:

I see you solved it?

image.png.0c2009e14e6f296a9e139381c6d4d35a.png

image.png.4cef131e49eb46fc996ce2da6fe50c8a.png

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

@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!

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
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. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.