5

For a real-estate (realty) website I need to store and display the price, but the best D7 module for this is the price component of Commerce module. Is there a Price/Money field on D7?

I have found the following modules:

  • Measured Value Field - Cool idea spans a lot of value types - D6 only

  • Units API - Really more for measurement, integrates with MVF

  • Format Number - Most recent dev version but not sure how rough this version is
6
  • What's the problem with using commerce_price? – Andy Jul 30 '12 at 9:16
  • There is no module called drupal.org/project/commerce_price, where do I get it not sure. Would one have to rip this out of Drupal Commerce? (This seems very Ubercart-like to build a nice module on a modular platform that only plugs into the online shop) – Duncanmoo Jul 30 '12 at 19:20
  • It's part of Commerce. As Bojan says, you don't enable all of Commerce. Commerce Price needs Rules, Entity API and Commerce (the core module, which has price-related functionality). The rest of the stuff that a full e-commerce site might use (eg. cart, checkout, customers, line items...) doesn't need to be enabled. As an added bonus if you ever do want to have eg. a cart, you're already using part of a comprehensive framework and it should be relatively painless to upgrade. – Andy Jul 30 '12 at 19:49
  • I wanted to use a price field to be a bit more future proof, allowing for currency conversion, but for a real-estate website the chances of using any Commerce features beyond price are minimal. If commerce_price is the only option then I should use a Float field with a prefix. – Duncanmoo Jul 31 '12 at 19:32
  • 1
    If you're interested in future proofing and potentially currency conversion, I really can't see any drawback to using Commerce Price. It will work fine as a plain price field, and offers an existing currency-aware API for when/if you need it. (And if you then decide to plug it in to an external exchange rate service, there might already be a Commerce module built for that...) – Andy Jul 31 '12 at 19:59
5

I'd go with Commerce Price (part of Commerce). You don't need to enable the rest of Commerce. The price module itself is relatively small (while giving you price calculation, and Rules integration for free, if you need it), and the rest of Commerce won't be loaded, taking only space on your hard drive, which probably doesn't concern you much.

That's the beauty of Commerce separation, you can use only a few modules that give you exactly what you need. I've seen that happen in many projects.

2
  • If it is separate then where do I get the module? – Duncanmoo Jul 30 '12 at 19:21
  • You download the whole Commerce package. It is included there. "Separation" as in the separation of functionality into independent modules, not separation of the download location. – Bojan Zivanovic Jul 30 '12 at 21:58
4

A D7 port of the CCK Money field is being worked on: http://drupal.org/node/908480

One handy adjunct to the CCK Money field is the currency conversion jQuery widget which allows your visitors to convert the value to any currency, calculated on the fly via Yahoo finance, though you could implement something like that on your own using any of several existing jQuery scripts out there. Not sure if the D7 port includes the conversion widget. You can see an example of the widget on my real estate site here (look for the sales price and click the little icon): http://www.bigmangoproperties.com/thailand/pattaya/condominium/ad-hyatt/26041

If you just want a selection of a few currencies as a suffix label only, you can use the Double Field module, or for a single currency label just use a Decimal field type and use the suffix for the currency label.

For calculations you can use the Computed Field module, though using Commerce with Rules is arguably more powerful.

1

Drupal 8

Checkout the Price module which provides a price field with different tweaks.

A decoupling commerce_price from commerce.

0

Try the Currency module.

Their project page states that their 7.x-2.x version provides "Currency conversion input filter, Amount/price display input filter, Amount/price form element", among others.

2
  • Thanks @tanius have you actually used and tested the module? My particular requirement is past, but I am still interested. – Duncanmoo Sep 16 '14 at 9:18
  • Did not use it yet, just happened to find it. My requirements were simple, so I ended up with a Decimal field and a suffix, as proposed by Jeff. – tanius Sep 16 '14 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.