The app is called up fine in a new page if I do not include the following javascript as published in Shopify documentation.
<script src="https://cdn.shopify.com/s/assets/external/app.js"></script>
<script type="text/javascript">
ShopifyApp.init({
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
shopOrigin: 'https://xxxxxxxxxxxxx.myshopify.com';
});
</script>
App can be found here: https://apps.shopify.com/open-d-community-builder
App "Embedded Settings" set to "Enabled"
Current App code (Note: x'd out API Key) :
____________________________________________________
<?PHP
session_start();
$sc = $_GET['shop'];
$sc = str_replace('.myshopify.com', '', $sc);
$app = $_SERVER['HTTP_REFERER'];
$app = substr($app, strpos($app, "apps/") + 5);
$app = substr($app, 0, 32);
$_SESSION['app'] = $app;
$_SESSION['sc'] = $sc;
?>
<HTML>
<HEAD>
<!--COMMENT - SHOPIFY INTEGRATION START -->
<script src="https://cdn.shopify.com/s/assets/external/app.js"></script>
<script type="text/javascript">
ShopifyApp.init({
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
shopOrigin: 'https://<? echo $sc; ?>.myshopify.com'
});
</script>
<!--COMMENT - SHOPIFY INTEGRATION END -->
</HEAD>
<BODY>
<CENTER><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><A HREF="https://opend.me" TARGET="_new"><IMG SRC="20logo300.jpg" BORDER=0></A><FONT FACE="arial" SIZE=4><BR><BR><BR>Thank you for requesting Open D Community Builder.<BR><BR>We have received your request and will have your Open D Community Builder<BR>integrated within your Shopify Administrator in less than 24hrs.<BR><BR>In the meantime you can download our <A HREF="https://opend.me/sales_support/operations_manual_aug2014.pdf" TARGET="_blank"><B>Operations Guide</B></A><BR>to get familiar with Open D Community Builder.<BR><BR>Once we have your installation in place we will notify you that your<BR>application is ready for you to customize for your own community.<BR><BR>If you have any questions regarding your order, please <A HREF="https://opend.me/contactus.php" TARGET="_blank">contact us here</A>.<BR><BR></FONT></CENTER>
<? echo ' Dev-note - Shop name: ' . $sc; ?>
</BODY>
</HTML>
________________________________________________________
Any assistance would be greatly appreciated.
Thanks,
Ross