本文整理汇总了PHP中WPSC_Country::set方法的典型用法代码示例。如果您正苦于以下问题:PHP WPSC_Country::set方法的具体用法?PHP WPSC_Country::set怎么用?PHP WPSC_Country::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPSC_Country
的用法示例。
在下文中一共展示了WPSC_Country::set方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _wpsc_add_region_name_meta
/**
* 3.8.14 supports country meta and a feature that let's a countries regions be called by the
* proper name. Here we initialize the values.
*
* @access private
* @since 3.8.14
*
*/
function _wpsc_add_region_name_meta()
{
$wpsc_country = new WPSC_Country('US');
$wpsc_country->set('region_label', __('State', 'wp-e-commerce'));
$wpsc_country = new WPSC_Country('CA');
$wpsc_country->set('region_label', __('Province', 'wp-e-commerce'));
}
示例2: _wpsc_maybe_create_UK
function _wpsc_maybe_create_UK()
{
$country = new WPSC_Country('GB', 'isocode');
if (!$country->exists()) {
$country->set(array('id' => 138, 'country' => __('United Kingdom', 'wpsc'), 'currency' => __('Pound Sterling', 'wpsc'), 'symbol' => __('£', 'wpsc'), 'symbol_html' => __('£', 'wpsc'), 'code' => __('GBP', 'wpsc'), 'continent' => 'europe'));
$country->save();
}
}
示例3: _wpsc_fix_united_kingdom
/**
* Reset United Kingdom country data to default, hide ISO code 'UK'
*
* @access private
* @since 3.8.14
*/
function _wpsc_fix_united_kingdom()
{
if ($wpsc_country = WPSC_Countries::get_country('UK')) {
$legacy_ok_country_was_visible = $wpsc_country->is_visible();
$wpsc_country = new WPSC_Country(array('visible' => '0', 'isocode' => 'UK'));
$wpsc_country->set('_is_country_legacy', true);
}
$wpsc_country = new WPSC_Country(array('country' => __('United Kingdom', 'wpsc'), 'isocode' => 'GB', 'currency' => __('Pound Sterling', 'wpsc'), 'symbol' => __('£', 'wpsc'), 'symbol_html' => __('£', 'wpsc'), 'code' => __('GBP', 'wpsc'), 'continent' => 'europe', 'visible' => $legacy_ok_country_was_visible ? '0' : '1', 'has_regions' => '0', 'tax' => '0'));
//make sure base country is ok after the UK/GB fix
$base_country = get_option('base_country', '');
if (!empty($base_country) && is_numeric($base_country)) {
$wpsc_country = new WPSC_Country($base_country);
if ('UK' == $wpsc_country->get_isocode()) {
$wpsc_country = new WPSC_Country('GB');
update_option('base_country', $wpsc_country->get_id());
}
}
}
示例4:
function test_set()
{
$country = new WPSC_Country(self::COUNTRY_ID_WITHOUT_REGIONS);
$country->set('name', 'XXX');
// This should not set the property.
$name = $country->get('name');
$this->assertEquals(self::COUNTRY_NAME_WITHOUT_REGIONS, $name);
$country->set('isocode', 'XX');
// This should not set the property.
$isocode = $country->get('isocode');
$this->assertEquals(self::COUNTRY_ISOCODE_WITHOUT_REGIONS, $isocode);
$country->set('omgwtfbbq_new', 'OMG');
// This SHOULD set the property.
$omg = $country->get('omgwtfbbq_new');
$this->assertEquals('OMG', $omg);
$country->set('omgwtfbbq_new', '');
// Clear it out.
$omg = $country->get('omgwtfbbq_new');
$this->assertEquals('', $omg);
}
示例5: _wpsc_add_region_label_to_uk
/**
* Add the county region label to the uk
*
* @access private
* @since 3.8.14.1
*/
function _wpsc_add_region_label_to_uk()
{
$wpsc_country = new WPSC_Country('GB');
$wpsc_country->set('region_label', __('County', 'wpsc'));
}
示例6: _wpsc_fix_sudan_currency
function _wpsc_fix_sudan_currency()
{
$country = new WPSC_Country('SD', 'isocode');
$country->set(array('currency' => __('Sudanese Pound', 'wpsc'), 'code' => __('SDG', 'wpsc')));
$country->save();
}
示例7: _wpsc_fix_zimbabwe_currency
function _wpsc_fix_zimbabwe_currency()
{
$country = new WPSC_Country('ZW', 'isocode');
$country->set(array('currency' => __('US Dollar', 'wpsc'), 'symbol' => __('$', 'wpsc'), 'symbol_html' => __('$', 'wpsc'), 'code' => 'USD', 'continent' => 'asiapacific'));
$country->save();
}