RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/24/2018 : 12:48:30
I have spent time trying to fix this and now come looking to you "gurus" for help.
My clients cart is rounding product prices that end in zero to only have one decimal place (like $5.20 is showing as $5.2) I tried editing the price in the cart admin area and it still drops off the trailing zero. The admin>states area and the includes file are both set to 2 decimal places.
Please help.
Thanks in advance.
Ray Cramblit
|
Sinbad
ECT Moderator
USA
65937 Posts |
Posted - 01/24/2018 : 13:15:51
Hi Ray, can you let us know what country is set in the admin main setting more recent versions no longer use the includes for currency setting as that based on the admin main country setting. It can be over-ridden in the includes if needed. Winners never quit, quitters never win CSS and Responsive DesignsUser Manual for Ecommerce Templates
|
RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/24/2018 : 14:48:03
Country is United States.
Just updated to version 6.84.
BOTH admin area and includes.php are set to 2 decimal places.
Ray Cramblit
|
Sinbad
ECT Moderator
USA
65937 Posts |
Posted - 01/24/2018 : 14:55:10
|
RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/24/2018 : 17:46:49
Commented it out and it made no difference.
Ray Cramblit
|
RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/24/2018 : 21:03:38
I looked inside the cart database in phpMyAdmin.
The pPrice field in the products table of the database has a "type" of DOUBLE. I'm a MySQL novice. I never heard of DOUBLE. It seems like it ought to be DECIMAL or something.
Could that be an issue?
Ray Cramblit
|
Andy
ECT Moderator
95440 Posts |
Posted - 01/25/2018 : 00:06:47
|
RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/25/2018 : 06:32:16
Just checked again and it is set to 2.
Ray Cramblit
|
Andy
ECT Moderator
95440 Posts |
Posted - 01/25/2018 : 09:35:48
|
RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/25/2018 : 09:43:36
Product price in database is 5.2 and the field type is set to DOUBLE
Ray Cramblit
|
RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/25/2018 : 09:47:07
This issue only seems to occur when the last number is a zero. 5.20 is saved as 5.2, 6.50 is saved as 6.5 etc
Ray Cramblit
|
Phil
ECT Moderator
United Kingdom
7715 Posts |
Posted - 01/26/2018 : 08:23:38
|
RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/26/2018 : 09:26:06
I reset to zero then back to 2 with no change.
In the database it shows 2 decimal places. Would it work to change the price field type from DOUBLE to decimal or something?
Ray Cramblit
|
Andy
ECT Moderator
95440 Posts |
Posted - 01/26/2018 : 09:37:41
|
RayCramblit
Advanced Member
USA
173 Posts Pre-sales questions only (More Details...)
|
Posted - 01/26/2018 : 09:50:33
I just realized that the issue is in my coding.
I have products on the clients index page that features the product image and the price. My PHP script is calling the price directly from the cart database. In the cart database the trailing zero is not visible (like $5.20 is in the database as $5.2). My script just echos the $5.2 from the database. But I see that the price on the product detail page is showing $5.20 so the cart is working correctly showing the $5.20 price.
Sorry for bothering you folks with what is a code issue on my part. I have edited my code and all is well.
Thanks for all who tried to help.
Ray Cramblit
|
|
|