Jump to content

Buy button says 'Code Removed'

Go to solution Solved by paul2009,

Recommended Posts

Hi, 

I really hope somebody can help me fix this issue. I added a Shopify Buy button on my website and it showed and worked fine. No it shows 'code removed'. I re-inserted it, doesn't help. I have now idea why the code stopped working. 

Anybody has or had the same issue? 

Link to comment
3 hours ago, AriSquare said:

Hi, 

I really hope somebody can help me fix this issue. I added a Shopify Buy button on my website and it showed and worked fine. No it shows 'code removed'. I re-inserted it, doesn't help. I have now idea why the code stopped working. 

Anybody has or had the same issue? 

Sharing your site with the protected password could help us to check your issue more easily.

Site-wide passwords – Squarespace Help

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

@bangank36

Thanks for responding! I put my site live so you can acces it > https://www.brutdeboerchampagne.nl/

The page with the buy button is question is > https://www.brutdeboerchampagne.nl/defles

But as said I only see 'Code Removed' (Code verwijderd in Dutch, see screenshot) in Squarespace editing.

 

The code I got from Shopify and which previously worked is: 

<div id='product-component-1634794249983'></div>
<script type="text/javascript">
/*<![CDATA[*/
(function () {
  var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
  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: 'brutdeboer.myshopify.com',
      storefrontAccessToken: '512582b2c550edbec7fc49129d1a28fb',
    });
    ShopifyBuy.UI.onReady(client).then(function (ui) {
      ui.createComponent('product', {
        id: '7330218049768',
        node: document.getElementById('product-component-1634794249983'),
        moneyFormat: '%E2%82%AC%7B%7Bamount_with_comma_separator%7D%7D',
        options: {
  "product": {
    "styles": {
      "product": {
        "@media (min-width: 601px)": {
          "max-width": "100%",
          "margin-left": "0",
          "margin-bottom": "50px"
        },
        "text-align": "left"
      },
      "title": {
        "font-family": "Montserrat, sans-serif",
        "font-size": "26px",
        "color": "#fcf9f9"
      },
      "button": {
        "font-family": "Montserrat, sans-serif",
        ":hover": {
          "background-color": "#d75961"
        },
        "background-color": "#ef636c",
        ":focus": {
          "background-color": "#d75961"
        },
        "border-radius": "0px"
      },
      "price": {
        "font-family": "Lato, sans-serif",
        "font-size": "18px",
        "color": "#fdfcfc"
      },
      "compareAt": {
        "font-family": "Lato, sans-serif",
        "font-size": "15.299999999999999px",
        "color": "#fdfcfc"
      },
      "unitPrice": {
        "font-family": "Lato, sans-serif",
        "font-size": "15.299999999999999px",
        "color": "#fdfcfc"
      },
      "description": {
        "font-family": "Lato, sans-serif",
        "color": "#fdfafa"
      }
    },
    "buttonDestination": "checkout",
    "layout": "horizontal",
    "contents": {
      "img": false,
      "imgWithCarousel": true,
      "button": false,
      "buttonWithQuantity": true,
      "description": true
    },
    "width": "100%",
    "text": {
      "button": "Pre order nu."
    },
    "googleFonts": [
      "Montserrat",
      "Lato"
    ]
  },
  "productSet": {
    "styles": {
      "products": {
        "@media (min-width: 601px)": {
          "margin-left": "-20px"
        }
      }
    }
  },
  "modalProduct": {
    "contents": {
      "img": false,
      "imgWithCarousel": true,
      "button": false,
      "buttonWithQuantity": true
    },
    "styles": {
      "product": {
        "@media (min-width: 601px)": {
          "max-width": "100%",
          "margin-left": "0px",
          "margin-bottom": "0px"
        }
      },
      "button": {
        "font-family": "Montserrat, sans-serif",
        ":hover": {
          "background-color": "#d75961"
        },
        "background-color": "#ef636c",
        ":focus": {
          "background-color": "#d75961"
        },
        "border-radius": "0px"
      },
      "title": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "bold",
        "font-size": "26px",
        "color": "#4c4c4c"
      },
      "price": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "normal",
        "font-size": "18px",
        "color": "#4c4c4c"
      },
      "compareAt": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "normal",
        "font-size": "15.299999999999999px",
        "color": "#4c4c4c"
      },
      "unitPrice": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "normal",
        "font-size": "15.299999999999999px",
        "color": "#4c4c4c"
      },
      "description": {
        "font-family": "Helvetica Neue, sans-serif",
        "font-weight": "normal",
        "font-size": "14px",
        "color": "#4c4c4c"
      }
    },
    "googleFonts": [
      "Montserrat"
    ],
    "text": {
      "button": "Add to cart"
    }
  },
  "option": {},
  "cart": {
    "styles": {
      "button": {
        "font-family": "Montserrat, sans-serif",
        ":hover": {
          "background-color": "#d75961"
        },
        "background-color": "#ef636c",
        ":focus": {
          "background-color": "#d75961"
        },
        "border-radius": "0px"
      }
    },
    "text": {
      "total": "Subtotal",
      "button": "Checkout"
    },
    "googleFonts": [
      "Montserrat"
    ]
  },
  "toggle": {
    "styles": {
      "toggle": {
        "font-family": "Montserrat, sans-serif",
        "background-color": "#ef636c",
        ":hover": {
          "background-color": "#d75961"
        },
        ":focus": {
          "background-color": "#d75961"
        }
      }
    },
    "googleFonts": [
      "Montserrat"
    ]
  }
},
      });
    });
  }
})();
/*]]>*/
</script>

269339661_ScreenShot2021-10-21at07_28_17.thumb.png.dfed4ed05dadea506162c8e9466dd7f2.png

Link to comment
  • Solution

It sounds like you may have added the code during the free trial and then signed up for a Personal Plan. Is that right?

Personal Plans are not suitable for selling because they don’t allow code.

If you are on a Personal Plan you will need to upgrade to a Business Plan. 

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.