Thanks for this formatter! I wonder how to make this formatter somehow compatible with a price table (http://drupal.org/project/commerce_price_table). As it is now, it chooses the last price in the table as the price. Any suggestions?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bengt’s picture

I see now that showing the last price (in the price field) is actually another issue which has nothing to do with this formatter. But I am still interested in suggestions how to change this formatter so that it will work with price tables.

recrit’s picture

Project: Commerce Price Savings Formatter » Commerce Price Table
Version: 7.x-1.0-beta1 » 7.x-1.x-dev

the Commerce Price Table actually provides its own field type of 'commerce_price_table' which displays the table of prices using the normal commerce_currency_format(). The Commerce Price Table module could add a setting to its Price Chart formatter that provided a selection of price formatters.

* moving issue to commerce_price_table queue

pcambra’s picture

Just for my own reference, we're talking about including http://drupal.org/project/commerce_price_savings_formatter or other formatters inside the table, that's a very interesting feature, I'll review it.

recrit’s picture

thats correct .. basically exposing any price field formatters to be used for the prices in the table.

pcambra’s picture

I've given a further thought on this.

This change may imply a conceptual rewrite on this module, being a setting itself of any other formatter (not sure if that's even possible). So it should alter all formatters that are available for normal price fields to be available also for price table and expose extra settings for the price table.

I'd probably create a 2.x branch for this.

klavs’s picture

+1 for needing this :)

I'd like to be able to f.ex. show prices excl. VAT (but VAT will still be applied when checking out).

facine’s picture

Title: How to make the formatter to work with Commerce Price Table » Lets modules alter the formatted prices created by the Commerce Price Table module
Status: Active » Needs review
FileSize
4.4 KB

Based on this other recrit patch I created a patch for this module.

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_table_prices_alter(), @see commerce_price_table.api.php

Regards

pcambra’s picture

So this means that for every formatter out there doing stuff for prices needs to add a submodule in the price table module?
Or viceversa, price table needs to add a submodule in every formatter out there?

facine’s picture

Yes, not the best solution but... Furthermore there are only 4 or 5 formatters.