How to activate the quantity button - Publisher Theme

Solved

How to activate the quantity button - Publisher Theme

randytheasian
Explorer
115 0 23

URL: https://jsdqft-gs.myshopify.com/cart

Increase and decrease button is not clickable. 

 

Screenshot 2024-12-22 at 4.07.42 PM.png

Accepted Solution (1)
Guleria
Shopify Partner
3954 791 1123

This is an accepted solution.

Sorry!
Please use this updated code

<script>
document.addEventListener("DOMContentLoaded", function () {
  // Select all buttons with the specific class
  const buttons = document.querySelectorAll('button.quantity__button');

  // Loop through the buttons and remove the 'disabled' attribute
  buttons.forEach(button => {
    if (button.hasAttribute('disabled')) {
      button.removeAttribute('disabled');
    }
  });
});
</script>
<style>
button.quantity__button {
    pointer-events: visible !important;
}
</style>

 

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder

View solution in original post

Replies 7 (7)

randytheasian
Explorer
115 0 23

Is this FOC?

TheUntechnickle
Shopify Partner
193 20 34

Yes, it is 🙂

Oh, and there’s something brewing behind the scenes that’s redefining customer experience. Curious? It’s time to Revize your store. Don’t say we didn’t warn you. 

Guleria
Shopify Partner
3954 791 1123

Hello @randytheasian ,

 

Edit theme.liquid search for </body>

Now here just before to it add this code

<script>
document.addEventListener("DOMContentLoaded", function () {
  // Select all buttons with the specific class
  const buttons = document.querySelectorAll('button.your-class');

  // Loop through the buttons and remove the 'disabled' attribute
  buttons.forEach(button => {
    if (button.hasAttribute('disabled')) {
      button.removeAttribute('disabled');
    }
  });
});
</script>
<style>
button.quantity__button {
    pointer-events: visible !important;
}
</style>

 

Regards
Guleria

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
randytheasian
Explorer
115 0 23

It didn't work

Guleria
Shopify Partner
3954 791 1123

This is an accepted solution.

Sorry!
Please use this updated code

<script>
document.addEventListener("DOMContentLoaded", function () {
  // Select all buttons with the specific class
  const buttons = document.querySelectorAll('button.quantity__button');

  // Loop through the buttons and remove the 'disabled' attribute
  buttons.forEach(button => {
    if (button.hasAttribute('disabled')) {
      button.removeAttribute('disabled');
    }
  });
});
</script>
<style>
button.quantity__button {
    pointer-events: visible !important;
}
</style>

 

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder
randytheasian
Explorer
115 0 23

Worked for 5 seconds, it stopped working

Guleria
Shopify Partner
3954 791 1123

Please update the code with this one

<script>
document.addEventListener("DOMContentLoaded", function () {
setTimeout(() => {
  // Select all buttons with the specific class
  const buttons = document.querySelectorAll('button.quantity__button');

  // Loop through the buttons and remove the 'disabled' attribute
  buttons.forEach(button => {
    if (button.hasAttribute('disabled')) {
      button.removeAttribute('disabled');
    }
  });
}, 3000);
});
</script>
<style>
button.quantity__button {
    pointer-events: visible !important;
}
</style>

 

btw I observe there is an app, I think booking one which disable the buttons.

You need to discuss the issue with them.

 

Regards
Guleria

 

 

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder