X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Weird smarty error about currency? (https://forum.x-cart.com/showthread.php?t=46926)

Christofer 04-13-2009 03:50 PM

Weird smarty error about currency?
 
I am getting this error while browsing categories and inside the product listing :
Our price: €10.00 (Warning: Smarty error: math ``altercurrencyvalue*rate'' in ``customer/home.tpl'': parameter ``rate'' is not numeric in /var/www/vhosts/gsmcorner.gr/httpdocs/include/lib/smarty/Smarty.class.php on line 1092
$)

By the way i made those changes you see in that post, but when i saw the error i finished the 3 files from skin1_original and put them back to skin1 to see if the changed i made was makign that error, but the error remains with the original files too..

by the way i tried to do checkout now and i get this on top of page :
INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '00 / 100) as surcharge FROM xcart_payment_methods WHERE paymentid='0' AND paymen' at line 1
SQL QUERY FAILURE:SELECT IF (surcharge_type='$', surcharge, surcharge * 20,00 / 100) as surcharge FROM xcart_payment_methods WHERE paymentid='0' AND payment_script!='payment_giftcert.php'
INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '00 / 100) as surcharge FROM xcart_payment_methods WHERE paymentid='0' AND paymen' at line 1
SQL QUERY FAILURE:SELECT IF (surcharge_type='$', surcharge, surcharge * 20,00 / 100) as surcharge FROM xcart_payment_methods WHERE paymentid='0' AND payment_script!='payment_giftcert.php'

i didn't made any changes to my e-shop template, i think the problem comes from the second language charset or ??

Asiaplay 04-13-2009 09:43 PM

Re: Weird smarty error about currency?
 
It will not be 2nd language based error (as currency symbol and exchange rate is not defined in language packs).

This alternative currency should be set in X-Cart Admin -> General Settings -> General Options using box next to "Alternative currency symbol (empty to disable). Note that credit card charges are made using primary currency: " (is stored in a config settings SQL table from memory).

At a guess it appears maybe your "alternative currency" exchange rate is not set in your store - so perhaps check X-Cart Admin -> General Settings -> General Options (and make sure that you do not have zero in "Alternative currency exchange rate: " and that it is a decimal e.g. 1.34 - do not use a comma)

Hope helps - cheers, Asiaplay

Christofer 04-14-2009 03:30 AM

Re: Weird smarty error about currency?
 
Quote:

Originally Posted by Asiaplay
It will not be 2nd language based error (as currency symbol and exchange rate is not defined in language packs).

This alternative currency should be set in X-Cart Admin -> General Settings -> General Options using box next to "Alternative currency symbol (empty to disable). Note that credit card charges are made using primary currency: " (is stored in a config settings SQL table from memory).

At a guess it appears maybe your "alternative currency" exchange rate is not set in your store - so perhaps check X-Cart Admin -> General Settings -> General Options (and make sure that you do not have zero in "Alternative currency exchange rate: " and that it is a decimal e.g. 1.34 - do not use a comma)

Hope helps - cheers, Asiaplay


well my friend asiaplay thank you for answering to all my posts. The problem was cauing unfortunatelly by a code i found in your post about utf-8

first of all in your post you have that code : setlocale(LC_ALL, 'en_US.■UTF-8■');
it has to be : setlocale (LC_ALL, 'en_US.UTF8'); (you used this " isntead of this ')

but anyway both of them are causing problems, when i saw your post i corrected it but the problem was still there, quality team told me to change it with that :
setlocale (LC_COLLATE | LC_CTYPE | LC_MONETARY | LC_TIME | LC_MESSAGES, 'el_GR.UTF8');

by the way the code have to be changed on init.php and languages.php

Asiaplay 04-14-2009 11:27 AM

Re: Weird smarty error about currency?
 
ok - sorry I made that small typo with the " and '... I have updated my post to fix this and made it clearer by using QUOTEs instead of quote marks " " (thanks for pointing that out).

umm interesting that "ALL" does not work for V4.2.X (and they have to list out the "COLLATE", "CTYPE" etc.).

The other interesting thing is that your default store language (i.e. not 2nd language) must now be GR - this is why the change is needed for the 'el_GR.UTF8' - as that is only used if you deleted English off your system totally and replaced it with Greek as the default.
e.g. if default language installed was UK - then it would be 'en_GB...' (English / Great Britian) and not 'en_US...' (English / US)
I made this comment so other users reading understand why this part of code might need to change, if they change the default language of their store to something other than English (note: this does not mean only the changing in X-Cart Admin of default language to show is "English" or "Greek"... i.e. the default "setting" in Admin) - it means at some stage you deleted English from your store and only had a new language Greek installed).
Now your default language (i.e. not 2nd language) is 'el_GR...' (Greek / Greece).
Logic behind this is that default language is installed in e.g. xcart_products SQL table and 2nd language is stored in xcart_products_lng SQL table... (so in this logic, you have changed the "default" langage text used in "xcart_products" to be Greek).

Hope that makes sense to those who need to understand this - lol :)

Glad to hear you have fixed the problem (once again, sorry my code didn't work first time around for you)... and thanks also for posting your solution here, so others can benefit as well - great!!!

Cheers, Asiaplay

Christofer 04-14-2009 11:55 AM

Re: Weird smarty error about currency?
 
my default language for my shop is Greek and secondary is English :)
thank god i asked quality team about those errors and i got fast answer because i was ready to destroy everything. I was thinking that something was going very wrong coz on every page i was getting sql errors :)

anyway, all good for now. also i want to thank you one more time, coz untill now you are answering to allll of my posts.. your are very active member of community..

Asiaplay 04-14-2009 01:31 PM

Re: Weird smarty error about currency?
 
:) - good all is fixed now (yeah - I often come in here... so I just tried to help where I thought might be able to, as saw some of your posts were not answered).

To be honest I am still wondering if LC_ALL will actually work - as another V4.2.X person I helped used that with no problem on there store (so wondering if it was just the quotes issue before for you//. or if the changing to Greek for default language means LC_ALL doesn't work properly).

Anyway... - the main thing, is that your store works well in Greek now (which is great!) and my post has been corrected thanks to your coments (so should help others later)... haha - thanks and cheers, Asiaplay

Christofer 04-14-2009 01:42 PM

Re: Weird smarty error about currency?
 
Quote:

Originally Posted by Asiaplay
:) - good all is fixed now (yeah - I often come in here... so I just tried to help where I thought might be able to, as saw some of your posts were not answered).

To be honest I am still wondering if LC_ALL will actually work - as another V4.2.X person I helped used that with no problem on there store (so wondering if it was just the quotes issue before for you//. or if the changing to Greek for default language means LC_ALL doesn't work properly).

Anyway... - the main thing, is that your store works well in Greek now (which is great!) and my post has been corrected thanks to your coments (so should help others later)... haha - thanks and cheers, Asiaplay


just to let you know, no it wasn't the quotes the problem. The quotes got fixed by me at first place, much time before the problem appeared. I just noticed them to you to fix your post..:)


All times are GMT -8. The time now is 03:55 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.