
Originally Posted by
ilmarchez
Hi,
I'm sorry to bother you again, but I feel that we were so close to reach the solution to the issue that I think it would a pity to leave all the work already done without any result...
Last time you wrote it seemed you had the solution but you were not in front of the computer for the code...
Do you have any news?
Thank you very very much for you support.
Been a long "week"... I *think* the following would/could apply:
For the second file (the class file) that functions as the observer, listening and waiting for the primary code to take some form of action to which this will take action.
Based on the above information the filename for this second file would still be class.whole_sale_taxes.php and stored in the directory: includes/classes/observers
Code:
<?php
/**
* Description of class.whole_sale_taxes: This class is used to support tax information related to the wholesale module. This way reduces the modifications of the includes/modules/pages/checkout_payment/header_php.php and other files reached from that page to nearly nothing.
*
* @author mc12345678
*
*/
class whole_sale_taxes extends base {
/*
* This is the observer for the includes/modules/pages/checkout_payment/header_php.php file to support taxing everyone equally when the order is being processed at the end of the purchase.
*/
function whole_sale_taxes() {
global $zco_notifier;
$zco_notifier->attach($this, array('NOTIFY_HEADER_START_CHECKOUT_PAYMENT', 'NOTIFY_ORDER_PROCESSING_ATTRIBUTES_BEGIN', 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING', 'NOTIFY_HEADER_START_CHECKOUT_SUCCESS', 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING_ADDRESS', 'NOTIFY_HEADER_START_CHECKOUT_PROCESS', 'NOTIFY_HEADER_START_CHECKOUT_PAYMENT_ADDRESS', 'NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION', 'NOTIFY_HEADER_START_SHOPPING_CART', 'NOTIFY_HEADER_START_LOGIN'));
}
/*
* Generic function that is activated when any notifier identified in the observer is called but is not found in one of the updated methods of calling an observer (ZC 1.5.3+) is encountered as a notifier.
*/
function update(&$callingClass, $notifier, $paramsArray) {
global $db;
// remove the session variable that removes tax from the calculations.
if ($notifier == 'NOTIFY_HEADER_START_CHECKOUT_PAYMENT' || $notifier == 'NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION'){
if ($_SESSION['customer_whole']=='1') {
unset($_SESSION['customer_whole']);
$_SESSION['customer_whole_reset']='1';
}
}
// restore the tax "discount" so that the customer continues to see the untaxed price until returning to the above page(s).
if ($notifier == 'NOTIFY_ORDER_PROCESSING_ATTRIBUTES_BEGIN' || $notifier == 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING' || $notifier == 'NOTIFY_HEADER_START_CHECKOUT_SUCCESS' || $notifier == 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING_ADDRESS' || $notifier == 'NOTIFY_HEADER_START_CHECKOUT_PROCESS' || $notifier == 'NOTIFY_HEADER_START_CHECKOUT_PAYMENT_ADDRESS' /*|| $notifier == 'NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION'*/ || $notifier == 'NOTIFY_HEADER_START_SHOPPING_CART' || $notifier == 'NOTIFY_HEADER_START_LOGIN') {
if ($_SESSION['customer_whole_reset']=='1') {
unset($_SESSION['customer_whole_reset']);
$_SESSION['customer_whole']='1'
}
}
} //end update function - mc12345678
} //end class - mc12345678
?>
The first blue is required to try to present the information requested/desired (next step), the second blue between and including /* */ could be removed; however, I have left the code there for "understanding".
Again, this is untested on my part, but fortunately was able to update it. I do not know if it will meet the requirements/expectations and the results of using it. Just a word of caution on my part.
Bookmarks