Beispiel #1
0
function fn_qwintry_get_country_data($country, $shipping_id)
{
    $result = fn_qwintry_send_api_request("countries-list?country=" . $country, array(), fn_get_shipping_params($shipping_id));
    if (!$result && !$result->success && empty($result->result) && empty($result->result->{$country})) {
        return false;
    }
    foreach ($result->result->{$country} as $key => $row) {
        if (empty($row) || !is_string($row)) {
            continue;
        }
        $data[] = array('header' => __('qwintry_' . $key), 'content' => $row, 'bold' => in_array($key, array('lazy_workflow')));
    }
    return empty($data) ? false : $data;
}
Beispiel #2
0
            foreach ($addons as $addon => $data) {
                $tpl = 'addons/' . $addon . '/views/shippings/components/services/' . $module . '.tpl';
                if ($view->templateExists($tpl)) {
                    $service_template = $tpl;
                    break;
                }
            }
        }
        if (!empty($service_template)) {
            if (isset($shipping['service_params'])) {
                $shipping['service_params'] = unserialize($shipping['service_params']);
                if (empty($shipping['service_params'])) {
                    $shipping['service_params'] = array();
                }
            } else {
                $shipping['service_params'] = fn_get_shipping_params($shipping_id);
            }
        }
        Tygh::$app['view']->assign('shipping', $shipping);
        Tygh::$app['view']->assign('service_template', $service_template);
        $code = !empty($_REQUEST['code']) ? $_REQUEST['code'] : '';
        Tygh::$app['view']->assign('code', $code);
    }
    // Add new shipping method
} elseif ($mode == 'add') {
    $rate_data = array('rate_value' => array('C' => array(), 'W' => array(), 'I' => array()));
    $services = fn_get_shipping_services();
    Tygh::$app['view']->assign('services', $services);
    Tygh::$app['view']->assign('carriers', fn_get_carriers_from_services($services));
    Tygh::$app['view']->assign('rate_data', $rate_data);
    Tygh::$app['view']->assign('taxes', fn_get_taxes());
Beispiel #3
0
 * This  is  commercial  software,  only  users  who have purchased a valid *
 * license  and  accept  to the terms of the  License Agreement can install *
 * and use this program.                                                    *
 *                                                                          *
 ****************************************************************************
 * PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
 * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
 ****************************************************************************/
use Tygh\Shippings\YandexDelivery;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
$cart =& $_SESSION['cart'];
if ($mode == "configure") {
    if (!empty($_REQUEST['module']) && $_REQUEST['module'] == 'yandex' && !empty($_REQUEST['shipping_id'])) {
        $yad = new YandexDelivery();
        $deliveries = $yad->getDeliveries();
        $deliveries_list = array();
        foreach ($deliveries as $deliver) {
            $deliveries_list[$deliver['id']] = $deliver['name'];
        }
        $shipping = fn_get_shipping_params($_REQUEST['shipping_id']);
        $deliveries_select = array();
        foreach ($shipping['deliveries'] as $delivery_id) {
            $deliveries_select[$delivery_id] = $deliveries_list[$delivery_id];
        }
        $deliveries_list = array_diff($deliveries_list, $deliveries_select);
        Tygh::$app['view']->assign('deliveries', $deliveries_list);
        Tygh::$app['view']->assign('deliveries_select', $deliveries_select);
    }
}