17488 Posts in 4473 Topics by 1978 members
Archive
SilverStripe Forums » Archive » TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?
Our old forums are still available as a read-only archive.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 2579 Views |
-
TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?

5 August 2008 at 10:12pm Last edited: 5 August 2008 11:13pm
Please answer above questions because it just does not seem to work!
In the ecommerce documentation it says to add:
TaxCalculator::set_for_country("UK",0.175,"VAT","exclusive");
to the config file but when accessing the site it throws:
Fatal error: Class 'TaxCalculator' not found in /var/www/vhosts/xxxxx.co.uk/httpdocs/mysite/_config.php on line 48
In the ecommerce folders under modifiers there is no TaxCalculator but there is a TaxModifier and the site does not throw a funny if I put:
TaxModifier::set_for_country("UK",0.175,"VAT","exclusive");
but nothing seems to happen?
Thanks
-
Re: TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?

6 August 2008 at 12:57pm
you using the stable or the trunk version of the module?
-
Re: TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?

7 August 2008 at 10:34pm
A daily build
-
Re: TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?

8 August 2008 at 9:17am
Hi,
In the new Ecommerce system, we have removed the code for Tax And Shipping and put them in what we have called "OrderModifier" structure.
To add a modifier to your order structure, you need to execute this code in your _config.php file :
Order::set_modifiers(array('TaxModifier'));
-
Re: TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?

8 August 2008 at 9:37am Last edited: 8 August 2008 9:39am
You'll probably want to update the documention on these new features somewhere, Romain.
Perhaps a new ecommerce wiki page, for the new upcoming version?
-
Re: TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?

14 August 2008 at 1:27am Last edited: 14 August 2008 1:48am
Help. I just added to config:
Order::set_modifiers(array('TaxModifier'));
and on returning to the shopping cart I get this fatal error.
Fatal error: Call to undefined function IsExclusive() in /var/www/vhosts/mysite.co.uk/httpdocs/ecommerce/code/modifiers/TaxModifier.php on line 64
What is wrong?
Should I still have
TaxModifier::set_for_country("UK", 0.175, "VAT", "exclusive");
in the config file?
-
Re: TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?

17 September 2008 at 1:05pm
Its because you havent defined the function IsExclusive() - check your code.
I got this working, but sending the order to paypalpayment doesnt include the modifier items, how do i acheive this?
-
Re: TaxModifier? TaxCalculator? Which one? How do you add tax? What actually happens if Tax works? Has anyone actually implemented Tax - ever?

17 September 2008 at 1:15pm Last edited: 17 September 2008 1:15pm
hey dont worry, figured it out myself, add this below the foreach for items (this is for PayPalPayment.php)
// 3) Items Informations
...// 3.1) Modifiers
if($modifiers = $order->Modifiers()) {
foreach($modifiers as $modifier)
{
$inputs['item_name_' . ++$cpt] = $modifier->TableTitle();
// item_number is unnecessary
$inputs['amount_' . $cpt] = $modifier->LiveAmount();
$inputs['quantity_' . $cpt] = 1;
}
}
| 2579 Views | ||
|
Page:
1
|
Go to Top |





