Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27
  1. #11
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

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

    Great! Now it works!
    There is one little detail left: for each payment module or shipping module, I had previously set the rul to disable some of them (i.e. PayPal) if a customer was a wholesaler.
    Now with your method this rule is not applied any more and I'd like to keep some modules for customers and others to be displayed only to wholesalers.

    For example, I modified the file in /modules/payment/paypalwpp.php
    Code:
    $this->enabled = (MODULE_PAYMENT_PAYPALWPP_STATUS == 'True');
    To this:
    Code:
    $this->enabled = (MODULE_PAYMENT_PAYPALWPP_STATUS == 'True' && $_SESSION['customer_whole'] != 1);
    Now this does not work... Any solution?
    Thank you again for you help, I really appreciate.

    Quote Originally Posted by mc12345678 View Post
    Yeah, change:
    Code:
    $_SESSION['customer_whole']='1'
    To:
    Code:
    $_SESSION['customer_whole']='1';

  2. #12
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

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

    Quote Originally Posted by ilmarchez View Post
    Great! Now it works!
    There is one little detail left: for each payment module or shipping module, I had previously set the rul to disable some of them (i.e. PayPal) if a customer was a wholesaler.
    Now with your method this rule is not applied any more and I'd like to keep some modules for customers and others to be displayed only to wholesalers.

    For example, I modified the file in /modules/payment/paypalwpp.php
    Code:
    $this->enabled = (MODULE_PAYMENT_PAYPALWPP_STATUS == 'True');
    To this:
    Code:
    $this->enabled = (MODULE_PAYMENT_PAYPALWPP_STATUS == 'True' && $_SESSION['customer_whole'] != 1);
    Now this does not work... Any solution?
    Thank you again for you help, I really appreciate.
    Though the code was somewhat. "Blindly" written as there was no other indication of an issue related to unsetting the session variable, a similar/expanded comparison can be done by adding the following to the list of checks:

    Code:
    && $_SESSION['customer_whole_reset'] != '1'
    Like so:
    Code:
    $this->enabled = (MODULE_PAYMENT_PAYPALWPP_STATUS == 'True' && $_SESSION['customer_whole'] != 1 && $_SESSION['customer_whole_reset'] != '1');
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #13
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

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

    Much better (even though with this modification the wholesaler user see product prices including taxes again while it shouldn't).
    I see that a final step is needed.
    Right now the page "checkout_payment" calculates to total price correctly addying tax to all customers but the next page "checkout_confirmation" shows the prices correctly to wholesalers (tax escluded) but it does not add tax to the total amount of the order. I think I need something specular to what already done earlier, could you help me out?:

    mc12345678
    Re: Bug: price manager adds Tax to the promotional price! Help needed...
    Sorry for the delay.

    So the truly zen way would be to write an observer to listen to: NOTIFY_HEADER_START_CHECKOUT_PAYMENT

    In which the software would be something like:

    Will be creating two files.

    The first to go into includes/auto_loaders
    Suggest giving it a name that has meaning to the task. Something like config.whole_sale_taxes.php

    Code:

    <?php /** * Autoloader array for products with attributes stock (SBA) functionality. Makes sure that products with attributes stock is instantiated at the * right point of the Zen Cart initsystem. * * @package whole_sale_taxes.php * @author mc12345678 * @copyright Copyright 2008-2015 mc12345678 * @copyright Copyright 2003-2007 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @link http://www.zen-cart.com/ * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: config.whole_sale_taxes.php xxxx 2015-06-15 * * Modify the tax display of wholesale taxes */ $autoLoadConfig[0][] = array( 'autoType' => 'class', 'loadFile' => 'observers/class.whole_sale_taxes.php' ); $autoLoadConfig[199][] = array( 'autoType' => 'classInstantiate', 'className' => 'whole_sale_taxes', 'objectName' => 'whole_sale_taxes_observe' ); ?>
    The second is 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 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'){ 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 ?>
    I believe I've overdone it a little in the second set of checks (to restore the condition back to where the customer is recognized as a wholesale customer) and may have missed an appropriate page, but, perhaps you get the jest.

    So often I forget to put the additional notifiers to which to listen up at the declaration function... Get so carried away with the actions to be taken that I forget to tell the code to listen for the notifier. :)
    Quote Originally Posted by mc12345678 View Post
    Though the code was somewhat. "Blindly" written as there was no other indication of an issue related to unsetting the session variable, a similar/expanded comparison can be done by adding the following to the list of checks:

    Code:
    && $_SESSION['customer_whole_reset'] != '1'
    Like so:
    Code:
    $this->enabled = (MODULE_PAYMENT_PAYPALWPP_STATUS == 'True' && $_SESSION['customer_whole'] != 1 && $_SESSION['customer_whole_reset'] != '1');

  4. #14
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

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

    So a little confused, 1) should check_confirmation appear the same as checkout_payment?
    2) Does checkout_payment not reflect the prices requested to be shown?
    3) Was the goal such that the price displayed always remain the same but that tax was to be calculated for everyone? (If this last one is true then probably need to modify the tax calculations to not be excluded when the wholesaler is making a purchase.)

    May also help to use a sort of example product to describe what is desired for each page and compare that with what is happening. Use very simple numbers like a product cost of 100, a tax of 10%, a wholesale discount of 20% (this way the numbers are not expected to be confusing.)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #15
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

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

    Hi,

    - prices should be shown tax excluded to wholesalers
    - prices should be shown tax included to regular customers
    - both customers and wholesalers should be charged a total amount including taxes
    - the difference between regular customers and wholesalers is how they see prices, but the total to be paid is for both including taxes
    - the reason is that here in Italy wholesalers need to see tax excluded prices but we need to charge them the tax in any case by law
    - PayPal should not be displayed to wholesalers

    Example:
    Tax 10%
    Price for customers tax excluded: 100
    Price for customers tax included: 110
    Price for wholesalers tax excluded: 50
    Price for wholesalers tax included: 55

    A regular customer:
    - see all prices tax included so he see 110 and pays 110.

    A wholesaler:
    - see all prices tax excluded so he see 50 and pays 55
    - cannot pay by PayPal

    The display options should be applied to all pages of the store.

    Hope this helps...
    We are so close to the result...

    Thanks for all.

  6. #16
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

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

    Ah yes, VAT.

    So what is happening now through the process?

    The other thing, can you from the admin panel, tools, developers toolkit, search (using lower left window) on the catalog for the variable customer_whole and identify the files in which that appears? Which if any are tax related?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #17
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

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

    Hi, these are files:

    includes/functions/functions_prices.php
    includes/functions/functions_taxes.php
    includes/modules/pages/login/header_php.php
    includes/modules/payment/paypalwpp.php
    includes/modules/products_quantity_discounts.php
    includes/templates/theme210/templates/tpl_product_info_display.php

    Please let me know if you need any file...
    Thank you

  8. #18
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

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

    Right now the page "checkout_payment" calculates to total price correctly addying tax to all customers but the next page "checkout_confirmation" shows the prices correctly to wholesalers (tax escluded) but it does not add tax to the total amount of the order. So the last step is to be fixed...

  9. #19
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

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

    Hi,

    Do you have any update?
    I was think about that maybe the solution used for the checkout_payment to the checkout_confirmation process... What do you think about?

    Thank you.

  10. #20
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

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

    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.)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 27 Jul 2015, 05:56 PM
  2. v150 Tax inclusive price same as tax exclusive price in admin invoice.
    By nigelt74 in forum Managing Customers and Orders
    Replies: 2
    Last Post: 22 May 2012, 01:46 PM
  3. Product Price Manager & Sales Tax
    By VGlide in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 9 Aug 2010, 09:51 PM
  4. Prices inc tax in admin price manager
    By nsanford in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 12 Mar 2009, 12:09 AM
  5. Replies: 0
    Last Post: 26 Jun 2008, 01:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR