コード例 #1
0
 function setUp()
 {
     parent::setUp();
     EcommerceTest::setConfiguration();
     Order::set_modifiers(array("FlatTaxModifer"), true);
     FlatTaxModifier::set_tax(0.15, "GST", true);
     $this->objFromFixture('Product', 'mp3player')->publish('Stage', 'Live');
     ShoppingCart::clear();
 }
コード例 #2
0
OrderManipulation::set_allow_paying();
//shows a payment form
// * * * PRODUCTS
ProductsAndGroupsModelAdmin::set_managed_models(array("Product", "ProductGroup", "ProductVariation"));
Product_Image::set_thumbnail_size(140, 100);
Product_Image::set_content_image_width(200);
Product_Image::set_large_image_width(200);
ProductGroup::set_include_child_groups(true);
ProductGroup::set_must_have_price(true);
ProductGroup::set_sort_options(array('Title' => 'Alphabetical', 'Price' => 'Lowest Price'));
// * * * CHECKOUT
ExpiryDateField::set_short_months(true);
//uses short months (e.g. Jan instead of january) for credit card expiry date.
OrderFormWithoutShippingAddress::set_fixed_country_code("NZ");
//country is fixed
OrderFormWithoutShippingAddress::set_postal_code_url("http://maps.google.com");
//link that can be used to check postal code
OrderFormWithoutShippingAddress::set_postal_code_label("click here to check your postal code");
//label for link that can be used to check postal code
OrderFormWithoutShippingAddress::set_login_invite_alternative_text('<a href="http://www.mysite.com/Security/login/?BackURL=">If you are a member then please log in.</a>');
//label for link that can be used to check postal code
// * * * MEMBER
EcommerceRole::set_group_name("Customers");
// * * * MODIFIERS
FlatTaxModifier::set_tax("0.15", "GST", $exclusive = false);
SimpleShippingModifier::set_default_charge(10);
SimpleShippingModifier::set_charges_for_countries(array('US' => 10, 'NZ' => 5));
TaxModifier::set_for_country($country = "NZ", $rate = 0.15, $name = "GST", $inclexcl = "inclusive");
// * * * HELP
Product::set_global_allow_purchase(false);
//stops the sale of all products