App reviews, troubleshooting, and recommendations
Dear Support,
I trust this message finds you well.
I have successfully developed a Shopify app using core PHP. However, I am encountering an issue while running the install.php file—I am unable to retrieve the Shopify shop name.
Here is the code snippet I am currently using:
<?php
$dotenv = parse_ini_file('.env');
$shop = $_GET['shop'];
$api_key = $dotenv['API_KEY'];
$scopes = "read_orders,write_products,read_themes,write_themes";
$redirect_uri = $dotenv['REDIRECT_URI'];
// Build install/approval URL to redirect to
$install_url = "https://" . $shop . ".myshopify.com/admin/oauth/authorize?client_id=" . $api_key . "&scope=" . $scopes . "&redirect_uri=" . urlencode($redirect_uri);
// Redirect
header("Location: " . $install_url);
die();
While manually adding the shop name statically functions as expected, I am seeking guidance on dynamically obtaining the shop name. Could you kindly advise me on the appropriate approach to achieve this?
Thank you for your assistance.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We 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, 2024