Ad

Shopify Buy Buttons Not Showing On Mobile

- 1 answer

I have some shopify Buy buttons on my website. They show fine on desktop browsers - the site is responsive and the buttons show on all viewport queries on desktop browsers.

When viewing the site on mobile I get no buy buttons. I thought it may be a cross-origin issue so I hosted the shopify javascript files locally and I get the same behaviour.

I have tried all the different versions of the buy now button and I get the same behaviour.

Is there a reason I can't see buy buttons on mobile? Site is www.redlamp.com.au/myriad/shopify2.html

Ad

Answer

I found the culprit - I had extended the Object with my own rudimentary add/remove class functions. Removing the following code fixed the problem:

Object.prototype.addClass = function(clas) {        

    if (this.classList)
        this.classList.add(clas);
    else
        this.className += ' ' + clas;

}

Object.prototype.remClass = function(clas) {        

    if (this.classList)
        this.classList.remove(clas);
    else
        return;
}

Thanks!

Ad
source: stackoverflow.com
Ad