Git Product home page Git Product logo

Comments (6)

brianakidd avatar brianakidd commented on July 26, 2024 2

Hi Ronard,

Once the store installs your app, the shop domain and an API token will be stored in the shops database table. You can use this token to access the shop's data using the Shopify Admin API. Here's a link: https://help.shopify.com/api/reference

This package does all of the heavy lifting and now you can focus on your app requirements. Hope this helps.

from laravel-shopify.

mabrodeur avatar mabrodeur commented on July 26, 2024 2

In your controller you can go like this:

$shop = ShopifyApp::shop();

// If you want to know what is the current store url
echo($shop->shopify_domain);

// If you want to get all the products
$response = $shop->api()->request('GET', '/admin/products.json');
$products = $response->body;

from laravel-shopify.

online217 avatar online217 commented on July 26, 2024

Hello @brianakidd @mabrodeur,

Thank you for the response it helps a lot.

from laravel-shopify.

online217 avatar online217 commented on July 26, 2024

Done. Thank you.

from laravel-shopify.

pasartap avatar pasartap commented on July 26, 2024

Hi guys, appreciate your help please.

I am trying to do the same thing but my $shop object is null. I followed exactly the statements provided by @mabrodeur.

I also added the line:
use \OhMyBrew\ShopifyApp\Facades\ShopifyApp;
at the top.

Do I need to somehow initialize the $shop object myself or am I missing something here?

from laravel-shopify.

gnikyt avatar gnikyt commented on July 26, 2024

@pasartap Did your shop pass through the auth route? (try clicking on the app again in admin and make sure the auth path in Shopify App settings points to /authenticate)

$shop = ShopifyApp::shop(); after including the facade should load the shop.

Can you spit out what session('shopify_domain') value is? See if its filled or empty?

Also, is this route you're accessing using the auth.shop middleware?

from laravel-shopify.

Related Issues (20)

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.