phpish / shopify_app-skeleton

Skeleton Shopify App project using phpish/shopify
94 stars 41 forks source link

Not getting oauth_token and also App is not redirect me to get_products.php #17

Open vdkhatri opened 8 years ago

vdkhatri commented 8 years ago

I have done same steps as shown into shopify_app-skeleton. I have define('REDIRECT_URL', 'http://localhost/shopify/app1/new_prj/get_products.php'); into conf.php.

My redirect URL is http://localhost/shopify/app1/new_prj/get_products.php So I App is not redirecting me to this link. I have installed App into the store but App is not success to get Access_token (oauth_token). I have also added $permission_url = $permission_url . '&redirect_uri=REDIRECT_URL' into ouath.php file.

The app is not shown 'App Successfully Installed!' message and does not redirect to get_products.php page.

$oauth_token = shopify\access_token($_GET['shop'], SHOPIFY_APP_API_KEY, SHOPIFY_APP_SHARED_SECRET); $_SESSION['oauth_token'] = $oauth_token; $_SESSION['shop'] = $_GET['shop']; echo 'App Successfully Installed!';

Please give the fast suggestion.

app1

Installed App: app

After this stage, App does not give me any output.

myjanky commented 8 years ago

The Redirect URL must match the URL you have in partners dashboard. It can not be different. https://cloud.githubusercontent.com/assets/14058120/14182045/4ba97fd2-f72f-11e5-87a7-8efcf4b032bc.png

To redirect to the get_products.php you need to add a header('location: YOURURL/get_products.php'); to line 31 of oauth.php replace this line: echo 'App Successfully Installed!';

Also, I think Shopify no longer allows Non-SSL enabled host to share data between them. Localhost is not secure and a self signed cert still requires the user to add it to the trusted connections.

Why is https:// error in your browser with the admin. This is the issue.

varsha90 commented 8 years ago

i've a same problem in install public app. after install message will be print "app install" but not redirect on shopify admin panel.plzz help.when i replace line " header('location: YOURURL/get_products.php'); to line 31 of oauth.php replace this line: echo 'App Successfully Installed!';" error show: header location already get in config file.

myjanky commented 8 years ago

What does your config file look like @varsha90 ?

varsha90 commented 8 years ago

define('SHOPIFY_APP_API_KEY', ''); define('SHOPIFY_APP_SHARED_SECRET', ''); define('REDIRET_URL' ,'https://xxxx.com./test-server/app/varsha/aa_app/oauth.php'); its my confg file . plz help me

varsha90 commented 8 years ago

Warning: Cannot modify header information - headers already sent by (output started at /home/shopifyexperts/public_html/test-server/app/varsha/aa_app/conf.php:9) in /home/shopifyexperts/public_html/test-server/app/varsha/aa_app/oauth.php on line 41

myjanky commented 8 years ago

You are creating a redirect loop. Do not redirect to oauth.php Also, REDIRECT_URL is mistyped in your conf.php.

Your warning message is odd in that header is started in oauth. this should not be the case. what is line 9 and line 41 of conf.php and oauth.php respectively.