当前位置: 首页>>代码示例>>PHP>>正文


PHP Lookup::country_inclusive_taxes方法代码示例

本文整理汇总了PHP中Lookup::country_inclusive_taxes方法的典型用法代码示例。如果您正苦于以下问题:PHP Lookup::country_inclusive_taxes方法的具体用法?PHP Lookup::country_inclusive_taxes怎么用?PHP Lookup::country_inclusive_taxes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lookup的用法示例。


在下文中一共展示了Lookup::country_inclusive_taxes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setup

 /**
  * Displays the General Settings screen and processes updates
  *
  * @author Jonathan Davis
  * @since 1.0
  *
  * @return void
  **/
 public function setup()
 {
     if (!current_user_can('shopp_settings')) {
         wp_die(__('You do not have sufficient permissions to access this page.'));
     }
     // Welcome screen handling
     if (!empty($_POST['setup'])) {
         $_POST['settings']['display_welcome'] = 'off';
         shopp_set_formsettings();
     }
     $country = isset($_POST['settings']) && isset($_POST['settings']['base_operations']) ? $_POST['settings']['base_operations']['country'] : '';
     $countries = array();
     $countrydata = Lookup::countries();
     $country_zones = Lookup::country_zones();
     foreach ($countrydata as $iso => $c) {
         if ($country == $iso) {
             $base_region = $c['region'];
         }
         $countries[$iso] = $c['name'];
     }
     // Save settings
     if (!empty($_POST['save']) && isset($_POST['settings'])) {
         check_admin_referer('shopp-setup');
         if (isset($_POST['settings']['base_operations'])) {
             $baseop =& $_POST['settings']['base_operations'];
             $zone = isset($baseop['zone']) && isset($country_zones[$country]) && isset($country_zones[$country][$baseop['zone']]) ? $baseop['zone'] : false;
             if (isset($countrydata[$country])) {
                 $baseop = $countrydata[$country];
             }
             $baseop['country'] = $country;
             $baseop['zone'] = $zone;
             $baseop['currency']['format'] = scan_money_format($baseop['currency']['format']);
             if (is_array($baseop['currency']['format'])) {
                 $fields = array_keys($baseop['currency']['format']);
                 foreach ($fields as $field) {
                     if (isset($baseop['currency'][$field])) {
                         $baseop['currency']['format'][$field] = $baseop['currency'][$field];
                     }
                 }
             }
             shopp_set_setting('tax_inclusive', in_array($country, Lookup::country_inclusive_taxes()) ? 'on' : 'off');
         }
         if (!isset($_POST['settings']['target_markets'])) {
             asort($_POST['settings']['target_markets']);
         }
         shopp_set_formsettings();
         $updated = __('Shopp settings saved.', 'Shopp');
     }
     $operations = shopp_setting('base_operations');
     if (isset($country_zones[$operations['country']])) {
         $zones = $country_zones[$operations['country']];
     }
     $targets = shopp_setting('target_markets');
     if (is_array($targets)) {
         $targets = array_map('stripslashes', $targets);
     }
     if (!$targets) {
         $targets = array();
     }
     include $this->ui('setup.php');
 }
开发者ID:BlessySoftwares,项目名称:anvelocom,代码行数:69,代码来源:Setup.php

示例2: setup

 /**
  * Displays the General Settings screen and processes updates
  *
  * @author Jonathan Davis
  * @since 1.0
  *
  * @return void
  **/
 public function setup()
 {
     if (!current_user_can('shopp_settings')) {
         wp_die(__('You do not have sufficient permissions to access this page.'));
     }
     // Welcome screen handling
     if (!empty($_POST['setup'])) {
         shopp_set_setting('display_welcome', 'off');
     }
     $countries = ShoppLookup::countries();
     $states = array();
     // Save settings
     if (!empty($_POST['save']) && isset($_POST['settings'])) {
         check_admin_referer('shopp-setup');
         if (!isset($_POST['settings']['target_markets'])) {
             asort($_POST['settings']['target_markets']);
         }
         shopp_set_formsettings();
         if (isset($_POST['settings']['base_locale'])) {
             $baseop =& $_POST['settings']['base_locale'];
             if (isset($countries[strtoupper($baseop['country'])])) {
                 // Validate country
                 $country = strtoupper($baseop['country']);
                 $state = '';
                 if (!empty($baseop['state'])) {
                     // Valid state
                     $states = ShoppLookup::country_zones(array($country));
                     if (isset($states[$country][strtoupper($baseop['state'])])) {
                         $state = strtoupper($baseop['state']);
                     }
                 }
                 ShoppBaseLocale()->save($country, $state);
             }
             shopp_set_setting('tax_inclusive', in_array($country, Lookup::country_inclusive_taxes()) ? 'on' : 'off');
         }
         $updated = __('Shopp settings saved.', 'Shopp');
     }
     $basecountry = ShoppBaseLocale()->country();
     $countrymenu = Shopp::menuoptions($countries, $basecountry, true);
     $basestates = ShoppLookup::country_zones(array($basecountry));
     $statesmenu = Shopp::menuoptions($basestates[$basecountry], ShoppBaseLocale()->state(), true);
     $targets = shopp_setting('target_markets');
     if (is_array($targets)) {
         $targets = array_map('stripslashes', $targets);
     }
     if (!$targets) {
         $targets = array();
     }
     include $this->ui('setup.php');
 }
开发者ID:forthrobot,项目名称:inuvik,代码行数:58,代码来源:Setup.php


注:本文中的Lookup::country_inclusive_taxes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。