Page 1 of 2 12 LastLast
Results 1 to 10 of 27

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

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

    Hi,

    I think I found a bug and I ask for your help to solve it.

    Basically in price manager the special discounted price is considered as “net price” even if in all other zc option has been set to display all prices including tax. So it happens that for a product that costs $100 gross, when I go to price manager and set $90 as promotional price, it displays $108 (my tax rate is 20%). That is weird… Do you have a quick fix for this?

    ZC 1.3.9H.

    Thank you very much for your help.

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

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

    Quickest "fix" (without knowing what of it will display) is to enter 75 so that when 20% is added for display that it will display 90. Ie. Desired display price divided by (1+tax rate) such as 90/(1+0.20)=75
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

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

    Quote Originally Posted by mc12345678 View Post
    Quickest "fix" (without knowing what of it will display) is to enter 75 so that when 20% is added for display that it will display 90. Ie. Desired display price divided by (1+tax rate) such as 90/(1+0.20)=75
    That is not viable... We are working with all prives with Tax included, so to avoid mistakes there should be the possibility to set price with tax even in this field..

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

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

    Quote Originally Posted by ilmarchez View Post
    That is not viable... We are working with all prives with Tax included, so to avoid mistakes there should be the possibility to set price with tax even in this field..
    Understand... Was looking for a "quick" fix, that was quick, not elegant, not desirable, but would allow say a single product to be so entered.

    Alright, so put this together instead. Thinking it will still apply even for an old version of ZC such as 1.3.9h like you are using, but was generated from ZC 1.5.4. code, so there may be some differences.

    Find this or similar code in admin/products_price_manager.php:

    Code:
    if ($_POST['specials_id'] != '') {
    $specials_id = zen_db_prepare_input($_POST['specials_id']);
    if ($_POST['products_priced_by_attribute'] == '1') {
    $products_price = zen_get_products_base_price($products_filter);
    } else {
    $products_price = zen_db_prepare_input($_POST['products_price']);
    }
    $specials_price = zen_db_prepare_input($_POST['specials_price']);
    if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));
    $db->Execute("update " . TABLE_SPECIALS . " set
    specials_new_products_price='" . zen_db_input($specials_price) . "',
    specials_date_available='" . zen_db_input($specials_date_available) . "',
    specials_last_modified=now(),
    expires_date='" . zen_db_input($specials_expires_date) . "',
    status='" . zen_db_input($_POST['special_status']) . "'
    where products_id='" . $products_filter . "'");
    }
    And make it look like this:
    Code:
    if ($_POST['specials_id'] != '') {
    $specials_id = zen_db_prepare_input($_POST['specials_id']);
    if ($_POST['products_priced_by_attribute'] == '1') {
    $products_price = zen_get_products_base_price($products_filter);
    } else {
    $products_price = zen_db_prepare_input($_POST['products_price']);
    }
    $specials_price = zen_db_prepare_input($_POST['specials_price']);
    if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));
    if (DISPLAY_PRICE_WITH_TAX == 'true') {
    $taxRate = zen_get_tax_rate($_POST['products_tax_class_id']);
    if ($taxRate > 0) {
    $specials_price = $specials_price / (($taxRate / 100) + 1);
    }
    }
    $db->Execute("update " . TABLE_SPECIALS . " set
    specials_new_products_price='" . zen_db_input($specials_price) . "',
    specials_date_available='" . zen_db_input($specials_date_available) . "',
    specials_last_modified=now(),
    expires_date='" . zen_db_input($specials_expires_date) . "',
    status='" . zen_db_input($_POST['special_status']) . "'
    where products_id='" . $products_filter . "'");
    }
    Untested, may be buggy, but looks like it might work... Could modify things to be more like the standard product entry field in the product description, but hadn't gone to find all the associated code to do the auto calculations, etc... New code added in blue.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

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

    It worked! Thank you so much!!!!

    I have one final issue, I'd appreciate so much your help...
    I have the addon dual pricing and customers are divided into customers and wholesalers.

    Wholesalers should display prices without taxes
    Customers should display prices with taxes

    To make this happen I've modified the code as follows:

    - in the includes/functions/functions_taxes.php I changed this code:
    Code:
     function zen_add_tax($price, $tax) {
        global $currencies;
    
        if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
          return $price + zen_calculate_tax($price, $tax);
        } else {
          return $price;
        }
      }
    to this:
    Code:
     function zen_add_tax($price, $tax) {
        global $currencies;
        if ($_SESSION['customer_whole'] == 1) {
            return $price;
        }
        if ((DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0)) {
            return $price + zen_calculate_tax($price, $tax);
        } else {
            return $price;
        }
    }
    It works and displays prices including taxes to customers and without taxes to wholesalers.
    The problem is that I want taxes to be applied to everybody at checkout. In this case the grand total is applied only to customers, not to wholesalers as well.
    How can I do to make the grand total including taxes for everybody? Thank you.

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

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

    In this case, need to clear the SESSION variable in the includes/modules/pages/YOUR_PAGE/header_php.php file on the page where you want normal taxing to occur. But I suggest setting a different variable or the value tosomethingelseand to evaluate where one could end up next. In the follow on location(s), check for that variable set. As it is, and revert it to the value of '1' so that the views elsewhere are consistent upon "departure".from that first page.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Sep 2008
    Location
    WA
    Posts
    555
    Plugin Contributions
    0

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

    Did you ever figure out the last part?

    L

  8. #8
    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.

  9. #9
    Join Date
    Jul 2012
    Posts
    16,816
    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...

  10. #10
    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

 

 
Page 1 of 2 12 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

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