kalicr/format-price (1.0.1)

Published 2026-06-25 15:11:25 +00:00 by kalicr-packages

Installation

{
	"repositories": [{
			"type": "composer",
			"url": ""
		}
	]
}
composer require kalicr/format-price:1.0.1

About this package

Configurable Magento 2 module that forces zero-decimal formatting for a target currency (CRC by default).

KaliCR Logo

Module Kalicr_FormatPrice

Configurable Magento 2 module that forces a configurable decimal precision for a target currency (CRC / colón costarricense by default) across catalog, checkout, and storefront price rendering.

This module is developed by Kal-i CR Development Team.

Features

  • PHP price formatting: intercepts Magento\Directory\Model\Currency::formatPrecision and applies the configured precision for the target currency.
  • JavaScript locale config: injects precision, requiredPrecision, groupSymbol, decimalSymbol, and groupLength into the storefront price format.
  • RequireJS mixin: extends Magento_Catalog/js/price-utils for consistent client-side formatting.
  • Admin configuration: enable/disable the module and set the target currency code and precision from the Magento admin panel.

Installation

Via Composer

KaliCR packages are published in the Forgejo registry (https://git.kalicr.com/api/packages/kalicr/composer).

composer require kalicr/format-price:1.0.0
bin/magento module:enable Kalicr_FormatPrice
bin/magento setup:upgrade
bin/magento cache:clean

Manual installation

Only for local debugging. Do not use in client projects while the same module is also installed via Composer, because having both app/code/ and vendor/ copies causes a duplicate-module error.

  1. Copy the module into app/code/Kalicr/FormatPrice.
  2. Run:
bin/magento module:enable Kalicr_FormatPrice
bin/magento setup:upgrade
bin/magento cache:clean

Configuration

  1. Open the Magento admin panel.
  2. Go to Stores → Configuration → Kal-í CR → Format Price.
  3. Set:
    • Enable Module: yes/no.
    • Currency Code: ISO 4217 code of the currency to format (default CRC).
    • Decimal Precision: number of decimals to force (default 0).
  4. Save the configuration.

The module only affects the configured currency. Other currencies keep their native Magento formatting.

Dependencies

  • Magento Open Source / Adobe Commerce: 2.4.8-p4
  • PHP: ^8.2 || ^8.3
  • Magento modules: Kalicr_Core, Magento_Catalog, Magento_Directory
  • Composer packages: kalicr/core

Compatibility

  • Adobe Commerce / Magento Open Source: 2.4.8-p4
  • PHP: ^8.2 || ^8.3

Functional usage

When the module is enabled and the current store currency matches the configured currency code, all price rendering (product list, product page, cart, checkout) displays the amount with the configured precision. For the default CRC configuration this means whole-colón prices without decimals and Costa Rican separator conventions.

If the module is disabled, or if the store uses a different currency, the original Magento formatting is preserved unchanged.

Technical notes

  • Configuration path: kalicr_format_price/general/*
  • Plugins:
    • Kalicr\FormatPrice\Plugin\PriceCurrency (before Magento\Directory\Model\Currency::formatPrecision)
    • Kalicr\FormatPrice\Plugin\PriceCurrencyJs (after Magento\Framework\Locale\Format::getPriceFormat)
  • RequireJS mixin: view/frontend/web/js/price-utils-mixin.js

Changelog

Release notes are maintained in CHANGELOG.md.

Support

If you need help with this module, contact Kal-i CR Development Team:

  • Email: contacto@kalicr.com

License

This package is distributed under the proprietary KaliCR commercial license. See LICENSE.md.

Release workflow

This repository publishes the package through the Forgejo Composer registry.

  • Workflow file: .forgejo/workflows/package.yml

Required Forgejo secrets for publication:

  • FORGEJO_PACKAGE_USERNAME
  • FORGEJO_PACKAGE_TOKEN

Dependencies

Dependencies

ID Version
kalicr/core ^0.2.0
magento/framework ^103.0
magento/module-catalog ^104.0
magento/module-directory ^100.0
php ^8.2 || ^8.3
Details
Composer
2026-06-25 15:11:25 +00:00
2
Kal-i CR Development Team
proprietary
60 KiB
Assets (1)
Versions (3) View all
1.0.2 2026-06-25
1.0.1 2026-06-25
1.0.0 2026-06-25