I used booster theme. while add to cart is not working on mobile device while it works fine in browser. Additional, when i click buy it now button it shows transaction failed error. please help me out.
Solved! Go to the solution
Hello There,
Could you kindly share your store URL so that I can take a look and suggest you some solution on it.
Hello There,
I have checked your store and found that in the mobile view the structure of the button is different what it is in the desktop view. So, the add.js event is not triggered on it. So, you will need to make the structure to match the desktop view so that it will work fine.
If you want me to assist you further on it then kindly DM me so that we can proceed further on it and make it work.
This is an accepted solution.
@imjeng
1. In your Shopify Admin go to online store > themes > actions > edit code
2. In your theme.liquid file, find the </body> (press CTRL + F or command + F on Mac)
3. paste this code right above the </body> tag:
<script>
function addToCartMobileClick() {
if (!/product/.test(window.location.href)){
return;
}
var btn = document.querySelector(`#mst-stiky-box button`);
btn.addEventListener('click', function(){
var atc = document.querySelector(`.grid__item.row_grid_qnt button`);
atc.click();
});
}
addToCartMobileClick()
</script>
Please let me know whether it works.
Kind regards,
Diego
User | Count |
---|---|
38 | |
24 | |
16 | |
12 | |
10 |