Example #1
0
            }
        } else {
            $result['partner_preactivation'] = 'NOK';
        }
    }
    // DISCOVER PRESTASHOP
    $content = @file_get_contents($protocol . '://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country=' . $isoCountry . '&iso_lang=' . Tools::strtolower($isoUser) . '&id_lang=' . (int) $cookie->id_lang, false, $context);
    if (!$content) {
        $result['discover_prestashop'] = 'NOK';
    } else {
        $content = explode('|', $content);
        if ($content[0] == 'OK') {
            $result['discover_prestashop'] = $content[1];
        } else {
            $result['discover_prestashop'] = 'NOK';
        }
        if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3)) {
            $result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="' . $protocol . '://www.prestashop.com/rss/news2.php?v=' . _PS_VERSION_ . '&lang=' . $isoUser . '"></iframe>';
        }
        $content = @file_get_contents($protocol . '://www.prestashop.com/partner/paypal/paypal-tips.php?protocol=' . $protocol . '&iso_country=' . $isoCountry . '&iso_lang=' . Tools::strtolower($isoUser) . '&id_lang=' . (int) $cookie->id_lang, false, $context);
        $content = explode('|', $content);
        if ($content[0] == 'OK') {
            $result['discover_prestashop'] .= $content[1];
        }
    }
    die(Tools::jsonEncode($result));
}
if (Tools::isSubmit('getChildrenCategories') && Tools::getValue('id_category_parent')) {
    $children_categories = Category::getChildrenWithNbSelectedSubCatForProduct(Tools::getValue('id_category_parent'), Tools::getValue('id_product', 0), Tools::getValue('post_selected_cat', null), $cookie->id_lang);
    die(Tools::jsonEncode($children_categories));
}