Hello, I have products using 2 and 3 decimal places, so I created a formatter (Commerce Price Decimals Formatter). It would be great to be added also support in this great module.

Attached patch.

Greetings

Comments

recrit’s picture

Status: Active » Fixed

It's not best practice for one module to alter itself for another module. That in mind, there is a need for prices and labels to be alterable; therefore, I have implement a hook_commerce_price_savings_formatter_prices_alter per commit http://drupalcode.org/project/commerce_price_savings_formatter.git/commi.... @see commerce_price_savings_formatter.api.php

To implement adding a new formatter setting:

  • Install field_formatter_settings module
  • Register setting and set default: implement hook_field_formatter_info_alter()
  • Alter settings form: implement hook_field_formatter_settings_form_alter()
  • Alter settings summary: implement hook_field_formatter_settings_summary_alter()
  • Alter the display: implement hook_commerce_price_savings_formatter_prices_alter(), @see commerce_price_savings_formatter.api.php
facine’s picture

Thank you very much!

I've created a sub-module to alter the format.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.