lucsangel Posted November 5, 2018 Share Posted November 5, 2018 Hi Jack, I see that there has been no activity in a while but just to update for those who are still using this useful add-on... passing to php 7.2 on the admin side, when you click "invoice" for an order the undefined constant error comes up for SHOW_INVOICE_SHIPPING. To fix it I just put it in single quotes 'SHOW_INVOICE_SHIPPING', so in admin/includes/functions/general.php : CHANGE *************************************************** //// /*** BOF: Additional Orders Info ***/ // Return orders shipping method function tep_get_orders_shipping_method($order_id) { $check_order_query= tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id='" . $order_id . "' and class='ot_shipping'"); $check_order= tep_db_fetch_array($check_order_query); if (SHOW_INVOICE_SHIPPING=='2' and ($check_order['title']=='United Parcel Service' or $check_order['title']=='United States Postal Service')) { // return short version on UPS and USPS *************************************** TO ************************************** //// /*** BOF: Additional Orders Info ***/ // Return orders shipping method function tep_get_orders_shipping_method($order_id) { $check_order_query= tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id='" . $order_id . "' and class='ot_shipping'"); $check_order= tep_db_fetch_array($check_order_query); if ('SHOW_INVOICE_SHIPPING'=='2' and ($check_order['title']=='United Parcel Service' or $check_order['title']=='United States Postal Service')) { // return short version on UPS and USPS ******************************************************* Works for me but you are the programmer so you can check to see if it is the right fix. Bobbee Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 5, 2018 Author Share Posted November 5, 2018 @lucsangelIt looks like the reason for the failure in this case is because 'SHOW_INVOICE_SHIPPING' is not defined. I looked in V 1.5 (the last released version) and don't see it there. What version of this addon are you using? And what version of oscommerce? Is there a setting in this addons settings that allows you to control that item? Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
lucsangel Posted November 5, 2018 Share Posted November 5, 2018 1 minute ago, Jack_mcs said: @lucsangelIt looks like the reason for the failure in this case is because 'SHOW_INVOICE_SHIPPING' is not defined. I looked in V 1.5 (the last released version) and don't see it there. What version of this addon are you using? And what version of oscommerce? Is there a setting in this addons settings that allows you to control that item? Hello Jack I am using the latest version you uploades v.1.5 https://apps.oscommerce.com/8oFiX&additional-orders-info with FROZEN BS3 and see no control in configuration Additionnal Info for this in particular. So many of the Quote Link to comment Share on other sites More sharing options...
lucsangel Posted November 5, 2018 Share Posted November 5, 2018 Just now, lucsangel said: Hello Jack I am using the latest version you uploades v.1.5 https://apps.oscommerce.com/8oFiX&additional-orders-info with FROZEN BS3 and see no control in configuration Additionnal Info for this in particular. So many of the addons are throwing these types of errors. (sorry my hand slipped and posted without finishing). It happens on PHP 7.2, not in the earlier versions Quote Link to comment Share on other sites More sharing options...
ArtcoInc Posted November 5, 2018 Share Posted November 5, 2018 @lucsangel PHP 7.2 is much more strict than prior versions. Both Frozen and almost all add-ons need updating to work without warnings under 7.2. If you can try running PHP 7.1, I think most of those warnings will go away. M Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 5, 2018 Author Share Posted November 5, 2018 @lucsangelI can't see that the SHOW_INVOICE_SHIPPING was ever declared in any of the versions for this addon. So the change you made will stop the error but it will cause the code to always skip that part. Without the change you made, it would most likely do the same since it was not declared and would probably be set to 0. I'll take a closer look at the code when I can and fix that as needed. Thanks for reporting it. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
lucsangel Posted November 5, 2018 Share Posted November 5, 2018 2 hours ago, Jack_mcs said: @lucsangelI can't see that the SHOW_INVOICE_SHIPPING was ever declared in any of the versions for this addon. So the change you made will stop the error but it will cause the code to always skip that part. Without the change you made, it would most likely do the same since it was not declared and would probably be set to 0. I'll take a closer look at the code when I can and fix that as needed. Thanks for reporting it. Thank you Jack. It is a great addon. Quote Link to comment Share on other sites More sharing options...
♥14steve14 Posted September 26, 2019 Share Posted September 26, 2019 @Jack_mcs Been using this addon for years and find it really helpful. I have just tried to install the latest version of this addon to the latest version of Phoenix running on php7.3. I have uploaded the supplied admin/orders.php file rather than try to cut and paste the code into a standard file as I thought it would be easiest. I get the same error as mentioned above. The actual error I am getting is Quote Warning: Use of undefined constant SHOW_INVOICE_SHIPPING - assumed 'SHOW_INVOICE_SHIPPING' (this will throw an Error in a future version of PHP) in /####/####/####/####/####/includes/functions/general.php on line 1585 There is also another error Quote Warning: sizeof(): Parameter must be an array or an object that implements Countable in /####/####/####/####/####/orders.php on line 526 Line 526 is if (sizeof($order->products[$i]['attributes']) > 0) { Any help would be appreciated. Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
Jack_mcs Posted September 26, 2019 Author Share Posted September 26, 2019 @14steve14The original purpose of the SHOW_INVOICE_SHIPPING option was to shorten the UPS and USPS shipping lines. So a line like this Quote United States Postal Service 1 lbs, 5.76 oz (Priority Mail™): would be changed to Quote United States Postal Service But there's no way for the code to work as it is, even if that option was present. So unless you or others see a need for that, change this code in the admin/includes.functions/additional_orders_info.php file if (SHOW_INVOICE_SHIPPING=='2' && ($check_order['title']=='United Parcel Service' or $check_order['title']=='United States Postal Service')) { // return short version on UPS and USPS $short_shipping_end= strpos($check_order['title'], ''); $short_shipping= substr($check_order['title'], 1, $short_shipping_end); return $short_shipping; } else { // return normal shipping return $check_order['title']; } to return $check_order['title']; For the second one, I can't find that code anywhere in this addon. Please state the file it is in and I will take a look. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
♥14steve14 Posted September 27, 2019 Share Posted September 27, 2019 Cheers @Jack_mcs changing the suggested code worked a treat. For some reason the other error has gone. May be will have to try turning it off and back on again for other errors. LOL.😁😁 Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
Jack_mcs Posted September 27, 2019 Author Share Posted September 27, 2019 Thanks for letting me know. I will apply the change to the next version. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.