Custom meta field question
I searched through the forums but did not find anything addressing this particular issue. I want to make a custom meta field that recognizes a number with two decimal places but does not show any currency symbol. I can't quite figure out an appropriate workaround... The only way I can see of doing it right now is by selecting money and then editing the settings.php file directly to take out the currency symbol, but that does not seem like a practical solution as it's automatically generated each reindex.
My only other option, it seems, is making a custom meta field drop down, but it would be a very long drop down menu and definitely not ideal.
Any suggestions would be appreciated. Thanks!
Hmm. There really isn't a perfect solution for that unfortunately.
You can create a custom version of "search.php" (make a copy of the file without $MetaMoneyCurrency, save it somewhere safe, and set the path in the Indexer under "Configure"->"Advanced"->"Custom script source path"). Modified scripts aren't supported however, and you should be pretty comfortable with making PHP changes before doing this.
I finally got around to trying it today, and it was a really quick and easy solution that worked great. Thanks again.
I also just want to say that I appreciate all the information that is provided in this forum. It's incredibly helpful.
Follow up question for cgi version...
I have switched from PHP to CGI so that I can index more pages. Is there a way to remove the $ sign in CGI?
Not easily. The CGI is compiled C/C++ and unless you are an experienced programmer, then it won't be an easy task to change and recompile the code (the source code is available as part of the SDK).
We'll look into adding an option in the next version to specify a "none" currency or "do not display" option.
Tags for this Thread