While working on an e-commerce system, I needed to use PHP to round a number to a minimum number of decimal places, but allow for more if needed. For instance, if the value was 1.2, I’d want it rendered as $1.20, but if it was 1.256, I’d want it to keep the precision and render as $1.256. I ended up converting the number to a string, splitting by the decimal, enforcing the minimum precision and then using PHP’s number_format() function, like: Read More »
Development Blog
PHP: Round Number to Minimum Precision
Dec 22
2012
Joomla 2.5 Component Categories Sub-Nav
Dec 21
2012
I recently found Joomla’s feature to easily add custom component-specific nested Categories. It makes for a quick way to create categories similar to what is used in com_content and an interface to manage those categories without having to build it all manually. You can use JForm to easily add a select menu of your custom categories. The categories interface can even include a custom sub-menu to easily get back to the rest of your component.
Joomla! 2.5 Toolbar Popup Link Icon
Sep 08
2012
Today I needed to add a new toolbar button to a custom Joomla! component. In the past, I’ve used a more convoluted method of overriding the submitbutton() (or Joomla.submitbutton) JavaScript function and triggering the modal popup manually, but stumbled upon a better solution. Read More »
ProcessForm/NateMail Patch Update
Jul 31
2012
I’m still planning to develop new form processing scripts, but in the meantime, a patch update has been posted for ProcessForm to deal with possible error messages in PHP 5.3+ about the eregi() function being deprecated (has been replaced by the newer preg_match() function). Also, I’ve switched the encoding to utf8 to better support non-English characters in the email text, confirmation screen and MySQL storage.
Ajax Form Submission in Joomla 2.5 with jQuery
Apr 06
2012
I’m developing a custom c-commerce component for Joomla 2.5, and today was struggling with using Ajax from my admin lists. I wanted to make small changes to the list via Ajax without having to reload the entire page – publish state, deletes, quick edits, etc. To handle the Ajax form submissions, I was using jQuery and the jQuery Form Plugin. Read More »
Custom Admin Quickicon in Joomla! 2.5
Feb 07
2012
I recently had to dig up how to add a custom admin Quickicon (the icon links on the left side of the Administrator section’s control panel) in Joomla 2.5. In previous versions, I’d just built a custom admin module for each icon. Now, there seems to be a somewhat easier way. Read More »
Joomla Component Preferences Button
Jun 07
2011
I ran into a frustrating issue today while developing a custom component where the Preferences button would not show up. In case I’m not the only one that encounters this, here’s what happened…
Custom 404 Error Pages in Joomla
May 05
2011
I’ve recently had to build custom 404 pages for a few Joomla sites, and it seems like every time it comes up, I have to dig around for the information again and look up how I did it last time. I’m posting the details here so it’s all in one place for me, and hopefully it saves you some time and effort as well. Read More »
Keep in touch: