Hãy đăng nhập để được xem nhiều hơn nhé
Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký
x
Bƣớc 1:
Eidt file lib_common.php trong thư mục includes các bạn tìm đến dòng:
- function price_format($price, $change_price = true)
Sao chép mã
Copy đoạn code này thay thế đoạn code của bạn:
- function price_format($price, $change_price = true)
- {
- if ($change_price && defined('ECS_ADMIN') === false)
- {
- switch ($GLOBALS['_CFG']['price_format'])
- {
- case 0:
- $price = number_format($price, 0, ',', '.');
- break;
- case 1: // 保留不为 0 的尾数
- $price = preg_replace('/(.*)(\\.)([0-9]*?)0+$/', '\1\2\3', number_format($price,
- 0, ',', '.'));
- if (substr($price, -1) == '.')
- {
- $price = substr($price, 0, -1);
- }
- break;
- case 2: // 不四舍五入,保留1位
- $price = substr(number_format($price, 0, ',', '.'), 0, -1);
- break;
- case 3: // 直接取整
- $price = intval($price);
- break;
- case 4: // 四舍五入,保留 1 位
- $price = number_format($price, 0, ',', '.');
- break;
- case 5: // 先四舍五入,不保留小数
- $price = round($price);
- break;
- }
- }
- else
- {
- $price = number_format($price, 0, ',', '.');
- }
- return sprintf($GLOBALS['_CFG']['currency_format'], $price);
- }
Sao chép mã
Bƣớc 2:
Vào Admin - menu Hệ Thống - Cấu hình - tab Cài đặt hiển thị - dòng Định giá - chọn
Hiện không xử lý
Chú ý: Để đảm bảo an toàn trong việc edit code bạn có thể tải file lib_common.php về
copy đè lên file cũ của bạn.
Link: http://www.mediafire.com/?5b6hg4dnybs3hsz
|