Fixing Zen Cart’s Tax Miscalculation When Using a Coupon

I was recently alerted to an error in Zen Cart by a client where the tax was being miscalculated when using a coupon. Here’s the fix. Around line 240 in /store/includes/modules/order_total/ot_coupon.php Remove these lines: //$od_amount[$tax_desc] += (($products[$j][‘final_price’] * $products[$j][‘quantity’]) * $tax_rate)/100 * $ratio; //$od_amount[$tax_desc] += round(((($products[$j][‘final_price’] * $products[$j][‘quantity’]) * $tax_rate) + .5)/100 * $ratio, 2); …

Clean file names using PHP preg_replace

It’s always a good idea to protect yourself from all sorts of possible malicious attempts by users (or even mistakes by misinformed users). Here we look at taking a string of text (a filename) containing characters that are generally speaking unsafe. Here’s a simple way to clean-up filenames (or other text input) using PHP – …

Amberjack Media, RevealCMS

It’s official – I’m now Amberjack Media (amberjackmedia.com). The papers from the city just arrived, but the process with officially registering the DBA with the county is not yet complete. I have the domain, but it’s not yet set-up with any hosting space just yet. On another note, I’ve named the CMS i’m working on: …

Cool Exposé trick in Mac OS X

When pressing F10 (or Ctrl-F10) to show a program’s open windows, you can press Cmd-Tab to cycle through all running apps, showing the icons across the screen as the normal Cmd-Tab does. You can also scroll through running apps in Exposé by pressing Cmd-` (back tick), but without the icons. Apparently this will also switch …

Smart template plugins with Smarty

Smarty is becoming more and more popular in the PHP community lately, especially as developers are moving away from mixing business and display logic in the same scripts and towards a cleaner MVC design pattern implementations. If you’ve followed my blog for any amount of time, you’ll know that I’m currently working on my own …

Hey there! Come check out all-new content at my new mistercameron.com!