Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1023743

    Hi,

    I have been using the Shopify app to embed buy buttons on my wordpress enfold child website. As this app is discontinued, I am manually trying to embed code from shopify into the page. The code embeds in the ‘text’ box, it is visible in the ‘visual’ box and can be clicked and the carts appears and updates. I save/update but then when i open the preview of my website it is not visible. I have tried entering the code in a code block, in a text block. I can’t figure it out.

    Any help would be hugely appreciated as it doesn’t seem to make sense to me at all.

    Here is the code I am trying to embed on my Teak paddle board page:

    <div id=’product-component-e2d19cc7e14′></div>
    <script type=”text/javascript”>
    /*<![CDATA[*/

    (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-epicurean-architect.myshopify.com’,
    storefrontAccessToken: ‘7c033492928c77dfca909d65deed0575’,
    });

    ShopifyBuy.UI.onReady(client).then(function (ui) {
    ui.createComponent(‘product’, {
    id: [1428489830517],
    node: document.getElementById(‘product-component-e2d19cc7e14’),
    moneyFormat: ‘%24%7B%7Bamount%7D%7D’,
    options: {
    “product”: {
    “variantId”: “all”,
    “width”: “240px”,
    “contents”: {
    “img”: false,
    “imgWithCarousel”: false,
    “title”: false,
    “variantTitle”: false,
    “price”: false,
    “description”: false,
    “buttonWithQuantity”: false,
    “quantity”: false
    },
    “styles”: {
    “product”: {
    “text-align”: “left”,
    “@media (min-width: 601px)”: {
    “max-width”: “calc(25% – 20px)”,
    “margin-left”: “20px”,
    “margin-bottom”: “50px”
    }
    },
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    }
    }
    },
    “cart”: {
    “contents”: {
    “button”: true
    },
    “styles”: {
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    },
    “footer”: {
    “background-color”: “#ffffff”
    }
    }
    },
    “modalProduct”: {
    “contents”: {
    “img”: false,
    “imgWithCarousel”: true,
    “variantTitle”: false,
    “buttonWithQuantity”: true,
    “button”: false,
    “quantity”: false
    },
    “styles”: {
    “product”: {
    “@media (min-width: 601px)”: {
    “max-width”: “100%”,
    “margin-left”: “0px”,
    “margin-bottom”: “0px”
    }
    },
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    }
    }
    },
    “toggle”: {
    “styles”: {
    “toggle”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    },
    “count”: {
    “color”: “#ffffff”,
    “:hover”: {
    “color”: “#ffffff”
    }
    },
    “iconPath”: {
    “fill”: “#ffffff”
    }
    }
    },
    “productSet”: {
    “styles”: {
    “products”: {
    “@media (min-width: 601px)”: {
    “margin-left”: “-20px”
    }
    }
    }
    }
    }
    });
    });
    }
    })();
    /*]]>*/
    </script>

    #1024044

    Hey theepicureanarchitect,

    Can you give us a link to your site?

    Best regards,
    Nikko

    #1024220

    These are the two pages that have the issues:
    Vintage bottle caddy
    http://theepicureanarchitect.com/vintage-bottle-caddy/?preview_id=1568&preview_nonce=f7511f71dd&_thumbnail_id=1578&preview=true
    Teak paddle board
    http://theepicureanarchitect.com/teak-paddle-board/?preview_id=1601&preview_nonce=839baa78c3&_thumbnail_id=1590&preview=true

    I have managed now to get a buy button by pasting code directly into a text box not contained within a layout element. Whenever it is in a layout element it is not visible on the website, even though it can be seen in the ‘visual’ window of the editing page.

    Ideally, I want the buy button to sit under the $100 text in the layout element.

    This is the code for the:
    Vintage bottle caddy

    <div id=’product-component-55502f0be61′></div>
    <script type=”text/javascript”>
    /*<![CDATA[*/

    (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-epicurean-architect.myshopify.com’,
    storefrontAccessToken: ‘7c033492928c77dfca909d65deed0575’,
    });

    ShopifyBuy.UI.onReady(client).then(function (ui) {
    ui.createComponent(‘product’, {
    id: [1428480000117],
    node: document.getElementById(‘product-component-55502f0be61’),
    moneyFormat: ‘%24%7B%7Bamount%7D%7D’,
    options: {
    “product”: {
    “variantId”: “all”,
    “width”: “240px”,
    “contents”: {
    “img”: false,
    “imgWithCarousel”: false,
    “title”: false,
    “variantTitle”: false,
    “price”: false,
    “description”: false,
    “buttonWithQuantity”: false,
    “quantity”: false
    },
    “styles”: {
    “product”: {
    “text-align”: “left”,
    “@media (min-width: 601px)”: {
    “max-width”: “calc(25% – 20px)”,
    “margin-left”: “20px”,
    “margin-bottom”: “50px”
    }
    },
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    }
    }
    },
    “cart”: {
    “contents”: {
    “button”: true
    },
    “styles”: {
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    },
    “footer”: {
    “background-color”: “#ffffff”
    }
    }
    },
    “modalProduct”: {
    “contents”: {
    “img”: false,
    “imgWithCarousel”: true,
    “variantTitle”: false,
    “buttonWithQuantity”: true,
    “button”: false,
    “quantity”: false
    },
    “styles”: {
    “product”: {
    “@media (min-width: 601px)”: {
    “max-width”: “100%”,
    “margin-left”: “0px”,
    “margin-bottom”: “0px”
    }
    },
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    }
    }
    },
    “toggle”: {
    “styles”: {
    “toggle”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    },
    “count”: {
    “color”: “#ffffff”,
    “:hover”: {
    “color”: “#ffffff”
    }
    },
    “iconPath”: {
    “fill”: “#ffffff”
    }
    }
    },
    “productSet”: {
    “styles”: {
    “products”: {
    “@media (min-width: 601px)”: {
    “margin-left”: “-20px”
    }
    }
    }
    }
    }
    });
    });
    }
    })();
    /*]]>*/
    </script>

    Teak paddle board

    <div id=’product-component-f545d00ac92′></div>
    <script type=”text/javascript”>
    /*<![CDATA[*/

    (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-epicurean-architect.myshopify.com’,
    storefrontAccessToken: ‘7c033492928c77dfca909d65deed0575’,
    });

    ShopifyBuy.UI.onReady(client).then(function (ui) {
    ui.createComponent(‘product’, {
    id: [1428489830517],
    node: document.getElementById(‘product-component-f545d00ac92’),
    moneyFormat: ‘%24%7B%7Bamount%7D%7D’,
    options: {
    “product”: {
    “variantId”: “all”,
    “width”: “240px”,
    “contents”: {
    “img”: false,
    “imgWithCarousel”: false,
    “title”: false,
    “variantTitle”: false,
    “price”: false,
    “description”: false,
    “buttonWithQuantity”: false,
    “quantity”: false
    },
    “styles”: {
    “product”: {
    “text-align”: “left”,
    “@media (min-width: 601px)”: {
    “max-width”: “calc(25% – 20px)”,
    “margin-left”: “20px”,
    “margin-bottom”: “50px”
    }
    },
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    }
    }
    },
    “cart”: {
    “contents”: {
    “button”: true
    },
    “styles”: {
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    },
    “footer”: {
    “background-color”: “#ffffff”
    }
    }
    },
    “modalProduct”: {
    “contents”: {
    “img”: false,
    “imgWithCarousel”: true,
    “variantTitle”: false,
    “buttonWithQuantity”: true,
    “button”: false,
    “quantity”: false
    },
    “styles”: {
    “product”: {
    “@media (min-width: 601px)”: {
    “max-width”: “100%”,
    “margin-left”: “0px”,
    “margin-bottom”: “0px”
    }
    },
    “button”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    }
    }
    },
    “toggle”: {
    “styles”: {
    “toggle”: {
    “background-color”: “#9b9696”,
    “:hover”: {
    “background-color”: “#8c8787”
    },
    “:focus”: {
    “background-color”: “#8c8787”
    }
    },
    “count”: {
    “color”: “#ffffff”,
    “:hover”: {
    “color”: “#ffffff”
    }
    },
    “iconPath”: {
    “fill”: “#ffffff”
    }
    }
    },
    “productSet”: {
    “styles”: {
    “products”: {
    “@media (min-width: 601px)”: {
    “margin-left”: “-20px”
    }
    }
    }
    }
    }
    });
    });
    }
    })();
    /*]]>*/
    </script>

    Thank you so much for your help. I have always used the Shopify app in wordpress and have never had any problems so don’t understand whey this is so tricky now.

    Thank you
    Victoria

    #1024887

    Hi Victoria,

    I apologize for the late response however I couldn’t access your site using the credentials you gave, please check.
    Also, can you try using a code block first? or you can also try to add the code in footer or header: https://kriesi.at/documentation/enfold/add-custom-js-or-php-script/#add-a-script-to-footer-section

    Best regards,
    Nikko

    #1025167

    HI Nikko,

    I have tried adding the script in a code block. Doesn’t work unfortunately. If it is in the header or footer it won’t be in the right location for a buy button for an individual product.

    To create an admin login on my wordpress website I need an your email address so you can reset your own password. I dont have your email so have to put it in as my email address. It does not allow a user to be set up without an email. Please provide me with your email so I can set you up as a user. I dont know how to create a login for you otherwise.

    #1025171

    I have tried updating the user password, please see if you can login now.

    #1025214

    I have tried another option and it is working. I copied and pasted an old shopify button text and modified it instead of copying the code from the shopify website. This has worked thankfully.
    Thanks for your help.

    #1025427

    Hi theepicureanarchitect,

    Glad to hear that it worked :)
    Feel free to comeback if you need further assistance.
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.