App reviews, troubleshooting, and recommendations
let say we are in a Handler class of a webhook
class ProductsHandler implements Handler
{
public function handle(string $topic, string $shop, array $body): void{
switch ($topic) {
case Topics::PRODUCTS_CREATE: {
// how to get a session instance here so we can perform shopify api call
//
// $session = ?
//$client = new Rest($session->getShop(), $session->getAccessToken());
}
}
}
}
Solved! Go to the solution
This is an accepted solution.
i found a solution
as we already have the $shop variable so we can do this
$session = Utils::loadOfflineSession($shop);
This is an accepted solution.
i found a solution
as we already have the $shop variable so we can do this
$session = Utils::loadOfflineSession($shop);
We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024