本文整理汇总了PHP中Carrier::getDeliveredCountries方法的典型用法代码示例。如果您正苦于以下问题:PHP Carrier::getDeliveredCountries方法的具体用法?PHP Carrier::getDeliveredCountries怎么用?PHP Carrier::getDeliveredCountries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carrier
的用法示例。
在下文中一共展示了Carrier::getDeliveredCountries方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initContent
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
if ($this->customer->birthday) {
$birthday = explode('-', $this->customer->birthday);
} else {
$birthday = array('-', '-', '-');
}
/* Generate years, months and days */
$this->context->smarty->assign(array('years' => Tools::dateYears(), 'sl_year' => $birthday[0], 'months' => Tools::dateMonths(), 'sl_month' => $birthday[1], 'days' => Tools::dateDays(), 'sl_day' => $birthday[2], 'errors' => $this->errors, 'genders' => Gender::getGenders()));
if (Module::isInstalled('blocknewsletter')) {
$this->context->smarty->assign('newsletter', (int) Module::getInstanceByName('blocknewsletter')->active);
}
// start of implementation of the module code - taxamo
// Get selected country
if (Tools::isSubmit('taxamoisocountryresidence') && !is_null(Tools::getValue('taxamoisocountryresidence'))) {
$selected_country = Tools::getValue('taxamoisocountryresidence');
} else {
$selected_country = Taxamoeuvat::getCountryByCustomer($this->customer->id);
}
// Generate countries list
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
/* todo use helper */
$list = '<option value="">-</option>';
foreach ($countries as $country) {
$selected = $country['iso_code'] == $selected_country ? 'selected="selected"' : '';
$list .= '<option value="' . $country['iso_code'] . '" ' . $selected . '>' . htmlentities($country['name'], ENT_COMPAT, 'UTF-8') . '</option>';
}
// Get selected cc prefix
if (Tools::isSubmit('taxamoccprefix') && !is_null(Tools::getValue('taxamoccprefix'))) {
$taxamo_cc_prefix = Tools::getValue('taxamoccprefix');
} else {
$taxamo_cc_prefix = Taxamoeuvat::getPrefixByCustomer($this->customer->id);
}
if ($this->customer->id) {
$this->context->smarty->assign(array('countries_list' => $list, 'taxamoisocountryresidence' => $selected_country, 'taxamoccprefix' => $taxamo_cc_prefix));
}
// end of code implementation module - taxamo
$this->setTemplate(_PS_THEME_DIR_ . 'identity.tpl');
}
示例2: initContent
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
/* id_carrier is not defined in database before choosing a carrier, set it to a default one to match a potential cart _rule */
if (empty($this->context->cart->id_carrier)) {
$checked = $this->context->cart->simulateCarrierSelectedOutput();
$checked = (int) Cart::desintifier($checked);
$this->context->cart->id_carrier = $checked;
$this->context->cart->update();
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
}
// SHOPPING CART
$this->_assignSummaryInformations();
// WRAPPING AND TOS
$this->_assignWrappingAndTOS();
$selectedCountry = (int) Configuration::get('PS_COUNTRY_DEFAULT');
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
// If a rule offer free-shipping, force hidding shipping prices
$free_shipping = false;
foreach ($this->context->cart->getCartRules() as $rule) {
if ($rule['free_shipping'] && !$rule['carrier_restriction']) {
$free_shipping = true;
break;
}
}
$this->context->smarty->assign(array('free_shipping' => $free_shipping, 'isGuest' => isset($this->context->cookie->is_guest) ? $this->context->cookie->is_guest : 0, 'countries' => $countries, 'sl_country' => isset($selectedCountry) ? $selectedCountry : 0, 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'errorCarrier' => Tools::displayError('You must choose a carrier.', false), 'errorTOS' => Tools::displayError('You must accept the Terms of Service.', false), 'isPaymentStep' => (bool) (isset($_GET['isPaymentStep']) && $_GET['isPaymentStep']), 'genders' => Gender::getGenders(), 'one_phone_at_least' => (int) Configuration::get('PS_ONE_PHONE_AT_LEAST'), 'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('displayCustomerAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')));
$years = Tools::dateYears();
$months = Tools::dateMonths();
$days = Tools::dateDays();
$this->context->smarty->assign(array('years' => $years, 'months' => $months, 'days' => $days));
/* Load guest informations */
if ($this->isLogged && $this->context->cookie->is_guest) {
$this->context->smarty->assign('guestInformations', $this->_getGuestInformations());
}
// ADDRESS
if ($this->isLogged) {
$this->_assignAddress();
}
// CARRIER
$this->_assignCarrier();
// PAYMENT
$this->_assignPayment();
Tools::safePostVars();
$blocknewsletter = Module::getInstanceByName('blocknewsletter');
$this->context->smarty->assign('newsletter', (bool) ($blocknewsletter && $blocknewsletter->active));
$this->_processAddressFormat();
$this->setTemplate(_PS_THEME_DIR_ . 'order-opc.tpl');
}
示例3: assignCountries
/**
* Assign countries var to smarty
*/
protected function assignCountries()
{
$this->id_country = (int) Tools::getCountry();
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
$this->context->smarty->assign(array('countries' => $countries, 'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'sl_country' => (int) $this->id_country, 'vat_management' => Configuration::get('VATNUMBER_MANAGEMENT')));
}
示例4: initContent
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
/* id_carrier is not defined in database before choosing a carrier, set it to a default one to match a potential cart _rule */
if (empty($this->context->cart->id_carrier)) {
$checked = $this->context->cart->simulateCarrierSelectedOutput();
$checked = (int) Cart::desintifier($checked);
$this->context->cart->id_carrier = $checked;
$this->context->cart->update();
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
}
// SHOPPING CART
$this->_assignSummaryInformations();
// WRAPPING AND TOS
$this->_assignWrappingAndTOS();
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
// If a rule offer free-shipping, force hidding shipping prices
$free_shipping = false;
foreach ($this->context->cart->getCartRules() as $rule) {
if ($rule['free_shipping'] && !$rule['carrier_restriction']) {
$free_shipping = true;
break;
}
}
$this->context->smarty->assign(array('free_shipping' => $free_shipping, 'isGuest' => isset($this->context->cookie->is_guest) ? $this->context->cookie->is_guest : 0, 'countries' => $countries, 'sl_country' => (int) Tools::getCountry(), 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'errorCarrier' => Tools::displayError('You must choose a carrier.', false), 'errorTOS' => Tools::displayError('You must accept the Terms of Service.', false), 'isPaymentStep' => isset($_GET['isPaymentStep']) && $_GET['isPaymentStep'], 'genders' => Gender::getGenders(), 'one_phone_at_least' => (int) Configuration::get('PS_ONE_PHONE_AT_LEAST'), 'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('displayCustomerAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')));
$years = Tools::dateYears();
$months = Tools::dateMonths();
$days = Tools::dateDays();
$this->context->smarty->assign(array('years' => $years, 'months' => $months, 'days' => $days));
/* Load guest informations */
if ($this->isLogged && $this->context->cookie->is_guest) {
$this->context->smarty->assign('guestInformations', $this->_getGuestInformations());
}
// ADDRESS
if ($this->isLogged) {
$this->_assignAddress();
}
// CARRIER
$this->_assignCarrier();
// PAYMENT
$this->_assignPayment();
Tools::safePostVars();
$newsletter = Configuration::get('PS_CUSTOMER_NWSL') || Module::isInstalled('blocknewsletter') && Module::getInstanceByName('blocknewsletter')->active;
$this->context->smarty->assign('newsletter', $newsletter);
$this->context->smarty->assign('optin', (bool) Configuration::get('PS_CUSTOMER_OPTIN'));
$this->context->smarty->assign('field_required', $this->context->customer->validateFieldsRequiredDatabase());
$this->_processAddressFormat();
$link = new Link();
if (Tools::getValue('deleteFromOrderLine')) {
$id_product = Tools::getValue('id_product');
$date_from = Tools::getValue('date_from');
$date_to = Tools::getValue('date_to');
$obj_cart_bk_data = new HotelCartBookingData();
$cart_data_dlt = $obj_cart_bk_data->deleteRoomDataFromOrderLine($this->context->cart->id, $this->context->cart->id_guest, $id_product, $date_from, $date_to);
if ($cart_data_dlt) {
Tools::redirect($link->getPageLink('order', null, $this->context->language->id));
}
}
if ((bool) Configuration::get('PS_ADVANCED_PAYMENT_API')) {
$this->addJS(_THEME_JS_DIR_ . 'advanced-payment-api.js');
$this->setTemplate(_PS_THEME_DIR_ . 'order-opc-advanced.tpl');
} else {
if (Module::isInstalled('hotelreservationsystem')) {
require_once _PS_MODULE_DIR_ . 'hotelreservationsystem/define.php';
$obj_cart_bk_data = new HotelCartBookingData();
$obj_htl_bk_dtl = new HotelBookingDetail();
$obj_rm_type = new HotelRoomType();
$htl_rm_types = $this->context->cart->getProducts();
if (!empty($htl_rm_types)) {
foreach ($htl_rm_types as $type_key => $type_value) {
$product = new Product($type_value['id_product'], false, $this->context->language->id);
$cover_image_arr = $product->getCover($type_value['id_product']);
if (!empty($cover_image_arr)) {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id . '-' . $cover_image_arr['id_image'], 'small_default');
} else {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code . "-default", 'small_default');
}
$unit_price = Product::getPriceStatic($type_value['id_product'], true, null, 6, null, false, true, 1);
if (isset($this->context->customer->id)) {
$cart_bk_data = $obj_cart_bk_data->getOnlyCartBookingData($this->context->cart->id, $this->context->cart->id_guest, $type_value['id_product']);
} else {
$cart_bk_data = $obj_cart_bk_data->getOnlyCartBookingData($this->context->cart->id, $this->context->cart->id_guest, $type_value['id_product']);
}
$rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($type_value['id_product']);
$cart_htl_data[$type_key]['id_product'] = $type_value['id_product'];
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
$cart_htl_data[$type_key]['name'] = $product->name;
$cart_htl_data[$type_key]['unit_price'] = $unit_price;
$cart_htl_data[$type_key]['adult'] = $rm_dtl['adult'];
$cart_htl_data[$type_key]['children'] = $rm_dtl['children'];
foreach ($cart_bk_data as $data_k => $data_v) {
//.........这里部分代码省略.........
示例5: assignCountries
/**
* Assign countries var to smarty
*/
protected function assignCountries()
{
// Select the most appropriate country
if (isset($_POST['id_country']) && is_numeric($_POST['id_country'])) {
$selectedCountry = (int) $_POST['id_country'];
}
if (!isset($selectedCountry)) {
$selectedCountry = (int) Configuration::get('PS_COUNTRY_DEFAULT');
}
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
$this->context->smarty->assign(array('countries' => $countries, 'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'sl_country' => isset($selectedCountry) ? $selectedCountry : 0, 'vat_management' => Configuration::get('VATNUMBER_MANAGEMENT')));
}
示例6: assignCountries
/**
* Assign countries var to smarty
*/
protected function assignCountries()
{
if (isset($this->create_account)) {
// Select the most appropriate country
if (isset($_POST['id_country']) && is_numeric($_POST['id_country'])) {
$selectedCountry = (int) $_POST['id_country'];
}
/* FIXME : language iso and country iso are not similar,
* maybe an associative table with country an language can resolve it,
* But for now it's a bug !
* @see : bug #6968
* @link:http://www.prestashop.com/bug_tracker/view/6968/
elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
$array = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (Validate::isLanguageIsoCode($array[0]))
{
$selectedCountry = Country::getByIso($array[0]);
if (!$selectedCountry)
$selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT'));
}
}*/
if (!isset($selectedCountry)) {
$selectedCountry = (int) Configuration::get('PS_COUNTRY_DEFAULT');
}
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
$this->context->smarty->assign(array('countries' => $countries, 'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'sl_country' => isset($selectedCountry) ? $selectedCountry : 0, 'vat_management' => Configuration::get('VATNUMBER_MANAGEMENT')));
}
}
示例7: initContent
public function initContent()
{
$this->context->controller->addJS(self::$amz_payments->getPathUri() . 'views/js/amzpayments_checkout.js');
$this->context->cart->id_address_delivery = null;
$this->context->cart->id_address_invoice = null;
parent::initContent();
if (empty($this->context->cart->id_carrier)) {
$checked = $this->context->cart->simulateCarrierSelectedOutput();
$checked = (int) Cart::desintifier($checked);
$this->context->cart->id_carrier = $checked;
$this->context->cart->update();
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
}
$this->_assignSummaryInformations();
$this->_assignWrappingAndTOS();
$selected_country = (int) Configuration::get('PS_COUNTRY_DEFAULT');
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
$free_shipping = false;
foreach ($this->context->cart->getCartRules() as $rule) {
if ($rule['free_shipping'] && !$rule['carrier_restriction']) {
$free_shipping = true;
break;
}
}
$this->context->smarty->assign(array('advanced_payment_api' => false, 'free_shipping' => $free_shipping, 'isGuest' => isset($this->context->cookie->is_guest) ? $this->context->cookie->is_guest : 0, 'countries' => $countries, 'sl_country' => isset($selected_country) ? $selected_country : 0, 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'errorCarrier' => Tools::displayError('You must choose a carrier.', false), 'errorTOS' => Tools::displayError('You must accept the Terms of Service.', false), 'isPaymentStep' => (bool) Tools::getIsset(Tools::getValue('isPaymentStep')) && Tools::getValue('isPaymentStep'), 'genders' => Gender::getGenders(), 'one_phone_at_least' => (int) Configuration::get('PS_ONE_PHONE_AT_LEAST'), 'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('displayCustomerAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')));
$years = Tools::dateYears();
$months = Tools::dateMonths();
$days = Tools::dateDays();
$this->context->smarty->assign(array('years' => $years, 'months' => $months, 'days' => $days));
$this->_assignCarrier();
Tools::safePostVars();
$blocknewsletter = Module::getInstanceByName('blocknewsletter');
$this->context->smarty->assign('newsletter', (bool) $blocknewsletter && $blocknewsletter->active);
$this->context->smarty->assign(array('amz_module_path' => self::$amz_payments->getPathUri(), 'amz_session' => Tools::getValue('session') ? Tools::getValue('session') : $this->context->cookie->amazon_id, 'sellerID' => Configuration::get('AMZ_MERCHANT_ID'), 'sandboxMode' => false));
if (isset($this->context->cookie->amz_access_token) && $this->context->cookie->amz_access_token != '' && !AmazonPaymentsCustomerHelper::customerHasAmazonCustomerId($this->context->cookie->id_customer)) {
$this->context->smarty->assign('show_amazon_account_creation_allowed', true);
} else {
$this->context->smarty->assign('show_amazon_account_creation_allowed', false);
}
$this->context->smarty->assign('preselect_create_account', Configuration::get('PRESELECT_CREATE_ACCOUNT') == 1);
$this->context->smarty->assign('force_account_creation', Configuration::get('FORCE_ACCOUNT_CREATION') == 1);
if (Configuration::get('TEMPLATE_VARIANT_BS') == 1) {
$this->setTemplate('amzpayments_bs.tpl');
} else {
$this->setTemplate('amzpayments.tpl');
}
}
示例8: assignCountries
/**
* Assign template vars related to countries display
*/
protected function assignCountries()
{
// Get selected country
if (Tools::isSubmit('id_country') && !is_null(Tools::getValue('id_country')) && is_numeric(Tools::getValue('id_country'))) {
$selected_country = (int) Tools::getValue('id_country');
} else {
if (isset($this->_address) && isset($this->_address->id_country) && !empty($this->_address->id_country) && is_numeric($this->_address->id_country)) {
$selected_country = (int) $this->_address->id_country;
} else {
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
// get all countries as language (xy) or language-country (wz-XY)
$array = array();
preg_match("#(?<=-)\\w\\w|\\w\\w(?!-)#", $_SERVER['HTTP_ACCEPT_LANGUAGE'], $array);
if (!Validate::isLanguageIsoCode($array[0]) || !($selected_country = Country::getByIso($array[0]))) {
$selected_country = (int) Configuration::get('PS_COUNTRY_DEFAULT');
}
} else {
$selected_country = (int) Configuration::get('PS_COUNTRY_DEFAULT');
}
}
}
// Generate countries list
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
// @todo use helper
$list = '';
foreach ($countries as $country) {
$selected = $country['id_country'] == $selected_country ? 'selected="selected"' : '';
$list .= '<option value="' . (int) $country['id_country'] . '" ' . $selected . '>' . htmlentities($country['name'], ENT_COMPAT, 'UTF-8') . '</option>';
}
// Assign vars
$this->context->smarty->assign(array('countries_list' => $list, 'countries' => $countries));
}
示例9: assignCountries
protected function assignCountries()
{
${"GLOBALS"}["vjnnsubap"] = "list";
$vhheljumal = "selected_country";
$zryhlvp = "list";
$tjuksry = "countries";
${"GLOBALS"}["vpjnzdqa"] = "countries";
if (Tools::isSubmit("country") && !is_null(Tools::getValue("country")) && is_numeric(Tools::getValue("country"))) {
${$vhheljumal} = (int) Tools::getValue("country");
} else {
if (isset($this->sellerinfo) && isset($this->sellerinfo->country) && !empty($this->sellerinfo->country) && is_numeric($this->sellerinfo->country)) {
${${"GLOBALS"}["ontiydub"]} = (int) $this->sellerinfo->country;
} else {
if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) {
$duwbhhjzvvl = "array";
${$duwbhhjzvvl} = preg_split("/,|-/", $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
/*if (!Validate::isLanguageIsoCode(${${"GLOBALS"}["tjlrhpthnf"]}[0]) || !(${${"GLOBALS"}["ontiydub"]} = Country::getByIso(${${"GLOBALS"}["tjlrhpthnf"]}[0])))
${${"GLOBALS"}["ontiydub"]} = (int) Configuration::get("PS_COUNTRY_DEFAULT");*/
} else {
${${"GLOBALS"}["ontiydub"]} = (int) Configuration::get("PS_COUNTRY_DEFAULT");
}
}
}
if (Configuration::get("PS_RESTRICT_DELIVERED_COUNTRIES")) {
${${"GLOBALS"}["vpjnzdqa"]} = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
${${"GLOBALS"}["coohkibbnl"]} = Country::getCountries($this->context->language->id, true);
}
${$zryhlvp} = "";
// echo 'COUNTRY: ' . Tools::getValue("country") . "\n";
foreach (${$tjuksry} as ${${"GLOBALS"}["flggvi"]}) {
// echo ${${"GLOBALS"}["flggvi"]}["name"] . "\n";
$selected = Tools::getValue("country") == ${${"GLOBALS"}["flggvi"]}["name"] ? 'selected="selected"' : 'NO';
// echo $selected . "\n";
${"GLOBALS"}["fjhrecq"] = "country";
${"GLOBALS"}["qwgsebzu"] = "selected_country";
${"GLOBALS"}["siifuhtsc"] = "list";
// Selected
@(${${"GLOBALS"}["orvncxo"]} = ${${"GLOBALS"}["fjhrecq"]}["name"] == ${${"GLOBALS"}["qwgsebzu"]} ? "selected=\"selected\"" : "");
$tiaupxkdtky = "country";
${${"GLOBALS"}["siifuhtsc"]} .= "<option " . $selected . "value=\"" . htmlentities(${${"GLOBALS"}["flggvi"]}["name"], ENT_COMPAT, "UTF-8") . "\">" . htmlentities(${${"GLOBALS"}["flggvi"]}["name"], ENT_COMPAT, "UTF-8") . "</option>";
}
$this->context->smarty->assign(array("countries_list" => ${${"GLOBALS"}["vjnnsubap"]}, "countries" => ${${"GLOBALS"}["coohkibbnl"]}));
}
示例10: assignCountries
protected function assignCountries()
{
$qcoysueo = "selected_country";
$brnohvtad = "selected_country";
${"GLOBALS"}["bshcoeb"] = "country";
if (Tools::isSubmit("id_country") && !is_null(Tools::getValue("id_country")) && is_numeric(Tools::getValue("id_country"))) {
${$brnohvtad} = (int) Tools::getValue("id_country");
} else {
if (isset($this->sellerinfo) && isset($this->sellerinfo->id_country) && !empty($this->sellerinfo->id_country) && is_numeric($this->sellerinfo->id_country)) {
${$qcoysueo} = (int) $this->sellerinfo->id_country;
} else {
if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) {
$ywiomnxv = "selected_country";
$irkslognd = "array";
${$irkslognd} = preg_split("/,|-/", $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
if (!Validate::isLanguageIsoCode(${${"GLOBALS"}["ujwvmuqxlqu"]}[0]) || !(${${"GLOBALS"}["poexqmjljv"]} = Country::getByIso(${${"GLOBALS"}["ujwvmuqxlqu"]}[0]))) {
${$ywiomnxv} = (int) Configuration::get("PS_COUNTRY_DEFAULT");
}
} else {
${${"GLOBALS"}["poexqmjljv"]} = (int) Configuration::get("PS_COUNTRY_DEFAULT");
}
}
}
$jasmsd = "list";
if (Configuration::get("PS_RESTRICT_DELIVERED_COUNTRIES")) {
${${"GLOBALS"}["yseltbpqjcm"]} = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
${${"GLOBALS"}["yseltbpqjcm"]} = Country::getCountries($this->context->language->id, true);
}
${$jasmsd} = "";
foreach (${${"GLOBALS"}["yseltbpqjcm"]} as ${${"GLOBALS"}["bshcoeb"]}) {
${"GLOBALS"}["mnphxfotp"] = "country";
$kdrxfnvdvkm = "country";
${"GLOBALS"}["vfiytny"] = "selected";
${"GLOBALS"}["xpjkdr"] = "list";
${"GLOBALS"}["ffhdyh"] = "selected";
${"GLOBALS"}["thqfbs"] = "country";
${${"GLOBALS"}["ffhdyh"]} = ${${"GLOBALS"}["mnphxfotp"]}["id_country"] == ${${"GLOBALS"}["poexqmjljv"]} ? "selected=\"selected\"" : "";
${${"GLOBALS"}["xpjkdr"]} .= "<option value=\"" . (int) ${$kdrxfnvdvkm}["id_country"] . "\" " . ${${"GLOBALS"}["vfiytny"]} . ">" . htmlentities(${${"GLOBALS"}["thqfbs"]}["name"], ENT_COMPAT, "UTF-8") . "</option>";
}
$this->context->smarty->assign(array("countries_list" => ${${"GLOBALS"}["opsfmtdnn"]}, "countries" => ${${"GLOBALS"}["yseltbpqjcm"]}));
}
示例11: initContent
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
// SHOPPING CART
$this->_assignSummaryInformations();
// WRAPPING AND TOS
$this->_assignWrappingAndTOS();
$selectedCountry = (int) Configuration::get('PS_COUNTRY_DEFAULT');
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$countries = Country::getCountries($this->context->language->id, true);
}
// If a rule offer free-shipping, force hidding shipping prices
$free_shipping = false;
foreach ($this->context->cart->getCartRules() as $rule) {
if ($rule['free_shipping']) {
$free_shipping = true;
break;
}
}
$this->context->smarty->assign(array('free_shipping' => $free_shipping, 'isGuest' => isset($this->context->cookie->is_guest) ? $this->context->cookie->is_guest : 0, 'countries' => $countries, 'sl_country' => isset($selectedCountry) ? $selectedCountry : 0, 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'errorCarrier' => Tools::displayError('You must choose a carrier before', false), 'errorTOS' => Tools::displayError('You must accept the Terms of Service before', false), 'isPaymentStep' => (bool) (isset($_GET['isPaymentStep']) && $_GET['isPaymentStep']), 'genders' => Gender::getGenders()));
/* Call a hook to display more information on form */
self::$smarty->assign(array('HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('displayCustomerAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')));
$years = Tools::dateYears();
$months = Tools::dateMonths();
$days = Tools::dateDays();
$this->context->smarty->assign(array('years' => $years, 'months' => $months, 'days' => $days));
/* Load guest informations */
if ($this->isLogged && $this->context->cookie->is_guest) {
$this->context->smarty->assign('guestInformations', $this->_getGuestInformations());
}
if ($this->isLogged) {
$this->_assignAddress();
}
// ADDRESS
// CARRIER
$this->_assignCarrier();
// PAYMENT
$this->_assignPayment();
Tools::safePostVars();
$this->context->smarty->assign('newsletter', (int) Module::getInstanceByName('blocknewsletter')->active);
$this->_processAddressFormat();
$this->setTemplate(_PS_THEME_DIR_ . 'order-opc.tpl');
}
示例12: makeAddressForm
protected function makeAddressForm()
{
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$availableCountries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
$availableCountries = Country::getCountries($this->context->language->id, true);
}
$form = new CustomerAddressForm($this->context->smarty, $this->context->language, $this->getTranslator(), $this->makeAddressPersister(), new CustomerAddressFormatter($this->context->country, $this->getTranslator(), $availableCountries));
$form->setAction($this->getCurrentURL());
return $form;
}
示例13: processSubmitSellerinfo
protected function processSubmitSellerinfo()
{
$lang_cookie = self::$cookie->id_lang;
if ($lang_cookie != 1) {
$_POST['address1_1'] = $_POST['address1_' . $lang_cookie];
$_POST['address2_1'] = $_POST['address1_' . $lang_cookie];
$_POST['address2_1'] = $_POST['address1_' . $lang_cookie];
$_POST['city_1'] = $_POST['city_' . $lang_cookie];
$_POST['description_1'] = $_POST['description_' . $lang_cookie];
}
${"GLOBALS"}["vjnnsubap"] = "list";
$vhheljumal = "selected_country";
$zryhlvp = "list";
$tjuksry = "countries";
${"GLOBALS"}["vpjnzdqa"] = "countries";
if (Tools::isSubmit("id_country") && !is_null(Tools::getValue("id_country")) && is_numeric(Tools::getValue("id_country"))) {
${$vhheljumal} = (int) Tools::getValue("id_country");
} else {
if (isset($this->sellerinfo) && isset($this->sellerinfo->id_country) && !empty($this->sellerinfo->id_country) && is_numeric($this->sellerinfo->id_country)) {
${${"GLOBALS"}["ontiydub"]} = (int) $this->sellerinfo->id_country;
} else {
if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) {
$duwbhhjzvvl = "array";
${$duwbhhjzvvl} = preg_split("/,|-/", $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
if (!Validate::isLanguageIsoCode(${${"GLOBALS"}["tjlrhpthnf"]}[0]) || !(${${"GLOBALS"}["ontiydub"]} = Country::getByIso(${${"GLOBALS"}["tjlrhpthnf"]}[0]))) {
${${"GLOBALS"}["ontiydub"]} = (int) Configuration::get("PS_COUNTRY_DEFAULT");
}
} else {
${${"GLOBALS"}["ontiydub"]} = (int) Configuration::get("PS_COUNTRY_DEFAULT");
}
}
}
if (Configuration::get("PS_RESTRICT_DELIVERED_COUNTRIES")) {
${${"GLOBALS"}["vpjnzdqa"]} = Carrier::getDeliveredCountries($this->context->language->id, true, true);
} else {
${${"GLOBALS"}["coohkibbnl"]} = Country::getCountries($this->context->language->id, true);
}
${$zryhlvp} = "";
$countries = ${$tjuksry};
/**************** LANGUAGE LEVEL *******************/
$seller_id_lang = $this->sellerinfo->id_seller;
$langLevel = Tools::getValue("lang_level");
$dialect = Tools::getValue("lang");
$main_lang = Tools::getValue('main_lang');
/*foreach ($dialect as $key => $value) {
$level = $langLevel[$key];
Db::getInstance(_PS_USE_SQL_SLAVE_)->execute("
INSERT INTO " . _DB_PREFIX_ . "sellerinfo_language (seller_id, language, language_level)
VALUES ('$seller_id_lang', '$value', '$level')
");
}*/
// die('<pre>' . print_r($dialect, true));
$langLevel = implode(',', Tools::getValue("lang_level"));
$languages = implode(',', Tools::getValue("lang"));
$this->sellerinfo->language = $languages;
$this->sellerinfo->language_level = $langLevel;
$this->sellerinfo->main_language = $main_lang;
$jlbwjt = "shop_name";
${"GLOBALS"}["oonrqhi"] = "shop_name";
${"GLOBALS"}["zlobvkbr"] = "virtual_uri";
AgileMultipleSeller::ensure_date_custom_field();
$uskhfeodhv = "zip_code_format";
${${"GLOBALS"}["oonrqhi"]} = "";
if (isset($_POST["shop_name"])) {
${$jlbwjt} = trim($_POST["shop_name"], " ");
}
$famsbcd = "country";
if (isset($_POST["virtual_uri"])) {
${${"GLOBALS"}["zlobvkbr"]} = Tools::link_rewrite(trim($_POST["virtual_uri"], " /")) . "/";
}
/*if (empty($_POST["postcode"]))
$this->errors[] = Tools::displayError("Postcode is required field.");*/
if (empty($_POST["address1_1"])) {
$this->errors[] = Tools::displayError("Address is required field.");
}
if (empty($_POST["city_1"])) {
$this->errors[] = Tools::displayError("City is required field.");
}
if (empty($_POST["phone"])) {
$this->errors[] = Tools::displayError("Phone is required field.");
}
$this->errors = array_merge($this->errors, $this->sellerinfo->validateController());
$this->sellerinfo->id_customer = self::$cookie->id_customer;
if (Module::isInstalled("agilemultipleshop")) {
$mcovgfrp = "shop_name";
${"GLOBALS"}["xdpblji"] = "seller_shopurl";
if (empty(${$mcovgfrp})) {
$this->errors[] = Tools::displayError("The shop name can not be empty.");
}
if (empty($_POST["virtual_uri"]) and (int) Configuration::get("ASP_SHOP_URL_MODE") == agilemultipleshop::SHOP_URL_MODE_VIRTUAL) {
$this->errors[] = Tools::displayError("The shop Virtual Uri can not be empty.");
}
${"GLOBALS"}["edessnqo"] = "id_found";
${"GLOBALS"}["kkzhciyk"] = "seller_shop";
if ($this->sellerinfo->id_shop <= 1) {
$this->sellerinfo->id_shop = 0;
}
${${"GLOBALS"}["kkzhciyk"]} = new Shop($this->sellerinfo->id_shop);
if (Shop::shop_name_duplicated(${${"GLOBALS"}["oxjolt"]}, $seller_shop->id)) {
$this->errors[] = Tools::displayError("The shop name you select has been used by other seller. Please choose a new one.");
//.........这里部分代码省略.........
示例14: process
public function process()
{
// SHOPPING CART
$this->_assignSummaryInformations();
// WRAPPING AND TOS
$this->_assignWrappingAndTOS();
$selectedCountry = (int) Configuration::get('PS_COUNTRY_DEFAULT');
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries((int) self::$cookie->id_lang, true, true);
} else {
$countries = Country::getCountries((int) self::$cookie->id_lang, true);
}
self::$smarty->assign(array('isLogged' => $this->isLogged, 'isGuest' => isset(self::$cookie->is_guest) ? self::$cookie->is_guest : 0, 'countries' => $countries, 'sl_country' => isset($selectedCountry) ? $selectedCountry : 0, 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'errorCarrier' => Tools::displayError('You must choose a carrier before', false), 'errorTOS' => Tools::displayError('You must accept terms of service before', false), 'isPaymentStep' => (bool) (isset($_GET['isPaymentStep']) and $_GET['isPaymentStep'])));
/* Call a hook to display more information on form */
self::$smarty->assign(array('HOOK_CREATE_ACCOUNT_FORM' => Module::hookExec('createAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Module::hookExec('createAccountTop')));
$years = Tools::dateYears();
$months = Tools::dateMonths();
$days = Tools::dateDays();
self::$smarty->assign(array('years' => $years, 'months' => $months, 'days' => $days));
/* Load guest informations */
if ($this->isLogged and self::$cookie->is_guest) {
self::$smarty->assign('guestInformations', $this->_getGuestInformations());
}
if ($this->isLogged) {
$this->_assignAddress();
}
// ADDRESS
// CARRIER
$this->_assignCarrier();
// PAYMENT
$this->_assignPayment();
Tools::safePostVars();
if ($blocknewsletter = Module::getInstanceByName('blocknewsletter')) {
self::$smarty->assign('newsletter', (int) $blocknewsletter->active);
} else {
self::$smarty->assign('newsletter', 0);
}
}
示例15: process
public function process()
{
parent::process();
/* Secure restriction for guest */
if (self::$cookie->is_guest) {
Tools::redirect('addresses.php');
}
if (Tools::isSubmit('id_country') and Tools::getValue('id_country') != NULL and is_numeric(Tools::getValue('id_country'))) {
$selectedCountry = (int) Tools::getValue('id_country');
} elseif (isset($this->_address) and isset($this->_address->id_country) and !empty($this->_address->id_country) and is_numeric($this->_address->id_country)) {
$selectedCountry = (int) $this->_address->id_country;
} elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$array = preg_split('/,|-/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (!Validate::isLanguageIsoCode($array[0]) or !($selectedCountry = Country::getByIso($array[0]))) {
$selectedCountry = (int) Configuration::get('PS_COUNTRY_DEFAULT');
}
} else {
$selectedCountry = (int) Configuration::get('PS_COUNTRY_DEFAULT');
}
if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
$countries = Carrier::getDeliveredCountries((int) self::$cookie->id_lang, true, true);
} else {
$countries = Country::getCountries((int) self::$cookie->id_lang, true);
}
$countriesList = '';
foreach ($countries as $country) {
$countriesList .= '<option value="' . (int) $country['id_country'] . '" ' . ($country['id_country'] == $selectedCountry ? 'selected="selected"' : '') . '>' . htmlentities($country['name'], ENT_COMPAT, 'UTF-8') . '</option>';
}
if ((Configuration::get('VATNUMBER_MANAGEMENT') and file_exists(_PS_MODULE_DIR_ . 'vatnumber/vatnumber.php')) && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT'))) {
self::$smarty->assign('vat_display', 2);
} elseif (Configuration::get('VATNUMBER_MANAGEMENT')) {
self::$smarty->assign('vat_display', 1);
} else {
self::$smarty->assign('vat_display', 0);
}
self::$smarty->assign('ajaxurl', _MODULE_DIR_);
self::$smarty->assign('vatnumber_ajax_call', (int) file_exists(_PS_MODULE_DIR_ . 'vatnumber/ajax.php'));
self::$smarty->assign(array('countries_list' => $countriesList, 'countries' => $countries, 'errors' => $this->errors, 'token' => Tools::getToken(false), 'select_address' => (int) Tools::getValue('select_address')));
}