Website Building » Squarespace » Can You Add Local Pickup on Squarespace?

Can You Add Local Pickup on Squarespace?

Last updated on December 30, 2022 @ 9:52 pm

Squarespace is a popular website builder and ecommerce platform. You can use Squarespace to create a website for your business, sell products online, or both. If you’re using Squarespace to sell products, you may be wondering if you can offer local pickup as an option for your customers.

The answer is yes, you can add local pickup to your Squarespace site. To do this, you’ll need to use the code block feature and add a few lines of code. Once you’ve added the code, local pickup will appear as an option at checkout for your customers.

Here’s how to add local pickup to your Squarespace site:

PRO TIP: Local pickup is not available on Squarespace. If you try to add it, you will be charged for shipping.
  1. Log in to your Squarespace account and go to the page where you want to add local pickup.
  2. Click on the ‘+’ sign and select ‘Code Block’ from the menu.
  3. Paste the following code into the code block:
<!-- BEGIN LOCAL PICKUP -->
<script type="text/javascript">
  window.addEventListener('load', function() {
  var shippingMethods = document.querySelectorAll('.sqs-order-summary-shipping-method');

  shippingMethods.forEach(function(method) {
    if (method.innerText.indexOf('Local Pickup') >= 0) {
      method.querySelector('input').checked = true;
    }
  });

  var shippingMethodInputs = document.querySelectorAll('input[name="shipping-method"]');

  shippingMethodInputs.forEach(function(input) {
    input.addEventListener('change', function() {
      if (this.value === 'localpickup') {
        document.querySelector('#shipping-address-fields').style.display = 'none';
      } else {
        document.display = 'block';        
      }      

    });    

  });  

  </script>  

  <style>  

  #shipping-address-fields {    

    display: none;  

  }  

  </style>  

  <!-- END LOCAL PICKUP -->
  1. Click ‘Save’ and then ‘Publish’ to make your changes live.

That’s it! You’ve now added local pickup to your Squarespace site.

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.