Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Additional Orders Info


Jack_mcs

Recommended Posts

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

Link to comment
Share on other sites

@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?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

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 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

@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.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 10 months later...

@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.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

@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.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...