I want to change input price decimal "." to ","
How to do it
My opencart is 1.4.9.3.
thanx
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 ?
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 "."
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
Ex: 5,240.00
it is showing 5thousand_point240decimal_point00
I attached the screenshot for your reference.
Attachments
PriceIssue.JPG (76.26 KiB) Viewed 24270 times
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>
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
and it comes for free, so, you can find out free of charge!
Good Luck
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
---
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
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
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>
Users browsing this forum: No registered users and 138 guests