Zen Cart Logo
Forums / Basic Configuration / Comma as decimal separator in quantity field

Comma as decimal separator in quantity field

Views: 706

Results 1 to 1 of 1
15 Sep 2013, 7:16 PM
#1
dee_d_lady avatar

dee_d_lady

New Zenner

Join Date:
Jan 2011
Location:
Slovakia
Posts:
24
Plugin Contributions:
0

Comma as decimal separator in quantity field

Hi,

using comma as decimal separator for the quantity field has been already asked but nobody posted a solution. I looked into it and find the solution that works for the product details page and the shopping cart page. The problem is that I couldn't make it work for All products/ New products/ Specials and Categories pages, where you can add multiple products to the cart at once.

The changes I made are in includes/classes/shopping_cart.php

Just before the line 1595   if ($_POST['cart_quantity'][$i] == '') { 
added
$_POST['cart_quantity'][$i] = str_replace(',', '.', $_POST['cart_quantity'][$i]);

Changed the line 1699 $new_qty = $_POST['cart_quantity'];
for
$new_qty = str_replace(',', '.', $_POST['cart_quantity']);

ZenCart 1.5.1

Other pages are using the function actionMultipleAddProduct starting at line 1832 but I wasn't able to implement the str_replace into that section to make it work.

Anyone could help with this?

Daniela