skip to Main Content

I am currently building an app for editing subscription orders contents in Shopify.

I am using Laravel 8.0 and the Osiset Shopify library.

I know from within the app interface with App Bridge, I can access the current shop/user via

Auth::user()
// random code...
$shop->api()->rest('GET', '/admin/orders.json', $query);

And that will query only based on the current store.

I want to allow customers on the front end of the site’s to be able to edit their orders via making AJAX requests. I can make the ajax requests just fine, passing in the customer ID, etc.
However within my function that handles the request, I need to somehow get the current shop like you can with

Auth::user()

If someone knows of a way to accomplish this with Laravel + Osiset Shopify I would greatly appreciate a hand 🙂

Thanks
Corey

2

Answers


  1. In Laravel Osiset Shopify Package you can only access the shop name by using Auth::user()->name its stored in Users table when someone Install the app .

    Login or Signup to reply.
  2. Maybe you can use the name of the shop as a URL param within the ajax request and then search the corresponding shop in the USERS table by using the name.

    Keep in mind once the merchants install the app, the Osiset package sets the name of the shop in the USERS table in the name field. Also keep in mind to use the ".myshopify.com" suffix when performing the query in your backend.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search