How can I Display data on an online store from the app server?
Mohin patwary

Mohin patwary @mohinpatwary

About: Shopify APP Developer

Joined:
Oct 27, 2020

How can I Display data on an online store from the app server?

Publish Date: Nov 13 '20
2 4

How can I Display data on an online store from the app server? I got a guideline, app proxy. but I cannot understand that.

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: Shopify.shop
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

Thank you

Comments 4 total

  • Zubair Mohsin
    Zubair Mohsin Nov 13, 2020

    If you already have a snippet in theme and can pass Liquid file, you can create a hidden input with value of current customer and then retrieve it.

    <input type='hidden' value="{{ customer.id }}" id="uniq_customer" />

    • Mohin patwary
      Mohin patwaryNov 14, 2020

      Thank you so much sir for responding here.
      Actually, I followed the CodeInspire video tutorial. He saw everything in the admin part. But there is no video/guide to show data show online Shopify theme/store from the database,
      I was just trying to show data from the app server/database to the Shopify online store.

      I am trying to follow these instructions, github.com/osiset/laravel-shopify/...

      But I can properly understand these instructions. Could you please help me, sir? I will be really grateful to you.

      Thank you

  • Zubair Mohsin
    Zubair Mohsin Nov 13, 2020

    Also make sure to check YouTube tutorial series by CodeInspire on building Shopify App with Laravel. He also builds a Wishlist app as an example in his tutorial.

    youtube.com/watch?v=DHKtoWrHMhI&li...

  • rainocode
    rainocodeApr 23, 2024

    Unlock the full potential of your online store by seamlessly integrating data from your app server. In this comprehensive guide, we'll explore the step-by-step process of connecting your online store's frontend to your app server's backend, allowing you to display dynamic content, product information, user-generated content, and more.
    rainocode.com/blog/how-can-i-displ...

Add comment