1.0.8.3 Questions / Comments / Concerns

Ask the community for help and support.
markg
Posts: 8
Joined: Thu May 13, 2021 7:20 am
Has thanked: 4 times

VAT/tax not being added since update to 1.0.8.3

Post by markg »

I installed 1.0.8.2 as an evaluation as I need to do update an old OSCommerce site. I imported my old SQL data (categories/products/zones) and managed to get it working ok. Set prices to show with VAT inc. Showed as expected.

I then updated to 1.0.8.3 earlier this week. I've done a fair bit of tweaking but none that edited the base code. I noticed earlier today that the prices weren't showing as VAT included. I can't see anything wrong though.

So I then did a separate fresh install of 1.0.8.3 and done another import of the data (i.e. no code changes or additions). The correct VAT is showing in admin (in admin, the products gross price definitely has the VAT added). In admin, I've definitely set the store country and zone correctly. However, all front end prices are VAT less. I'm not logged into the front end (logging in has no effect either).

Anyone seen this?

Tags:
markg
Posts: 8
Joined: Thu May 13, 2021 7:20 am
Has thanked: 4 times

Re: VAT/tax not being added since update to 1.0.8.3

Post by markg »

Just did a fresh install of 1.0.8.2 - repeated the above steps (i.e. just SQL import) - VAT is correctly being added on this install.

Then I did a fresh install of 1.0.8.3 - but imported sample data (and none of my own). I set the lemon to $10 and set the tax class to taxable goods. Gross price is $10.7 in admin (7% Florida tax as expected). Set 'display prices with tax' to true - front end is showing $10 though.

So - definitely a bug somewhere
ecartz
Lead Developer
Lead Developer
Posts: 2637
Joined: Tue Nov 05, 2019 6:02 pm
Has thanked: 4 times
Been thanked: 181 times

Re: VAT/tax not being added since update to 1.0.8.3

Post by ecartz »

markg wrote: Thu May 13, 2021 2:04 pm prices weren't showing as VAT included.
TY. https://github.com/CE-PhoenixCart/Phoen ... bbc398e4c9
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Has thanked: 11 times
Been thanked: 4 times

Re: 1.0.8.3 Questions / Comments / Concerns

Post by artfulweb »

Hello,
Since updating I have the following in my logs AND it shows up in the order email confirmation! Do not know what to fix ...

PHP Notice: A non well formed numeric value encountered in /xx/xx/xx/xx/includes/system/versioned/1.0.8.2/currencies.php on line 52
ecartz
Lead Developer
Lead Developer
Posts: 2637
Joined: Tue Nov 05, 2019 6:02 pm
Has thanked: 4 times
Been thanked: 181 times

Re: 1.0.8.3 Questions / Comments / Concerns

Post by ecartz »

artfulweb wrote: Fri May 14, 2021 8:14 pm Hello,
Since updating I have the following in my logs AND it shows up in the order email confirmation! Do not know what to fix ...

PHP Notice: A non well formed numeric value encountered in /xx/xx/xx/xx/includes/system/versioned/1.0.8.2/currencies.php on line 52
Before line 52, add

Code: Select all

error_log(new Exception("$products_price"));
That should add the stack trace to the error log so that you know what called it. Note that it will print more log entries. You'll have to look for the ones just before the notice that you are getting now.
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Has thanked: 11 times
Been thanked: 4 times

Re: 1.0.8.3 Questions / Comments / Concerns

Post by artfulweb »

ecartz wrote: Sat May 15, 2021 2:52 am
artfulweb wrote: Fri May 14, 2021 8:14 pm Hello,
Since updating I have the following in my logs AND it shows up in the order email confirmation! Do not know what to fix ...

PHP Notice: A non well formed numeric value encountered in /xx/xx/xx/xx/includes/system/versioned/1.0.8.2/currencies.php on line 52
Before line 52, add

Code: Select all

error_log(new Exception("$products_price"));
That should add the stack trace to the error log so that you know what called it. Note that it will print more log entries. You'll have to look for the ones just before the notice that you are getting now.
Hello Matt,
Thanks for answering. Here is the log file:

Exception: 4.8333 in /xx/xx/xx/xx/includes/system/versioned/1.0.8.2/currencies.php:52
Stack trace:
#0 /xx/xx/xx/xx/includes/system/versioned/1.0.8.2/currencies.php(85): currencies->calculate_price('4.8333', 20, 1)
#1 /xx/xx/xx/xx/includes/modules/header_tags/ht_product_schema.php(60): currencies->display_raw('4.8333', 20)
#2 /xx/xx/xx/xx/includes/system/versioned/1.0.7.9/osc_template.php(79): ht_product_schema->execute()
#3 /xx/xx/xx/xx/templates/override/includes/components/template_top.php(13): oscTemplate->buildBlocks()
#4 /xx/xx/xx/xx/templates/default/includes/pages/product_info.php(13): require('/xx/xx/xx...')
#5 /xx/xx/xx/xx/product_info.php(25): require('/xx/xx/xx...')
#6 {main}
[15-May-2021 10:59:19 Europe/Paris] Exception: 4.8333 in /xx/xx/xx/xx/includes/system/versioned/1.0.8.2/currencies.php:52
Stack trace:
ecartz
Lead Developer
Lead Developer
Posts: 2637
Joined: Tue Nov 05, 2019 6:02 pm
Has thanked: 4 times
Been thanked: 181 times

Re: 1.0.8.3 Questions / Comments / Concerns

Post by ecartz »

artfulweb wrote: Sat May 15, 2021 9:06 am Here is the log file:
I don't see the notice in that. There's a whole log entry and part of another, but not the notice. What you want to find is an entry with the Exception stack trace followed by the PHP Notice: A non well formed numeric value encountered in

Which suggests to me that it considers 4.8333 well formed. So that this would be one of the non-problematic entries.
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Has thanked: 11 times
Been thanked: 4 times

Re: 1.0.8.3 Questions / Comments / Concerns

Post by artfulweb »

With that code the notice does not appear, without it it reappears so I do not understand. It shows up also in the customers order email confirmation beneath each product price
ecartz
Lead Developer
Lead Developer
Posts: 2637
Joined: Tue Nov 05, 2019 6:02 pm
Has thanked: 4 times
Been thanked: 181 times

Re: 1.0.8.3 Questions / Comments / Concerns

Post by ecartz »

artfulweb wrote: Sat May 15, 2021 3:43 pm With that code the notice does not appear, without it it reappears so I do not understand. It shows up also in the customers order email confirmation beneath each product price
You could try removing it and changing line 52 to

Code: Select all

      return static::round(tep_add_tax((float)"$products_price", $products_tax), $this->currencies[$_SESSION['currency'] ?? DEFAULT_CURRENCY]['decimal_places']) * $quantity;
You also might consider changing the PHP version. There could be a bug in PHP that is exposing itself here.
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Has thanked: 11 times
Been thanked: 4 times

Re: 1.0.8.3 Questions / Comments / Concerns

Post by artfulweb »

I am on PHP 7.4 (the max for Phoenix I believe). Changed the line to the above and still have it.
It only logs during the checkout process.
Post Reply