Git Product home page Git Product logo

Comments (3)

freakdesign avatar freakdesign commented on July 28, 2024

Interesting. It's possible that JSONP is no longer accepted but would have to look into it.
Do you have some replication steps/code used so I can give it a test using the same process?

from shopify-code-snippets.

oscarni avatar oscarni commented on July 28, 2024

To test I'm running your script in the console. I get the response from shopify, it's just without any items which I can see are in the cart when I visit the shop.

This could be far fetched, but I think I've figured it out. It looks like it works when I have https setup and only when i'm running the script from the same main domain. So it works when I run it on a subdomain of the main shopify store. But cross-domain with a totally different domain doesn't look like it works anymore. Could be related to chrome setting same-site: lax as default on cookies or some other cookie restriction shopify has limiting the session to only be available on the main domain.

Edit: I can confirm that it get the correct cart when request is made from a subdomain of the same main Shopify domain and over ssl. To test locally i suggest running your local server over https (adding certificates was a pain) and adding a testing subdomain.maindomain to your hosts file.

from shopify-code-snippets.

NotARobit avatar NotARobit commented on July 28, 2024

Looks like @oscarni is correct about the cookies. My shop is on a subdomain, so I'm able to set my own cookie that is usable by both domains.

from shopify-code-snippets.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.