Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jun 2012
    Location
    California
    Posts
    202
    Plugin Contributions
    0

    Default Where can I find "zen_get_tax_locations()" function

    www.wildsteedworx.com
    1.5.5f
    PHP 7
    winchester_black_updated
    admin_new_orders_1.4
    edit_orders-4.3.3
    encrypted_master_password-2.3.0
    MSRP_Display_1.3.1
    Personalized My Account Link v2.0_For_ZCv150
    super_orders_4.0.9_revised
    twitch_base_cost_16a_for_154
    Twitch_HiddenSearchable_ModelNo_for_155f
    USPS_2018_03_28_K10
    zen_TyPackageTracker-master

    I am having an issue with "admin_new_orders_1.4" where when I create a new order I get an error page initially and the following error log is created:

    " PHP Fatal error: Uncaught Error: Call to undefined function zen_get_tax_locations() in /home2/wildstee/public_html/includes/modules/order_total/ot_loworderfee.php:64
    Stack trace:
    #0 /home2/wildstee/public_html/includes/classes/order_total.php(72): ot_loworderfee->process()
    #1 /home2/wildstee/public_html/****************/new_order.php(252): order_total->process()
    #2 {main}
    thrown in /home2/wildstee/public_html/includes/modules/order_total/ot_loworderfee.php on line 64"

    Of course it is obvious that what is wrong is the "zen_get_tax_locations()" is missing but I cannot figure out where it is to replace it.
    I had installed TaxCloud a while back but did not realize exactly how their system worked until after I got it installed and began using it.
    I subsequently decided to remove it which I thought I had done successfully but now I have this issue.

    Any help would be greatly appreciated.

    Thank You

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

    Default Re: Where can I find "zen_get_tax_locations()" function

    Includes/functions/functions_taxes.php

    Right where one might expect to find tax related functions. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Where can I find "zen_get_tax_locations()" function

    @wsworx, your issue with "Admin New Order" might have to do with this EO GitHub issue, which was incorporated in EO 4.3.2.

    Essentially, EO "used to" provide that function as an "include if not present" for everyone and now includes the function only for its use.

  4. #4
    Join Date
    Jun 2012
    Location
    California
    Posts
    202
    Plugin Contributions
    0

    Default Re: Where can I find "zen_get_tax_locations()" function

    Quote Originally Posted by mc12345678 View Post
    Includes/functions/functions_taxes.php

    Right where one might expect to find tax related functions. :)
    I thought the same thing but when I looked originally I could not find it in the "functions_taxes".
    Must have been late when I looked in it originally......now I see it in the file but I am still getting the error.

  5. #5
    Join Date
    Jun 2012
    Location
    California
    Posts
    202
    Plugin Contributions
    0

    Default Re: Where can I find "zen_get_tax_locations()" function

    Quote Originally Posted by lat9 View Post
    @wsworx, your issue with "Admin New Order" might have to do with this EO GitHub issue, which was incorporated in EO 4.3.2.

    Essentially, EO "used to" provide that function as an "include if not present" for everyone and now includes the function only for its use.
    Thank You lat9

    I have read through the Git Hub and I get what is happening to a degree but totally unclear as to how to fix it.
    So is it throwing the error because it is being called from New Order's file and not Edit Orders file?

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Where can I find "zen_get_tax_locations()" function

    Quote Originally Posted by wsworx View Post
    Thank You lat9

    I have read through the Git Hub and I get what is happening to a degree but totally unclear as to how to fix it.
    So is it throwing the error because it is being called from New Order's file and not Edit Orders file?
    What you said is correct. That change to EO makes those function declarations only available when EO is active.

    I'm not familiar with "Admin New Order", so I'm hesitant to provide required code to get you going but I'll give it a shot.

    At the very top of the 'admin_new_orders.php' (or whatever the module's name is), after the line that requires 'includes/application_top.php', add the following:

    Code:
    if (!function_exists('zen_get_tax_locations')) {
     function zen_get_tax_locations($store_country = -1, $store_zone = -1) {
      global $db;
        switch (STORE_PRODUCT_TAX_BASIS) {
    
          case 'Shipping':
            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                    from " . TABLE_ADDRESS_BOOK . " ab
                                    left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                    where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                    and ab.address_book_id = '" . (int)$_SESSION['sendto'] . "'";
            $tax_address_result = $db->Execute($tax_address_query);
          break;
          case 'Billing':
    
            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                    from " . TABLE_ADDRESS_BOOK . " ab
                                    left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                    where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                    and ab.address_book_id = '" . (int)$_SESSION['billto'] . "'";
            $tax_address_result = $db->Execute($tax_address_query);
          break;
          case 'Store':
            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                    from " . TABLE_ADDRESS_BOOK . " ab
                                    left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                    where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                    and ab.address_book_id = '" . (int)$_SESSION['billto'] . "'";
            $tax_address_result = $db->Execute($tax_address_query);
    
            if ($tax_address_result ->fields['entry_zone_id'] == STORE_ZONE) {
    
            } else {
              $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                      from " . TABLE_ADDRESS_BOOK . " ab
                                      left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                      where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                      and ab.address_book_id = '" . (int)$_SESSION['sendto'] . "'";
            $tax_address_result = $db->Execute($tax_address_query);
           }
         }
         $tax_address['zone_id'] = $tax_address_result->fields['entry_zone_id'];
         $tax_address['country_id'] = $tax_address_result->fields['entry_country_id'];
         return $tax_address;
     }
    }
    I'm guessing, though, that that function's missing is the "tip of the iceberg".

  7. #7
    Join Date
    Jun 2012
    Location
    California
    Posts
    202
    Plugin Contributions
    0

    Default Re: Where can I find "zen_get_tax_locations()" function

    Quote Originally Posted by lat9 View Post
    What you said is correct. That change to EO makes those function declarations only available when EO is active.

    I'm not familiar with "Admin New Order", so I'm hesitant to provide required code to get you going but I'll give it a shot.

    At the very top of the 'admin_new_orders.php' (or whatever the module's name is), after the line that requires 'includes/application_top.php', add the following:

    Code:
    if (!function_exists('zen_get_tax_locations')) {
     function zen_get_tax_locations($store_country = -1, $store_zone = -1) {
      global $db;
        switch (STORE_PRODUCT_TAX_BASIS) {
    
          case 'Shipping':
            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                    from " . TABLE_ADDRESS_BOOK . " ab
                                    left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                    where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                    and ab.address_book_id = '" . (int)$_SESSION['sendto'] . "'";
            $tax_address_result = $db->Execute($tax_address_query);
          break;
          case 'Billing':
    
            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                    from " . TABLE_ADDRESS_BOOK . " ab
                                    left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                    where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                    and ab.address_book_id = '" . (int)$_SESSION['billto'] . "'";
            $tax_address_result = $db->Execute($tax_address_query);
          break;
          case 'Store':
            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                    from " . TABLE_ADDRESS_BOOK . " ab
                                    left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                    where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                    and ab.address_book_id = '" . (int)$_SESSION['billto'] . "'";
            $tax_address_result = $db->Execute($tax_address_query);
    
            if ($tax_address_result ->fields['entry_zone_id'] == STORE_ZONE) {
    
            } else {
              $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                      from " . TABLE_ADDRESS_BOOK . " ab
                                      left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                      where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                      and ab.address_book_id = '" . (int)$_SESSION['sendto'] . "'";
            $tax_address_result = $db->Execute($tax_address_query);
           }
         }
         $tax_address['zone_id'] = $tax_address_result->fields['entry_zone_id'];
         $tax_address['country_id'] = $tax_address_result->fields['entry_country_id'];
         return $tax_address;
     }
    }
    I'm guessing, though, that that function's missing is the "tip of the iceberg".
    Tried that but it did not change anything.
    It appears as though the Admin New Order Designer was attempting to address this issue in the "new_order.php" file:

    Code:
    // Create the new order
    			zen_db_perform(TABLE_ORDERS, $sql_data_array);
    			$cInfo->orders_id = $db->Insert_ID();
    
    			// Use the normal order class instead of the admin one
    			require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'order.php');
    			$GLOBALS['order'] = new order($cInfo->orders_id);
    			$GLOBALS['order']->info['tax_groups'] = array();
    
    			// Load required modules for order totals if enabled
    			if(defined('MODULE_ORDER_TOTAL_INSTALLED') && zen_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
    				// Edit Orders 4.0
    				if(version_compare(EO_VERSION, '4.0', '>=') && version_compare(EO_VERSION, '4.1', '<')) {
    					$supported_order_total_modules = 'ot_subtotal;ot_total';
    
    					require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'order_total.php');
    					$GLOBALS['order_total_modules'] = new order_total();
    					$module_list = explode(';', $supported_order_total_modules);
    
    					foreach($module_list as $module) {
    						$module_file = DIR_FS_CATALOG . DIR_WS_MODULES . 'order_total/' . $module . '.php';
    						if(@file_exists($module_file)) {
    							include_once($module_file);
    							$GLOBALS[$module] = new $module;
    							$GLOBALS['order_total_modules']->modules[] = $module . '.php';
    						}
    					}
    				}
    				// Edit Orders 4.1+
    				else if(version_compare(EO_VERSION, '4.1', '>=')) {
    					require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'order_total.php');
    					$GLOBALS['order_total_modules'] = new order_total();
    
    					require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'shopping_cart.php');
    					$_SESSION['cart'] = new shoppingCart();
    				}
    				else {
    					// Could not find a supported version of Edit Orders
    					break;
    				}
    Your thoughts on this chunk of code.

  8. #8
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,691
    Plugin Contributions
    9

    Default Re: Where can I find "zen_get_tax_locations()" function

    wsworx,
    i will give you my 2 cents... for free...

    when you say, you tried that, but it did not change anything, are you saying the error log is exactly the same? after implementing lat9's suggestion? if so, i find that curious....

    instead of the change that lat9 recommended, you could try removing the top code from:

    YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php

    PHP Code:
    //remove this part:

    if (basename($PHP_SELF'.php') != FILENAME_EDIT_ORDERS) {
        return;

    however, i look at your OP, and whoa nellie.... you have these plugins installed:

    admin_new_orders_1.4
    edit_orders-4.3.3
    encrypted_master_password-2.3.0
    super_orders_4.0.9_revised

    now, my experience is that 3 of these do not play nice together. and how you could get them all to work together.... well, apparently they do not.

    my recommendation would be to use EMP (encrypted_master_password-2.3.0) to place any new orders and get rid of admin_new_orders. i think it is a much more elegant solution, and you can get much familiar with how good/bad your customer checkout process is....

    barring those 2 suggestions, you can add the function into:

    YOUR_ADMIN/includes/functions/extra_functions/custom_functions.php

    and leave everything else unaffected. why i dislike this is the repeat of all the code. in addition to which, it seems that some of it makes use of session variables, and i'm not sure if admin_new_order is setting the customer id.

    i have all my clients use EMP to place admin new orders. that leaves me with one set of order entry code to maintain and keep straight.

    with regards to the last piece of code that you want some thoughts on, again use EMP and you can ignore this bit of code. checking for version numbers?? oy! in addition, that code is only loading classes and not functions.

    good luck! (and i really mean that!)
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  9. #9
    Join Date
    Jun 2012
    Location
    California
    Posts
    202
    Plugin Contributions
    0

    Default Re: Where can I find "zen_get_tax_locations()" function

    Quote Originally Posted by carlwhat View Post
    wsworx,
    i will give you my 2 cents... for free...

    when you say, you tried that, but it did not change anything, are you saying the error log is exactly the same? after implementing lat9's suggestion? if so, i find that curious....

    instead of the change that lat9 recommended, you could try removing the top code from:

    YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php

    PHP Code:
    //remove this part:

    if (basename($PHP_SELF'.php') != FILENAME_EDIT_ORDERS) {
        return;

    however, i look at your OP, and whoa nellie.... you have these plugins installed:

    admin_new_orders_1.4
    edit_orders-4.3.3
    encrypted_master_password-2.3.0
    super_orders_4.0.9_revised

    now, my experience is that 3 of these do not play nice together. and how you could get them all to work together.... well, apparently they do not.

    my recommendation would be to use EMP (encrypted_master_password-2.3.0) to place any new orders and get rid of admin_new_orders. i think it is a much more elegant solution, and you can get much familiar with how good/bad your customer checkout process is....

    barring those 2 suggestions, you can add the function into:

    YOUR_ADMIN/includes/functions/extra_functions/custom_functions.php

    and leave everything else unaffected. why i dislike this is the repeat of all the code. in addition to which, it seems that some of it makes use of session variables, and i'm not sure if admin_new_order is setting the customer id.

    i have all my clients use EMP to place admin new orders. that leaves me with one set of order entry code to maintain and keep straight.

    with regards to the last piece of code that you want some thoughts on, again use EMP and you can ignore this bit of code. checking for version numbers?? oy! in addition, that code is only loading classes and not functions.

    good luck! (and i really mean that!)
    when you say, you tried that, but it did not change anything, are you saying the error log is exactly the same? after implementing lat9's suggestion? if so, i find that curious....
    I have all of them playing together accept for this one issue. I have not had any database mismatch issues or missing info so far.
    Yes that is what I was saying. However, after walking away for a bit and coming back I now realize that it has changed slightly.

    PHP Fatal error: Uncaught Error: Call to undefined function zen_get_tax_description() in /home2/wildstee/public_html/includes/modules/order_total/ot_loworderfee.php:66
    Stack trace:#0 /home2/wildstee/public_html/includes/classes/order_total.php(72): ot_loworderfee->process()
    #1 /home2/wildstee/public_html/***************/new_order.php(299): order_total->process()#2 {main}
    thrown in /home2/wildstee/public_html/includes/modules/order_total/ot_loworderfee.php on line 66

    EMP has been recommended to me before and I looked at it but I do not like accessing the customer's log in just to generate a new order. While I understand what your saying and to some degree agree with it I find it to be unprofessional and dangerous to have data entry folks accessing customer's accounts online just to enter phone orders. I find it rather odd that the ZenCart developers have never implemented some of these very basic features.

  10. #10
    Join Date
    Jun 2012
    Location
    California
    Posts
    202
    Plugin Contributions
    0

    Default Re: Where can I find "zen_get_tax_locations()" function

    "instead of the change that lat9 recommended, you could try removing the top code from:

    YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php

    PHP Code:
    //remove this part:

    if (basename($PHP_SELF, '.php') != FILENAME_EDIT_ORDERS) {
    return;
    }"

    So I removed the changes lat9 recommended and did the change you recommended above but still get the same error now as before about zen_get_tax_locations. I'm going to try your other two suggestions now.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. where can I find out the "discount count down by the time"
    By soso838 in forum General Questions
    Replies: 5
    Last Post: 18 Apr 2018, 11:52 PM
  2. v139h Can't find where to edit/remove "about us" link..
    By nlowcock in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 24 Jun 2012, 04:14 PM
  3. where can i find this link "/index.php?main_page=index&cPath=1"?
    By hangman21 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Jul 2010, 04:15 AM
  4. Can't find where to change the name of the "Documents" sidebox..
    By candylotus in forum Basic Configuration
    Replies: 3
    Last Post: 23 Apr 2008, 12:07 AM
  5. can't find answer to "where is the rest of the cc number"
    By Karole in forum Managing Customers and Orders
    Replies: 6
    Last Post: 23 Jul 2007, 10:06 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