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)); }
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