Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Tax Calculator on Ecommerce module

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

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

Page: 1
Go to End
Author Topic: 66808 Views
  • bubaphex
    Avatar
    Community Member
    12 Posts

    Tax Calculator on Ecommerce module Link to this post

    Hey all,

    Unsure if i should post this here.

    When i enable the tax calculator for the e commerce module i get the following error

    XML Parsing Error: junk after document element
    Location: http://www.mysite.co.nz/ecommerce/
    Line Number 2, Column 1:<b>Notice</b>: Undefined offset: 0 in <b>/var/www/html/am/ss/ecommerce/code/TaxCalculator.php</b> on line <b>53</b><br />
    ^

    All is what ive done is added this to mysite/_config.php:

    // 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");

    if i remove it the price goes away.

    can any one shed some light on why this is happening?

  • Josh
    Avatar
    SilverStripe Developer
    65 Posts

    Re: Tax Calculator on Ecommerce module Link to this post

    Hi bubaphex,

    It looks like this is the Content Negotiator trying to be helpful.

    Go to your mysite/_config.php file and add the following:

    ContentNegotiator::disable();

    Cheers,
    Josh

  • bubaphex
    Avatar
    Community Member
    12 Posts

    Re: Tax Calculator on Ecommerce module Link to this post

    Thanks for the speedy reply Josh,

    The XML error has gone now but has been replaced with

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 53

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 54

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 55

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 53

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 54

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 55

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 53

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 54

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 55

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 53

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 54

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 55

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 53

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 54

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 55

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 53

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 54

    Notice: Undefined offset: 0 in /var/www/html/am/ss/ecommerce/code/TaxCalculator.php on line 55

  • Josh
    Avatar
    SilverStripe Developer
    65 Posts

    Re: Tax Calculator on Ecommerce module Link to this post

    No worries,

    Try turning off PHP error reporting at the NOTICE level.

    again in mysite/_config.php write the following

    error_reporting(E_ALL ^ E_NOTICE);

    (THANKS WILL)

  • bubaphex
    Avatar
    Community Member
    12 Posts

    Re: Tax Calculator on Ecommerce module Link to this post

    thanks josh,

    errors have all gone away but the gst isnt working any more. its not displaying at all.

  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: Tax Calculator on Ecommerce module Link to this post

    All along you've been saying that there is an error at ecommerce/code/TaxCalculator.php on line 55

    Have you looked at that line of code to see what the problem is?

    The messages above are simply supressing the error message, not actually resolving any cause.

  • bubaphex
    Avatar
    Community Member
    12 Posts

    Re: Tax Calculator on Ecommerce module Link to this post

    this is what is found on those three lines

    53      $this->rate = self::$rates_by_country[$country];
    54      $this->name = self::$names_by_country[$country];
    55      $this->excl = self::$excl_by_country[$country];

    66808 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.