Forums / Currencies & Sales Taxes, VAT, GST, etc. / Bug: price manager adds Tax to the promotional price! Help needed...

Bug: price manager adds Tax to the promotional price! Help needed...

Views: 4,308

Results 21 to 27 of 27
24 Jun 2015, 11:22 PM
#21
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Bug: price manager adds Tax to the promotional price! Help needed...

Great that you can fix it.. I really did not understand how to change the code, when you are able could you please tell me the code to change?

Thank you

28 Jun 2015, 6:41 PM
#22
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Re: Bug: price manager adds Tax to the promotional price! Help needed...

Hi, do you have the code change to try to fix it?
Sorry if I write again, but I'd need to sort this out to put online the store tomorrow or Tuesday.

Thank you very much, I appreciate your help.

2 Jul 2015, 3:22 PM
#23
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Re: Bug: price manager adds Tax to the promotional price! Help needed...

mc12345678:

From the configuration and code so far provided I was thinking I may need to dig deeper into the issue; however, I was also thinking the same thing. It can be accomplished by modifying the code provided by moving the applicable or (||) and single quoted text from the one section of code to the other... So the one with checkout_confirmation being moved near the one with checkout_payment... (Not at a computer to more easily show the change.)

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.

2 Jul 2015, 3:52 PM
#24
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Bug: price manager adds Tax to the promotional price! Help needed...

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

<?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.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

3 Jul 2015, 9:14 PM
#25
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Re: Bug: price manager adds Tax to the promotional price! Help needed...

Hi, thank you very much for your reply.

I tried this out and now it works, it shows correct amounts during the entire checkout.

Another issue came out:
Totale amounts are not correct in these pages in the line grand total (should be VAT included instead it apppears VAT excluded):
index.php?main_page=account
index.php?main_page=account_history_info&order_id=XXXX
admin/orders.php?origin=index&page=1&oID=XXXX&action=edit
admin/index.php
admin/orders.php?oID=XXXX&origin=index

Even the email sent to the customer is VAT excluded as grand total.
Is the solution easy?

Thank you

7 Jul 2015, 6:30 AM
#26
lruskauff avatar

lruskauff

Totally Zenned

Join Date:
Sep 2008
Location:
WA
Posts:
559
Plugin Contributions:
0

Re: Bug: price manager adds Tax to the promotional price! Help needed...

Did you ever figure out the last part?

L

7 Jul 2015, 12:35 PM
#27
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Bug: price manager adds Tax to the promotional price! Help needed...

There is a VAT mod or two in the plugins that I might suggest (may impact existing code), otherwise this is a bit of custom coding to accomplish. The results seen in these areas are primarily based on historical data as compared to instore live data. The email is generated in includes/classes/orders.php towards the bottom of the file and would need to include similar checks and changes based on the $_SESSION information and other variables. The above "fixes" were provided based on stop and see an issue/resolve it type basis having identified a "minor" issue. If I get more "free" time then I might be able to provide the changes, otherwise hopefully someone else can step in.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...