Пример #1
0
function parse_notags($imonggo_inventory, $imonggo_products, $parsed, $url_shopify, $http_header_post, $http_header_pull, $pull_url_shopify)
{
    foreach ($imonggo_products as $prod) {
        if ($prod->tag_list == "") {
            array_push($parsed, $prod);
        }
    }
    post_product_shopify($imonggo_inventory, $parsed, $url_shopify, $http_header_post, $http_header_pull, $pull_url_shopify);
}
Пример #2
0
    //will parse products
    post_parsed($imonggo_inventory, $imonggo_products, $url_shopify, $http_header_post, $http_header_pull, $pull_url_shopify);
    //post to shopify
} else {
    if (isset($_GET['postProducts'])) {
        $url_shopify = 'https://' . $_SESSION['shopify_shop_name'] . '.myshopify.com/admin/products.json';
        $pull_url_shopify = 'https://' . $_SESSION['shopify_shop_name'] . '.myshopify.com/admin/products.xml';
        $url_imonggo = 'https://' . $imonggo_account_id . '.c3.imonggo.com/api/products.xml';
        $url_imonggo_inventory = 'https://' . $imonggo_account_id . '.c3.imonggo.com/api/inventories.xml';
        $imonggo_products = pull_imonggo($url_imonggo, $imonggo_username, $imonggo_password);
        //pull products from imonggo
        $imonggo_inventory = pull_imonggo($url_imonggo_inventory, $imonggo_username, $imonggo_password);
        //pull inventory for quantity update
        modal();
        //prints all errors in a modal
        post_product_shopify($imonggo_inventory, $imonggo_products, $url_shopify, $http_header_post, $http_header_pull, $pull_url_shopify);
        //post to shopify
    } else {
        if (isset($_GET['postCustomers'])) {
            $url_shopify = 'https://' . $_SESSION['shopify_shop_name'] . '.myshopify.com/admin/customers.xml';
            $url_imonggo = 'https://' . $imonggo_account_id . '.c3.imonggo.com/api/customers.xml?active_only=1';
            $customer = pull_shopify($url_shopify, $http_header_pull);
            //pull customers from shopify
            modal();
            //prints all errors in a modal
            post_customer_imonggo($customer, $url_imonggo, $imonggo_username, $imonggo_password, $http_header_post);
        } else {
            if (isset($_GET['postInvoices'])) {
                $url_shopify = 'https://' . $_SESSION['shopify_shop_name'] . '.myshopify.com/admin/orders.xml';
                $url_imonggo = 'https://' . $imonggo_account_id . '.c3.imonggo.com/api/invoices.xml';
                $invoices = pull_shopify($url_shopify, $http_header_pull);