Jump to content

joar99

Member
  • Posts

    2
  • Joined

  • Last visited

joar99's Achievements

Level 1

Level 1 (1/20)

0

Reputation

  1. Not sure if this has been posted in the wrong area and if so i apoligize in advance 🙂 I have a website with 3 member areas which consist of a single page each. I was wondering if theres a way to create a page where users can see the member areas they are currently a member of? For example like having a button in the navbar at the top of the page "My Subscriptions" and then be greeted with a page containing all their member areas? Ive noticed i can hotwire the account button in the navbar to automatically navigate to "account/member-areas" which contains a list of all the users member areas, but i dont feel its very obvious to users that they need to click "Account" and that will randomly retrieve their memberships. Any help is greatly appriciated, hoping someone might be able to point me in the right direction 🙂
  2. So, for context im building a page that displays all the users current active Member Area subscriptions To this end ive injected the following code block into the page: <script> var memberAreas = []; var memberships = Squarespace.Commerce.Customer.memberships(); for (var i = 0; i < memberships.length; i++) { var membership = memberships[i]; memberAreas.push(membership.memberArea.title); } var pTag = document.getElementById("myP"); var memberAreaArr = document.getElementById("memberArrLength"); var memberArea = memberAreas[0]; if (memberAreas.length === 0) { ptag.innerHTML = "No Active Memberships"; } else { ptag.innerHTML = memberArea; memberAreaArr.innerHTML = memberAreas.length; } console.log(memberships) </script> However, when i attempt to call the Squarespace API on the second line var memberships = x i get an uncaught reference error saying "Squarespace is not defined". Ive attempted to inject these 2 lines of code into both the site wide and page wide headers to no avail: <script src="https://cdn.squarespace.com/static/embed/js/6.5.0/Squarespace.min.js"></script> <script src="https://unpkg.com/squarespace-js@latest/dist/squarespace.min.js"></script> I would greatly appriciate any help or pointers that may lead me in the right direction 🙂 EDIT 1: I should also mention that when i attempt to inject these packages site or page wide the GET request returns a net::ERR_ABORTED 404 error.
×
×
  • 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.