Each time a price is displayed on osCommerce the tax rate for that product is queried. Even if the user has set to not display taxes with price the tax rate is queried.
Query for each rate one time as it is needed and then store it in session cache.
What this contribution does:
This code change will modify the tep_get_tax_rate() method so the first time a tax rate is requested it stores it in session. On every tax rate query it is first checked to verify if it's already in sesssion and if not will query / store in cache. If it is already in session it will return that value and save the database lookup.
Reduction in per page query count and faster execution times. Query reduction has been demonstrated to be around 75% savings on some pages.
8 setups with differing server configurations and osC setup. This change should not affect any other contributions.
As fast as you can open a file, make one change, and upload.
Top 4 Download periodically updates information of Optimize tep_get_tax_rate() method 1.1 script from the developer, but some information may be slightly out-of-date.
Our script download links are directly from our mirrors or publisher's website. Optimize tep_get_tax_rate() method 1.1 torrent files or shared files from free file sharing and free upload services, including Rapidshare, MegaUpload, YouSendIt, MailBigFile, DropSend, HellShare, HotFile, FileServe, MediaMax, zUpload, MyOtherDrive, SendSpace, DepositFiles, Letitbit, LeapFile, DivShare or MediaFire, are not allowed!