Yes, I've been working on my Canadian Retail Sales Tax extension for Tienda.
The exercise has raised many questions.
The single biggest question raised is: do I modify core PHP files?
The single biggest answer is: yes.
The idea that Tienda supply generalized tax handling, and TPD provide the necessary tax localization, is a good idea. It just doesn't work for Canada.
Tienda calculates taxes, then launches the event for TPD's Joomla plug-ins to over-write the Tienda taxes.
Nope. I do not want Tienda to calculate taxes at all!
So I'm going to make one little itty-bitty surgical incision into one Tienda source PHP file to stop the Tienda tax calculation before it starts.
Messing with the source code is something I really don't want to do. I am scarred by my Virtuemart programming. But.. yes, there's a but... for everything there is a season. With Virtuemart I had to insinuate my code into the source, no way around it. If all it takes with Tienda is a precise surgical incision into one single solitary place within one function within one PHP file, then fine. Huge payoff, small cost.
Of course, one thing led to another, and I was having a lot of fun with my own "Bob" files alongside the native Tienda files. Not touching more source files, but mimicking Tienda core processing by using "tax_bob.php" instead of "tax.php" (which is completely fictitious, no such files exist). An incision here, an incision there -- what's a few incisions into the source code to direct the core processing to use my own "Bob" files instead of the Tienda files?
As fun and wonderful as this is, it's a lousy precedent. I do not want to grow an entire portfolio of Tienda extensions that require parallel php files. This will become unmanage-able; and, becomes quite a risk when things change around in Tienda. Then I have to change things around in my extensions -- yuck.
Now, why don't I just write a feature request in the Tienda project tracker asking for the creation of the "beforeOnTaxCalculation" event and an IF statement based on that event to prevent Tienda from calculating taxes?
Well, I could. And I might. But what about the existing version? What do we do until the fix is released? Do nothing?
Doing nothing is not an option. My Canadian Tax extension is part of my Software Club in my new http://SouthLaSalleADVISOR.com site. All my extensions will be treated the same way, for the same reason. I'm in the midst of setting up my Advisor Site with my Software Club, so I'll have more info on this -- probably within new site.
Canadian consultants using Tienda will find my Advisor Site extremely worthwhile. If we've not corresponded before, introduce yourself.
-Bob





