Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Setting SimpleShipping and TaxCalculator--- its not working


Go to End


5 Posts   1724 Views

Avatar
stooni

Community Member, 89 Posts

7 May 2008 at 9:44pm

Edited: 08/05/2008 3:18am

I have setting in _config.php following parameters!

SimpleShippingCalculator::set_charges(10);
TaxCalculator::set_for_country("CH", 7.6, "MWST", "inclusive");

and in the Order.php
$shipping = '$' . number_format($sc->Shipping(), 2);
$tax = '$' . number_format($sc->calcAddedTax(), 2);
remove the Comment // signs ...

it still does not working???

Can any body help me!!!

Thanks ---stooni

Avatar
stooni

Community Member, 89 Posts

8 May 2008 at 7:55am

Setting SimpleShipping --- is ok. in the new version functionaly

because when i set

TaxCalculator::set_for_country("CH", 7.6, "MWST.", "inclusive");

in the ecommerce/_config.php then nothing dooing also when i db/build... or /?flush=1 ...???
???

thanks for help!

--stooni

Avatar
stooni

Community Member, 89 Posts

9 May 2008 at 7:45pm

in the documentation TaxCalculator is wrong!!!
// Set the tax calculation to be for NZ customers at 12.5% exclusive
// on the order price.
TaxCalculator::set_for_country("NZ", 0.125, "GST", "exclusive");

when i take this one in the log saying

PHP Fatal error: Class 'TaxCalculator' not found in /var/www/vhosts/webjobs.ch/subdomains/const/httpdocs/ecommerce/_config.php on line 17,

Some Help?

Thanks!
---Stooni

Avatar
stooni

Community Member, 89 Posts

10 May 2008 at 8:47pm

These its working
SimpleShippingModifier::set_charges_for_countries(array(
'CH' => 10,
'DE' => 25,
));

because these not working
TaxModifier::set_for_country("CH", 7.6, "MWST.", "inclusive");

You Check on http://const.webjobs.ch/products/

thanks for help

--- stooni!

Avatar
stooni

Community Member, 89 Posts

15 May 2008 at 7:15am

Must i write the command these way

Order::set_modifiers(TaxModifier::set_for_country("CH", 7.6, "MWST.", "inclusive"));

perhaps is Romain Louis here he has write the new TaxModifier???

Thanks for Help stooni