Post by skip » Tue Nov 08, 2011 2:48 am

When i enter a price like : 2,55 the program change it to 2,00. when I use ","

I want to change input price decimal "." to ","

How to do it
My opencart is 1.4.9.3.
thanx
Last edited by skip on Wed Nov 16, 2011 6:32 am, edited 1 time in total.

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by skip » Sun Nov 13, 2011 12:41 am

In this locked post (http://forum.opencart.com/viewtopic.php?t=839) member "lepotros" say:
In fact, i thought the problem was a SQL configuration in Decimal.
I changed, in SQL-Product-decimal the value of 15,4 for 15,2, that correspond to the configuration of Opencart, and it works.

But I dont know what he mean under "SQL-Product-decimal" ?
anybody understood ?

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by skip » Sun Nov 13, 2011 1:44 am

Aha I know now
Go to phpmyadmin-> product table-> structure tab ->change the value to 15,2
But its not work now is admin price in this format 100.00 This number cut last 2 decimal places
(100.0000 to 100.00) but for input price I still must use "."

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by skip » Wed Nov 16, 2011 6:36 am

In file settings-library-currency change this
$decimal_point = '.'; to
$decimal_point = ',';

no result very strange hmm

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by Qphoria » Wed Nov 16, 2011 8:29 am

skip wrote:In file settings-library-currency change this
$decimal_point = '.'; to
$decimal_point = ',';

no result very strange hmm
There is no such setting in that file.
Decimal point is set in the language file
catalog/language/<yourlang>/yourlang.php
at the top.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by skip » Thu Nov 17, 2011 3:33 am

I"ll try this first but without result
In admin/language/mylanguage/mylanguage.php I change
$_['decimal_point'] = ',';
but product price input is posible only with point !
If I use comma -> all number behind cooma is lost
input 200,45 -> produce 200.00

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by 1047138246@qq.com » Fri Nov 18, 2011 3:46 am

easy one, contact me on skype: ken_nz2


Posts

Joined
Mon Mar 21, 2011 9:50 am

Post by mgolf1 » Sat Nov 02, 2013 6:25 am

I also have the same problem. Can anyone help me? Al those solutions doesn't work for price input fields.

Newbie

Posts

Joined
Sat Nov 02, 2013 6:23 am

Post by laptoper » Mon Sep 26, 2016 10:26 pm

I have problem for price also. instead of . or , the string "thousand_point" and "decimal_point" is showing with the price.
Ex: 5,240.00
it is showing 5thousand_point240decimal_point00

I attached the screenshot for your reference.

Attachments

PriceIssue.JPG

PriceIssue.JPG (76.26 KiB) Viewed 14551 times


Newbie

Posts

Joined
Mon Sep 26, 2016 9:29 pm

Post by IP_CAM » Tue Sep 27, 2016 2:05 am

There was an old VqMod, possibly basically explaining, where it shoud be done:

Code: Select all

<modification>
	<id>Comma as decimal point when saving product</id>
	<version>1.5.4</version>
	<vqmver>2.2.1</vqmver>
	<author>Istvan Dobrentei, http://www.dobrenteiistvan.hu</author>
	<file name="admin/model/catalog/product.php">
		<operation>
			<search position="after"><![CDATA[function editProduct($product_id, $data) {]]></search>
			<add><![CDATA[
				$data['price'] = str_replace(",", ".", $data['price']);
			]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[function addProduct($data) {]]></search>
			<add><![CDATA[
				$data['price'] = str_replace(",", ".", $data['price']);
			]]></add>
		</operation>
	</file>
</modification>
Ernie

For Sale: Top URL's, including OpenCart V-Pro installed, like seen here:
http://www.bigmax.ch - http://www.ipcam.li - http://www.opencart.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by guidone » Thu May 03, 2018 7:39 pm

Hello,

the vQmod it works fine, it should be great if someone could add same mod for option price too.

User avatar
New member

Posts

Joined
Thu Mar 28, 2013 7:39 pm

Post by IP_CAM » Fri May 04, 2018 3:26 am

for Version 1.5.4, really !? :choke:
Ernie

For Sale: Top URL's, including OpenCart V-Pro installed, like seen here:
http://www.bigmax.ch - http://www.ipcam.li - http://www.opencart.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by guidone » Fri May 04, 2018 3:45 am

I'm using on OC 2.2 and it works fine so I would like to have same mod for option price too

User avatar
New member

Posts

Joined
Thu Mar 28, 2013 7:39 pm

Post by IP_CAM » Fri May 04, 2018 9:12 am

Well, this could possibly at least solve your problem on the front side,
and it comes for free, so, you can find out free of charge!
Good Luck :D
Ernie
---
Change default weight settings, separators, add weight units
0_decimals
- First, it will define the language setting of the user. For example from the English language 1,000.00 will become 1.000,00 in French.
- Second, will reduce the decimals to zero. It means that 30.00 will become 30.
1_decimal
- First, it will define the language setting of the user. For example from the English language 1,000.00 will become 1.000,00 in French.
- Second, will reduce the decimals to one. It means that 1,030.00 will become 1,030.0. For example in French 1,030.00 will become 1.030,0.
3_decimals
- First, it will define the language setting of the user. For example from the English language 1,000.00 will become 1.000,00 in French.
- Second, will set the decimals to 3. It means that 1030.00 will become 1,030.000. For example in French 1,030.00 will become 1.030,000. Nice when working in kilograms.
language_defined
- It will define the language setting of the user. For example from the English language 1,000.00 will become 1.000,00 in French. !!! NOTE !!! Only install this ocmod when the 0_decimals, 1_decimal or 3_decimals are NOT installed or used.
https://www.opencart.com/index.php?rout ... n_id=32974
---

For Sale: Top URL's, including OpenCart V-Pro installed, like seen here:
http://www.bigmax.ch - http://www.ipcam.li - http://www.opencart.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by victorj » Sat May 26, 2018 6:12 pm

It can not be changed.
Its how number are handeled in the database.
A comma is a data separator ie something in front of comma is a separate value something behind comma is a separate value.
15.0000 will be treated as a nummeric value with 4 decimals, 15,0000 will be treated as 2 separate pieces of data, 15 and 0000
This behavior is not limited to oc only, every e-commerce Application works like this.

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Eigen productie en snelle levering.
https://123-deurrubbers.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by guidone » Sat May 26, 2018 6:27 pm

Yes but this code

Code: Select all

<modification>
	<id>Comma as decimal point when saving product</id>
	<version>1.5.4</version>
	<vqmver>2.2.1</vqmver>
	<author>Istvan Dobrentei, http://www.dobrenteiistvan.hu</author>
	<file name="admin/model/catalog/product.php">
		<operation>
			<search position="after"><![CDATA[function editProduct($product_id, $data) {]]></search>
			<add><![CDATA[
				$data['price'] = str_replace(",", ".", $data['price']);
			]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[function addProduct($data) {]]></search>
			<add><![CDATA[
				$data['price'] = str_replace(",", ".", $data['price']);
			]]></add>
		</operation>
	</file>
</modification>
allows to write comma but saves point in the db and i would like to have the same for price options

User avatar
New member

Posts

Joined
Thu Mar 28, 2013 7:39 pm
Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 7 guests