本文整理汇总了PHP中Payment::set_site_currency方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::set_site_currency方法的具体用法?PHP Payment::set_site_currency怎么用?PHP Payment::set_site_currency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::set_site_currency方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
function setUp()
{
parent::setUp();
/* Set the modifiers to test */
Order::set_modifiers(array('SimpleShippingModifier', 'TaxModifier'));
/* Set the tax configuration on a per-country basis to test */
TaxModifier::set_for_country('NZ', 0.125, 'GST', 'inclusive');
TaxModifier::set_for_country('UK', 0.175, 'VAT', 'exclusive');
/* Let's check that we have the Payment module installed properly */
$this->assertTrue(class_exists('Payment'), 'Payment module is installed.');
/* Set the site currency to NZD - this updates all the pricing labels from USD to NZD */
Payment::set_site_currency('NZD');
/* Set up the simple shipping calculator to test */
SimpleShippingModifier::set_default_charge(10);
SimpleShippingModifier::set_charges_for_countries(array('NZ' => 5, 'UK' => 20));
}
示例2:
<?php
/**
* Reset to all default configuration settings.
*/
// * * * NON-ECOMMERCE SETTINGS
Payment::set_site_currency('USD');
Geoip::$default_country_code = false;
//i18n::set_locale('');
// * * * ECOMMERCE I18N SETTINGS
EcommerceCurrency::setDecimalDelimiter('.');
EcommerceCurrency::setThousandDelimiter('');
Object::useCustomClass('SS_Datetime', 'I18nDatetime', true);
// * * * SHOPPING CART, ORDER, MODIFIERS
Order::set_email(null);
Order::set_receipt_subject("Shop Sale Information #%d");
Order::set_modifiers(array(), true);
Order::set_table_overview_fields(array('ID' => 'Order No', 'Created' => 'Created', 'FirstName' => 'First Name', 'Surname' => 'Surname', 'Total' => 'Total', 'Status' => 'Status'));
Order::set_maximum_ignorable_sales_payments_difference(0.01);
Order::set_order_id_start_number(0);
Order::set_cancel_before_payment(true);
Order::set_cancel_before_processing(false);
Order::set_cancel_before_sending(false);
Order::set_cancel_after_sending(false);
OrderForm::set_user_membership_optional(false);
OrderForm::set_force_membership(true);
OrderManipulation::set_allow_cancelling(false);
OrderManipulation::set_allow_paying(false);
// * * * PRODUCTS
ProductsAndGroupsModelAdmin::set_managed_models(array("Product", "ProductGroup", "ProductVariation", "ProductAttributeType"));
Product_Image::set_thumbnail_size(140, 100);
示例3:
<?php
/**
* Example eCommerce configuration file.
*
* This file is tested in the 'EcommerceTest' unit test.
*
* copy the lines below to your mysite/_config.php file and set as required.
*/
// * * * NON-ECOMMERCE SETTINGS
Payment::set_site_currency('NZD');
Geoip::$default_country_code = "NZ";
i18n::set_locale('en_NZ');
setlocale(LC_TIME, 'en_NZ@dollar', 'en_NZ.UTF-8', 'en_NZ', 'nz', 'nz');
// * * * ECOMMERCE I18N SETTINGS
EcommerceCurrency::setDecimalDelimiter('.');
//for Money formating
EcommerceCurrency::setThousandDelimiter(',');
//for Money formating
Object::useCustomClass('SS_Datetime', 'I18nDatetime', true);
// * * * SHOPPING CART AND ORDER
Order::set_email("sales@myshop.com");
Order::set_receipt_subject("Thank you for your order at www.myshop.com - Order #%d");
Order::set_modifiers(array("FlatTaxModifier", "SimpleShippingModifier"));
Order::set_table_overview_fields(array('Total' => 'Total', 'Status' => 'Status'));
//
Order::set_maximum_ignorable_sales_payments_difference(0.001);
//sometimes there are small discrepancies in total (for various reasons)- here you can set the max allowed differences
Order::set_order_id_start_number(1234567);
//sets a start number for order ID, so that they do not start at one.
Order::set_cancel_before_payment(false);