dculley Posted May 11, 2020 Share Posted May 11, 2020 osCommerce connector for Tax Rates (went out 6yr ago) great for zip code taxes. I used it in osc 2.3.4 and had it running in Phoenix 1.0.5 until 1.0.6.0 came out. I'm not a coder so I'm confused on the error. Need help PLEASE I did a fresh install of 1.0.6.0 to cleanup issues with trying to get some apps working. So I'm reinstall apps. I have uploaded the program as per the instructions. And checked that all are in please. When I go to Admin -> Modules -> Order totals -> install i get this message: Warning: Use of undefined constant TABLE_CONFIGURATION - assumed 'TABLE_CONFIGURATION' (this will throw an Error in a future version of PHP) in /home/ladybug3597/public_html/temp.ladybuggardendecor.com/includes/modules/order_total/ot_taxrates.php on line 871146 - Table 'phoenix.TABLE_CONFIGURATION' doesn't exist select configuration_value from TABLE_CONFIGURATION where configuration_key = 'MODULE_ORDER_TOTAL_TAXRATES_STATUS' line 87 is: $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TAXRATES_STATUS'"); It is not letting install 'TaxRates' module. Can anyone help? Please. I don't see a way to contact the originator of the app. It was the most simplest and easy way for me to ship in SC (USA) and NC (USA) ext, with jurisdiction sales tax by zip code. Thanks Link to comment Share on other sites More sharing options...
hungryfrank Posted May 11, 2020 Share Posted May 11, 2020 the databases are hardcoded configuration instead of TABLE_CONFIGURATION. or if you have a lot of older addons you might wanna to get a copy of includes/database_tables.php. and iinclude it inn application_top.php. of course hit is not in the spirit of Phoenix you can cut up to 4 pages of your checkout by using my three add_ons login create account in one page Express checkout login pop up modal Link to comment Share on other sites More sharing options...
dculley Posted May 11, 2020 Author Share Posted May 11, 2020 @hungryfrank Thanks for getting back to me. I changed the line to : $check_query = tep_db_query("select configuration_value from " . CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TAXRATES_STATUS'"); That didn't work sill got:Warning: Use of undefined constant CONFIGURATION - assumed 'CONFIGURATION' (this will throw an Error in a future version of PHP) in /home/ladybug3597/public_html/temp.ladybuggardendecor.com/includes/modules/order_total/ot_taxrates.php on line 871146 - Table 'phoenix.CONFIGURATION' doesn't exist select configuration_value from CONFIGURATION where configuration_key = 'MODULE_ORDER_TOTAL_TAXRATES_STATUS' What did I do wrong? Link to comment Share on other sites More sharing options...
♥ecartz Posted May 11, 2020 Share Posted May 11, 2020 $check_query = tep_db_query("SELECT configuration_value FROM configuration WHERE configuration_key = 'MODULE_ORDER_TOTAL_TAXRATES_STATUS'"); It needs to be lower cased and should be inside the quotes, not outside. Always back up before making changes. Link to comment Share on other sites More sharing options...
dculley Posted May 11, 2020 Author Share Posted May 11, 2020 @ecartz I got excited. I put your line in and had no errors. TaxRates should up so I clicked on it than clicked on install and got this: Warning: Use of undefined constant TABLE_CONFIGURATION - assumed 'TABLE_CONFIGURATION' (this will throw an Error in a future version of PHP) in /home/ladybug3597/public_html/temp.ladybuggardendecor.com/includes/modules/order_total/ot_taxrates.php on line 1171146 - Table 'phoenix.TABLE_CONFIGURATION' doesn't exist delete from TABLE_CONFIGURATION where configuration_key in ('MODULE_ORDER_TOTAL_TAXRATES_STATUS','MODULE_ORDER_TOTAL_TAXRATES_SORT_ORDER','MODULE_ORDER_TOTAL_TAXRATES_ADDRESS','MODULE_ORDER_TOTAL_TAXRATES_DATE','MODULE_ORDER_TOTAL_TAXRATES_STATES','MODULE_ORDER_TOTAL_TAXRATES_DESCRIPTION','MODULE_ORDER_TOTAL_TAXRATES_LOCATION' I'm under PHP 7.2.27 (if that helps) here is the ot_taxrates.php - unedited Thanks for the help. ot_taxrates.php Link to comment Share on other sites More sharing options...
♥ecartz Posted May 11, 2020 Share Posted May 11, 2020 Everywhere in the file where it says " . TABLE_CONFIGURATION . " replace it with just configuration Always back up before making changes. Link to comment Share on other sites More sharing options...
dculley Posted May 11, 2020 Author Share Posted May 11, 2020 @ECART I thought so but was chicken to try. I did the below as you instructed and it worked. BIG THANK YOU function keys() { return array('MODULE_ORDER_TOTAL_TAXRATES_STATUS', 'MODULE_ORDER_TOTAL_TAXRATES_SORT_ORDER', 'MODULE_ORDER_TOTAL_TAXRATES_ADDRESS', 'MODULE_ORDER_TOTAL_TAXRATES_DATE', 'MODULE_ORDER_TOTAL_TAXRATES_STATES', 'MODULE_ORDER_TOTAL_TAXRATES_DESCRIPTION', 'MODULE_ORDER_TOTAL_TAXRATES_LOCATION'); } function install() { global $db; tep_db_query("insert into " . configuration . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display TaxRates', 'MODULE_ORDER_TOTAL_TAXRATES_STATUS', 'true', 'Do you want this module to display?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . configuration . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TAXRATES_SORT_ORDER', '3', 'Sort order of display', '6', '2', now())"); tep_db_query("insert into " . configuration . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Sales Tax Address', 'MODULE_ORDER_TOTAL_TAXRATES_ADDRESS', 'shipping', 'Select address for calculating sales tax', '6', '3','tep_cfg_select_option(array(\'shipping\', \'billing\'), ', now())"); tep_db_query("insert into " . configuration . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('TaxRate Date', 'MODULE_ORDER_TOTAL_TAXRATES_DATE', '', 'Enter the Year & Month e.g. 201312 - of tax rate files', '6', '4', now())"); tep_db_query("insert into " . configuration . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('TaxRate Date', 'MODULE_ORDER_TOTAL_TAXRATES_STATES', '', 'List states that require sales tax calculated e.g. CA, NV, WA ', '6', '5', now())"); tep_db_query("insert into " . configuration . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sales Tax Description', 'MODULE_ORDER_TOTAL_TAXRATES_DESCRIPTION', 'Sales Tax', 'The Sales Tax description to be displayed', '6', '6', now())"); tep_db_query("insert into " . configuration . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Show Location Code', 'MODULE_ORDER_TOTAL_TAXRATES_LOCATION', 'true', 'Include a City name in your Sales Tax description', '6', '7', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); } function remove() { global $db; $keys = ''; $keys_array = $this->keys(); $keys_size = sizeof($keys_array); for ($i=0; $i<$keys_size; $i++) { $keys .= "'" . $keys_array[$i] . "',"; } $keys = substr($keys, 0, -1); tep_db_query("delete from " . configuration . " where configuration_key in (" . $keys . ")"); Link to comment Share on other sites More sharing options...
hungryfrank Posted May 11, 2020 Share Posted May 11, 2020 @dculley nothing to be scared. sooner you get to edit files the better. just make a copy of it before making any changes. if u made a mistake you can easily copy back the original you can cut up to 4 pages of your checkout by using my three add_ons login create account in one page Express checkout login pop up modal Link to comment Share on other sites More sharing options...
dculley Posted May 11, 2020 Author Share Posted May 11, 2020 I'm working on it. Phoenix Is harder for me to wrap my head around it. Thanks again for you guys kindness and help. @hungryfrank @ecartz Link to comment Share on other sites More sharing options...
kgtee Posted May 12, 2020 Share Posted May 12, 2020 @dculley 😀what you did is not quite correct. What @ecartz has shown you should be done this way as an example: Quote tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, Change it to: Quote tep_db_query("insert into configuration ( configuration_title , You should replace the entire string " . TABLE_CONFIGURATION . ", Including the two double quotes. Link to comment Share on other sites More sharing options...
dculley Posted May 12, 2020 Author Share Posted May 12, 2020 @kgtee Thank you. I applied your changes. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.