• WP~

    I use the below platforms:

    ~WordPress v.4.61
    ~Suffusion Theme v4.49

    I noticed multiple buy buttons appearing on each product/service page of my site after updating to WordPress v4.6.1. It is at this time I planned to make revisions to each page.

    I connected w/ Shopify gurus and followed the new buy button installation procedure for www.remarpro.com. The code generated via said process [second example below] failed to display any buy buttons.

    Deactivation of all plugins and attempts to install a collection to respective site pages did not correct the issue[s].

    Shopify gurus instructed me to connect w/ WordPress gurus to investigate any theme or related glitches.

    Please find below examples of my site pages:

    https://thewholisticedge.com/consulting/inside-out-health/
    https://thewholisticedge.com/consulting/inside-out-performance/
    https://thewholisticedge.com/consulting/zen-of-wellness/
    https://thewholisticedge.com/consulting/inside-out-nutrition/

    CODE

    Please find below two examples of code during correspondence w/ Shopify gurus. Both examples seem much longer than I remember when I initially installed the same buy buttons before the Shopify site changed and I updated to WordPress v4.6.1.

    1~Please find code that creates multiple buy buttons for each product/service page after updating WordPress to v4.6.1:

    <div data-embed_type=”product” data-shop=”the-wholistic-edge.myshopify.com” data-product_name=”WC 2″ data-product_handle=”wc-2″ data-has_image=”false” data-display_size=”compact” data-redirect_to=”checkout” data-buy_button_text=”Purchase” data-buy_button_out_of_stock_text=”Out of Stock” data-buy_button_product_unavailable_text=”Unavailable” data-button_background_color=”191a18″ data-button_text_color=”f5eded” data-product_modal=”false” data-product_title_color=”000000″ data-next_page_button_text=”Next page”></div>
    <script type=”text/javascript”>
    document.getElementById(‘ShopifyEmbedScript’) || document.write(‘</script><script type=”text/javascript” src=”https://widgets.shopifyapps.com/assets/widgets/embed/client.js&#8221; id=”ShopifyEmbedScript”>< \/script>’);
    </script>
    <noscript>Buy WC 2</noscript>

    CODE

    2~Please find generated code that does not display any buy buttons via revamped Shopify instructions:

    <div id=’product-component-444e7265e3f’></div>
    <script type=”text/javascript”>
    //<![CDATA[

    /* <BuyButton> */
    (function () {
    var scriptURL = ‘https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js&#8217;;
    if (window.ShopifyBuy) {
    if (window.ShopifyBuy.UI) {
    ShopifyBuyInit();
    } else {
    loadScript();
    }
    } else {
    loadScript();
    }

    function loadScript() {
    var script = document.createElement(‘script’);
    script.async = true;
    script.src = scriptURL;
    (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(script);
    script.onload = ShopifyBuyInit;
    }

    function ShopifyBuyInit() {
    var client = ShopifyBuy.buildClient({
    domain: ‘the-wholistic-edge.myshopify.com’,
    apiKey: ’10c3b84a2bfd9f73d8822e28f4483636′,
    appId: ‘6’,
    });

    ShopifyBuy.UI.onReady(client).then(function (ui) {
    ui.createComponent(‘product’, {
    id: [5472879873],
    node: document.getElementById(‘product-component-444e7265e3f’),
    moneyFormat: ‘${{amount}}’,
    options: {
    “product”: {
    “buttonDestination”: “cart”,
    “layout”: “vertical”,
    “variantId”: “all”,
    “width”: “240px”,
    “contents”: {
    “img”: false,
    “title”: false,
    “variantTitle”: false,
    “options”: true,
    “price”: false,
    “description”: false,
    “buttonWithQuantity”: false,
    “button”: true,
    “quantity”: false
    },
    “text”: {
    “button”: “Purchase”
    },
    “styles”: {
    “product”: {
    “@media (min-width: 601px)”: {
    “max-width”: “100%”,
    “margin-left”: “0”,
    “margin-bottom”: “50px”
    }
    },
    “button”: {
    “background-color”: “#141413”,
    “color”: “#ffffff”,
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-size”: “15px”,
    “padding-top”: “16px”,
    “padding-bottom”: “16px”,
    “padding-left”: “26px”,
    “padding-right”: “26px”,
    “border”: “none”,
    “:hover”: {
    “background-color”: “#222220”,
    “color”: “#ffffff”
    },
    “border-radius”: “3px”,
    “:focus”: {
    “background-color”: “#222220”
    }
    },
    “variantTitle”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-size”: “14px”,
    “color”: “#4c4c4c”
    },
    “title”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-weight”: “bold”,
    “font-size”: “26px”,
    “color”: “#4c4c4c”
    },
    “description”: {
    “color”: “#4c4c4c”,
    “font-size”: “14px”,
    “font-family”: “Helvetica Neue, sans-serif”
    },
    “price”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-size”: “18px”,
    “color”: “#4c4c4c”
    },
    “quantityInput”: {
    “font-size”: “16px”,
    “padding-top”: “16px”,
    “padding-bottom”: “16px”,
    “color”: “#4c4c4c”
    },
    “compareAt”: {
    “font-size”: “15px”
    }
    }
    },
    “cart”: {
    “contents”: {
    “title”: true,
    “lineItems”: true,
    “footer”: true,
    “button”: true
    },
    “text”: {
    “title”: “Cart”,
    “total”: “Total”,
    “notice”: “Shipping and discount codes are added at checkout.”,
    “button”: “CHECKOUT”,
    “empty”: “Your cart is empty.”
    },
    “styles”: {
    “button”: {
    “background-color”: “#141413”,
    “color”: “#ffffff”,
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-size”: “16px”,
    “padding-top”: “16px”,
    “padding-bottom”: “16px”,
    “padding-left”: “26px”,
    “padding-right”: “26px”,
    “border”: “none”,
    “:hover”: {
    “background-color”: “#222220”,
    “color”: “#ffffff”
    },
    “border-radius”: “3px”,
    “:focus”: {
    “background-color”: “#222220”
    }
    },
    “cart”: {
    “background-color”: “#ffffff”
    },
    “footer”: {
    “background-color”: “#ffffff”
    },
    “title”: {
    “color”: “#4c4c4c”
    },
    “close”: {
    “:hover”: {
    }
    }
    }
    },
    “modalProduct”: {
    “contents”: {
    “img”: true,
    “title”: true,
    “variantTitle”: false,
    “options”: true,
    “price”: true,
    “description”: true,
    “buttonWithQuantity”: false,
    “button”: true,
    “quantity”: false
    },
    “text”: {
    “button”: “ADD TO CART”
    },
    “styles”: {
    “product”: {
    “@media (min-width: 601px)”: {
    “max-width”: “100%”,
    “margin-left”: “0px”,
    “margin-bottom”: “0px”
    }
    },
    “button”: {
    “background-color”: “#141413”,
    “color”: “#ffffff”,
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-size”: “15px”,
    “padding-top”: “16px”,
    “padding-bottom”: “16px”,
    “padding-left”: “26px”,
    “padding-right”: “26px”,
    “border”: “none”,
    “:hover”: {
    “background-color”: “#222220”,
    “color”: “#ffffff”
    },
    “border-radius”: “3px”,
    “:focus”: {
    “background-color”: “#222220”
    }
    },
    “variantTitle”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-size”: “14px”,
    “color”: “#4c4c4c”
    },
    “title”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-weight”: “bold”,
    “font-size”: “26px”,
    “color”: “#4c4c4c”
    },
    “description”: {
    “color”: “#4c4c4c”,
    “font-size”: “14px”,
    “font-family”: “Helvetica Neue, sans-serif”
    },
    “price”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-size”: “18px”,
    “color”: “#4c4c4c”
    },
    “quantityInput”: {
    “font-size”: “16px”,
    “padding-top”: “16px”,
    “padding-bottom”: “16px”,
    “color”: “#4c4c4c”
    },
    “compareAt”: {
    “font-size”: “15px”
    }
    }
    },
    “productSet”: {
    “styles”: {
    “products”: {
    “@media (min-width: 601px)”: {
    “margin-left”: “-20px”
    }
    }
    }
    },
    “toggle”: {
    “styles”: {
    “toggle”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “background-color”: “#141413”,
    “:hover”: {
    “background-color”: “#222220”
    },
    “:focus”: {
    “background-color”: “#222220”
    }
    }
    }
    },
    “modal”: {
    “styles”: {
    “modal”: {
    “background-color”: “#ffffff”
    }
    }
    },
    “option”: {
    “styles”: {
    “label”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-weight”: “normal”,
    “color”: “#4c4c4c”
    },
    “select”: {
    “font-family”: “Helvetica Neue, sans-serif”,
    “font-weight”: “normal”,
    “color”: “#4c4c4c”
    }
    }
    }
    }
    });
    });
    }
    })();
    /* </BuyButton> */
    //]]>
    </script>

    Thank you for your time and assistance.
    Sorry for the lengthy post.
    I look forward to your reply.

    Namaste…

    ~jsk

  • The topic ‘Shopify Buy Button issues – none vs. multiple buttons’ is closed to new replies.