Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I show app data to the Shopify theme for a specific user #8

Open
mohinpatwary opened this issue Nov 7, 2020 · 0 comments
Open

Comments

@mohinpatwary
Copy link

Hello sir,
I have created an admin Dashboard for the app following your tutorial. I created successfully a snippet file on the current Shopify theme using asset API. I can pass any HTML code as a snippet file value. This means I can pass any HTML or liquid code in the snippet file. That snippet file was created from my app.

I've added some settings fields for my app. And I can save data into my database.https://prnt.sc/vf6fjp

Now I want to create a REST API to show the data for the Shopify client store. I created an API route.https://prnt.sc/vf6cjs
For API I have created a Controller. https://prnt.sc/vf6dlu

On the controller for the API, I need to run a query based on the same customer ID and the same Shopify shop name to get data from my database. In my database, I saved customer id and shop Name, and product id.

Now, How can I get a Shopify shop name and customer ID in the laravel controller?
So, I can run a SQL query using Shopify shop name and customer-id to get data from my database.

I can easily manage JavaScript to get the name of Shopify Shop. Example: <script>Shopify.shop</script>
But how can I customer ID? The customer who logged in and saved the wishlist product.

Also, How can I write javascript in laravel controller or how can I access javascript value in the laravel controller?

I really need this assistance, I am trying to for the last few days. But I cannot find a solution.

Please sir help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant