All things Shopify and commerce
When I click on add to card or buy it now, disappear for 1 sec and appear again.
Solved! Go to the solution
This is an accepted solution.
It's like a third-party app has created the file portable-wallets.en.js and it's being served through a CDN instead of existing within your theme, hmm.
I have an alternative solution. Please add the code below to the end of the product-form.js file.
(() => {
setTimeout(() => {
if(location.pathname.includes("/products/")) {
const targetNode = document.querySelector('.shopify-payment-button__button');
const config = { attributes: true, attributeFilter: ['aria-disabled'] };
const callback = function(mutationsList, observer) {
for(let mutation of mutationsList) {
if (mutation.type === 'attributes' && mutation.attributeName === 'aria-disabled') {
mutation.target.removeAttribute('aria-disabled');
}
}
};
const observer = new MutationObserver(callback);
if (targetNode) {
observer.observe(targetNode, config);
}
}
}, 1000)
})()
If it helps you, please like and mark it as the solution.
Best Regards
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
Hello @eslamibrahim, Please share the preview link or share the live store link.
please share url @eslamibrahim
Please follow the instructions below.
Step 1. Go to Admin -> Online store -> Theme > Edit code
Step 2.
With button Add to cart
Find the file product-form.js. Search for the following JS snippet
this.submitBtn.setAttribute('aria-disabled', 'true');
Please disable this JavaScript code by commenting it as follows:
//this.submitBtn.setAttribute('aria-disabled', 'true');
With button Buy It Now
Find the file portable-wallets.en.js. Search for the following JS snippet
attributeChangedCallback(t, n, r, a) {
n !== r && t === "disabled" && a && (r ? (a.setAttribute("aria-disabled", "true"),
a.setAttribute("disabled", "true")) : (a.removeAttribute("aria-disabled"),
a.removeAttribute("disabled")))
}
Please fix it to
attributeChangedCallback(t, n, r, a) {
n !== r && t === "disabled" && a && (r ? (
a.setAttribute("disabled", "true")) : (a.removeAttribute("aria-disabled"),
a.removeAttribute("disabled")))
}
If it helps you, please like and mark it as the solution.
Best Regards
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
I solved it button Add to cart, but button Buy It now I didn't find That file portable-wallets.en.js
This is an accepted solution.
It's like a third-party app has created the file portable-wallets.en.js and it's being served through a CDN instead of existing within your theme, hmm.
I have an alternative solution. Please add the code below to the end of the product-form.js file.
(() => {
setTimeout(() => {
if(location.pathname.includes("/products/")) {
const targetNode = document.querySelector('.shopify-payment-button__button');
const config = { attributes: true, attributeFilter: ['aria-disabled'] };
const callback = function(mutationsList, observer) {
for(let mutation of mutationsList) {
if (mutation.type === 'attributes' && mutation.attributeName === 'aria-disabled') {
mutation.target.removeAttribute('aria-disabled');
}
}
};
const observer = new MutationObserver(callback);
if (targetNode) {
observer.observe(targetNode, config);
}
}
}, 1000)
})()
If it helps you, please like and mark it as the solution.
Best Regards
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
Hi @eslamibrahim ,
We're happy to see that our suggestion helped you solve the issue: https://community.shopify.com/c/shopify-discussions/add-to-cart-button-issue/m-p/2612376#M447067
Can you kindly give us likes? This can be a reference for other merchants if they have an issue like you and greatly motivate us to contribute to our community.
Thanks in advance.
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025