if (isset($_POST['method']) && $_POST['method'] == 'deletepixel-old' && isset($_SESSION['shop'])) { require_once 'config.php'; require_once 'functions.php'; require_once "shopify.php"; $response = checkShopExists($_SESSION['shop']); if ($response['status'] == 1) { $token = $response['result']['token']; } else { echo "Shop Doesnot exists"; die; } $response = getScript($_SESSION['shop']); if ($response) { if (isset($token) && $token != "") { $config = array('client_Id' => APIKEY, 'redirect_uri' => REDIRECT_URL, 'client_Secret' => SECRET, 'url' => $_SESSION['shop']); $productFeed = new shopify($config); $response = $productFeed->setAccessToken($token); if ($response['status']) { } else { echo $response['error']; die; } } $response = $productFeed->getFacebookPixcel(); if ($response['status'] == 1) { foreach ($response['result']['script_tags'] as $scriptTag) { $productFeed->deleteFacebookPixcel($scriptTag['id']); } deleteScriptEntry($_SESSION['shop']); echo 1; } else {
$config = array('client_Id' => APIKEY, 'redirect_uri' => REDIRECT_URL, 'client_Secret' => SECRET, 'url' => $_SESSION['shop']); $productFeed = new shopify($config); $response = $productFeed->setAccessToken($token); if ($response['status']) { //echo $response['result']; } else { echo $response['error']; die; } } else { if (isset($_GET['code']) && isset($_GET['shop'])) { $config = array('client_Id' => APIKEY, 'code' => $_GET['code'], 'redirect_uri' => REDIRECT_URL, 'client_Secret' => SECRET, 'url' => $STORE_URL); } else { $config = array('client_Id' => APIKEY, 'redirect_uri' => REDIRECT_URL, 'url' => $STORE_URL); } $productFeed = new shopify($config); $response = $productFeed->getAccessToken(); if ($response['status']) { $data = array('token' => $response['token'], 'shop' => $STORE_URL); $response = createAccount($data); if ($response['status']) { $response = $productFeed->registerShopifyAppUninstallWebhook(); if (!$response['status']) { echo $response['error']; die; } } else { echo $response['error']; die; } } else {
$data = array('id' => (int) $_GET['id'], 'shop' => $_GET['shop']); /* echo '<pre>'; print_r($data); */ $resp = checkCustomCollectionId($data); /* echo '<pre>'; print_r($resp); */ if (!$resp['status']) { echo "Invalid Link Sorry"; die; } } } ############ Get Tokeb END ################ if (isset($token) && $token != "") { $config = array('client_Id' => APIKEY, 'redirect_uri' => REDIRECT_URL, 'client_Secret' => SECRET, 'url' => $_GET['shop']); $productFeed = new shopify($config); $response = $productFeed->setAccessToken($token); if ($response['status']) { //echo $response['result']; } else { echo $response['error']; die; } } $response = $productFeed->getShopData(); if ($response['status']) { $shopData = array('title' => $response['result']['shop']['name'], 'link' => $response['result']['shop']['domain']); } else { echo $response['error']; die; }