Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
Adding product info from iframe to sqaurespace cart

I am attempting to add product details from an iframe to the cart on the parent page. I am using Squarespace and I cant find any information on how to do this with Javascript.

I added an event listener and I am getting the product details sent from the iframe to the console but need to take that info and add it directly to the cart on squarespace.

          <script>  
          var addToCartBTN = document.querySelector('.sqs-add-to-cart-button')
          window.addEventListener("message", function(e) {
             if(e.data.action == "add-to-cart") {
             console.log("Hello World"); 
             var quant = e.data.quantity;
             console.log(quant);
             console.log(e);
             addToCartBTN.click();
 
        fetch('?format=json-pretty').then(function (response) {
              return response.json(); 
               }).then(function (obj) {
                console.log(obj);    
               })
                 }
           })
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!