Closed (fixed)
Project:
Classified Ads
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2007 at 00:07 UTC
Updated:
15 Jul 2011 at 22:23 UTC
Have a price field for the ads, choosable to use or not, in the whole classified module or in some categories.
Comments
Comment #1
mcurry commentedCurrency localization/formatting is a can of worms.
http://www.xencraft.com/resources/multi-currency.html
The shortest path to adding a price field is to store the price as a string, and never do any calculations on the value - it's stored exactly as the user enters it, and it won't be used for reporting / sorting / comparison purposes. This is probably too limited - I assume people will want to see items listed by price (using, say, Views module integration).
The next and slightly more complex approach is to store it as a decimal number in the database, with, say, 3 or 4 decimal places, and just assume that there will only ever be one currency per site - USD, EUR, whatever, with the currency code (USD, EUR) configurable by the admin. This will not satisfy everyone, though. If a site is run in another country I can foresee people needing to allow ads with prices entered and displayed in multiple formats.
Anyway, the first step will be to extend the edi_classified_nodes table to include a column for price - and it's important that I choose a suitable representation for price, because I don't want people to lose price data during some future update due to an inappropriate choice today.
If anyone has links to online resources for dealing with such issues, or there is support in existing drupal modules for currency localization, please drop a link here. Thanks.
Comment #2
mcurry commentedPostponed until further notice. Nobody willing to contribute as far as I can see. So it's probably not worth much to anyone :D
If you disagree, feel free to re-open this, and consider contributing to the solution (money, patches, etc.)
Comment #3
sodani commentedI'm willing to contribute a patch. However, I think that supporting more than one currency on a single site would be beyond the scope of a module such as this one. If supporting multiple currencies on a single site, the exchange rates would have to be in real time. A seller in the United States who listed an item for 18USD would probably prefer to have it seen in the EU listed at 18USD and have the potential buyer do the conversion on their own than have it seen at a price in Euros that's less than 18USD because an old exchange rate is being used. Therefore, I support allowing of multiple currencies, but only one per site.
Please let me know if you agree, and I can work on it and also let me know what version to patch.
Comment #4
sodani commentedI've found that this feature is already provided by a CCK related module - http://drupal.org/project/money
It utilizes the Currency Exchange module - http://drupal.org/project/currency
which has an API for currency converting if needed.
Comment #5
mcurry commentedSo, even if we try to support a single currency, will people want to search for items having a price over/under some criteria?
If so, will there be any number formatting or collation issues? And if there are, is it acceptable to just avoid dealing with it in this module (at least initially)?
Comment #6
mcurry commentedOops, mid-air collision. Sorry about that.
Comment #7
mcurry commented