DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: programming a calc subroutine, called from WordPress  (Read 6,201 times)

Steven Avery

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,039
programming a calc subroutine, called from WordPress
« on: November 18, 2019, 03:54 PM »
From WordPress / Woo Commerce I would like to shell out (call a subroutine) and do some comparison-calc logic.  This is to determine if an item is subject to sales tax. The product (item) will have some Y/N flag fields, and these will be compared to the 50 states, (+DC, maybe PR) to see if that item is sales tax liable in that state.  There will not be 50 sections, since some states are identical (e.g. about 10 have no sales tax for these products), maybe there will be 25 separate logic sections. Each section will have maybe 5-10 lines of code. I can supply the logic, and maybe do the code.

For speed, and confidentiality, it would be nice to be compiled. 

What tool should be used? 

Presumably reasonably English simple-style, for long-term maintenance:
(If State=FL and Field-Kruggerand=Y evaluate SST=Y and Goto End)

Your thoughts? 
This might also be a gig :).

SST=StateSalesTax - a plug-in from a 3rd party knows the current rate from the address, which can include local city/town add-ons.

There are other complexities, especially with threshold levels, at the moment that is another story.

We also have wonderful complexities in pricing  :).
« Last Edit: November 18, 2019, 04:08 PM by Steven Avery »

Steven Avery

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,039
Re: programming a calc subroutine, called from WordPress
« Reply #1 on: November 26, 2019, 04:21 AM »
It is possible that this should simply be a Plug-in in WooCommerce, written in PhP.  Their plug-ins have their own formal structure, which is explained on the Net.  Maybe I should see the PhP syntax.  I would have to either write it myself, or give the logic to somebody to write.  So far I have not gotten feedback on using a compiled language, but I am checking a bit more.

Original address: https://www.donationcoder.com/forum/index.php?topic=49073.0