Comments (3)
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.
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.
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)
- Which Folder HOT 3
- update date_translate snippet to use localiszation object for automatic translation
- Is there any official documentation on these JSONP endpoints? HOT 2
- Search by SKU Snippet
- Shopify persitent cart without apps is not working HOT 2
- Caching issue? HOT 6
- starts-with example doesn't give expected result
- Add other variables to outputted JSON, returning null? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopify-code-snippets.