예제 #1
0
                $token = "";
            }
        }
    } else {
        $response = checkShopExists($STORE_URL);
        if ($response['status'] == 1) {
            $token = $_SESSION['token'] = $response['result']['token'];
            $_SESSION['Id'] = $response['result']['id'];
            $_SESSION['shop'] = $STORE_URL;
        } else {
            $token = "";
        }
    }
} else {
    if (isset($_SESSION['shop'])) {
        $response = checkShopExists($_SESSION['shop']);
        if ($response['status'] == 1) {
            $token = $_SESSION['token'] = $response['result']['token'];
            $_SESSION['Id'] = $response['result']['id'];
        } else {
            $token = "";
        }
    } else {
        $token = "";
        echo "Shop url Is missing. Please try again";
        die;
    }
}
if (isset($token) && $token != "") {
    $config = array('client_Id' => APIKEY, 'redirect_uri' => REDIRECT_URL, 'client_Secret' => SECRET, 'url' => $_SESSION['shop']);
    $productFeed = new shopify($config);
예제 #2
0
<?php

if (isset($_GET['id']) && isset($_GET['shop']) && isset($_GET['type'])) {
    //echo '<pre>';
    //print_r($_GET);
    require_once 'config.php';
    require_once 'functions.php';
    require_once "shopify.php";
    ############ Get Token start ################
    $response = checkShopExists($_GET['shop']);
    if ($response['status'] == 1) {
        $token = $response['result']['token'];
    } else {
        echo "Invalid Link sorry!";
        die;
    }
    if ($_GET['type'] == "collection") {
        $data = array('id' => (int) $_GET['id'], 'shop' => $_GET['shop']);
        $resp = checkCollectionId($data);
        if (!$resp['status']) {
            echo "Invalid Link Sorry";
            die;
        }
    } else {
        if ($_GET['type'] == "custom") {
            $data = array('id' => (int) $_GET['id'], 'shop' => $_GET['shop']);
            /* echo '<pre>';
            			print_r($data); */
            $resp = checkCustomCollectionId($data);
            /* 	echo '<pre>';
            			print_r($resp); */