In one of the random projects we undertook, we implemented the Shoppplugin for WordPress, which by all accounts is a pretty decent shopping cart. Like most things WordPress, you can stretch it’s functionality only so far before you reach the end of the sidewalk. Then, if you’re really brave (read: stupid) you can then start altering core code.
In one of the 11 Bridges Success blog posts we wrote about methods for accessing WordPress session variables and even core objects: “hack-the-cms-with-ajax-and-sessions” The bad news is that in the particular example given in that post there was in fact a failure that we haven’t yet overcome.
The problem is specifically related to:
$_SESSION[‘poboxcheck’] = $_POST[‘poboxcheck’];
The goal we had with this code was to hack into the shipping calculator for this WordPress Plug-in and have it be a little smarter about shipping to PO Boxes. So, when a user selects a checkbox that they are shipping to a PO the UPS shipping options get removed (they don’t ship to PO Boxes).
The following line of code is supposed to flag the shipping calculator that the shipping costs need to be updated appropriately:
The failure is that it doesn’t. We realized that this causes odd behavior in certain test cases. However, the Shopp plug-in is reportedly going to be upgraded fairly soon with PO Box recognition built in, and we will wait for that upgrade rather than looking for another solution.