Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fancier Invoice & Packingslip v1.0


PopTheTop

Recommended Posts

First off, thanks for the great contribution. Of course, that always follows with a question or request...so here it is:

 

I'm trying to add the Shipping Method to the long skinny box (I know, it's already in the totals at the bottom but I thought it would look good there too).

 

Here's how I tried to do it but it doesn't want to include the Shipping Method:

<td><b><?php echo PRINT_INVOICE_ORDERNR; ?></b> <?php echo tep_db_input($oID); ?></td>
<td><b><?php echo PRINT_INVOICE_DATE; ?></b><?php echo tep_date_short($order->info['date_purchased']); ?></td>
<td><b><?php echo PRINT_INVOICE_SHIPPING; ?></b> <td><?php echo $order->info['shipping_method']; ?></td>
<td><b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <td><?php echo $order->info['payment_method']; ?></td></td>

 

I included a PRINT_INVOICE_SHIPPING entry into my languages/invoice.php file and it's picking that up fine but the area where <?php echo $order->info['shipping_method']; ?> is blank.

 

Any sugestions are greatly appreciated.

Link to comment
Share on other sites

Hi,

 

I have installed this contrib and am trying to make the store name and address at the bottom dynamic and am having some issues.

 

I used "<?php echo STORE_NAME; ?>" and that worked fine but when I try to use any other variable it just diaplays the variable name. For instance, I was testing with MALE_ADDRESS (Mr.) from the english.php file and instead of displaying "Mr." it displays "MALE_ADDRESS"!!

 

I can't figure it out. I have tried different variables to see if any would work and none do. If I define the variable in the top of the invoice.php page it works but what good is that?

 

application_tp.php is being included, I thought that is what included all the other files?

 

Does anyone have any idea why this would happen?

 

Craig

Link to comment
Share on other sites

I'm trying to add the Shipping Method to the long skinny box (I know, it's already in the totals at the bottom but I thought it would look good there too).

 

Any sugestions are greatly appreciated.

 

Sorry, I can not seem to find this one either. You have to pull it from the database through a query like the order ID (oid) is at the top of the invoice.php file. But what table is it located in? I have no clue.

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

You can not add it to admin/includes/language/english/english.php - You have to add it to admin/includes/language/english/invoice.php

 

 

 

Hi,

 

I have installed this contrib and am trying to make the store name and address at the bottom dynamic and am having some issues.

 

I used "<?php echo STORE_NAME; ?>" and that worked fine but when I try to use any other variable it just diaplays the variable name. For instance, I was testing with MALE_ADDRESS (Mr.) from the english.php file and instead of displaying "Mr." it displays "MALE_ADDRESS"!!

 

I can't figure it out. I have tried different variables to see if any would work and none do. If I define the variable in the top of the invoice.php page it works but what good is that?

 

application_tp.php is being included, I thought that is what included all the other files?

 

Does anyone have any idea why this would happen?

 

Craig

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

I dont think you understood, I am trying to call a variable that is defined in english.php, not put the code IN english.php.

 

Like I said, when I call STORE_NAME it displays fine but when I call anything from english.php it will not display.

 

I thought that english.php was included in every page display?

Why would STORE_NAME work but no variables from english.php??

 

Please let me know.

 

Craig

Link to comment
Share on other sites

OHH I see now, I thought you put the path to the admin/invoice file. I just realized that you said /languages....

 

But why doesn't the page also pull from english.php?

 

If you could quickly explain that it would be awesome and would help me a lot with my coding. (if you can call it that! : )

 

Thanks!

 

Craig

Link to comment
Share on other sites

Not sure, but I think that the cart is setup to pull the language defines from the language file of the same name of the php file it is calling it from.

 

This is because you will see a lot of same language defines but they state different stuff. Examples:

 

define('BOX_HEADING_NOTIFICATIONS', 'Notifications');

define('BOX_HEADING_NOTIFICATIONS', 'Please Note:');

 

or

 

define('IMAGE_BUTTON_CONTINUE', 'Continue');

define('IMAGE_BUTTON_CONTINUE', ' Next ');

 

or

 

define('HEADING_TITLE', 'Contact Us');

define('HEADING_TITLE', 'Order Confirmation');

 

 

As far as the STORE_NAME goes, that is being called from the database, it gets that info from where you enter it in your Admin store configuration, not from a language file.

 

Why do you want it in admin/includes/language/english/english.php and not in admin/includes/language/english/invoice.php???

 

It really should not make any difference. If you really want it to be called from admin/includes/language/english/english.php then you have to add an include at the top of admin/invoice.php to include the admin/includes/language/english/english.php file.

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

I tried including the english file and it didn't work.

 

I want to put it in the english file (or in the admin/database) because I want to keep the settings in one place. I plan to use this store for several businesses we have (copy it to different domains) once I am finished making all the changes I want to make. I also may give it to folks that use my hosting services.

 

So I want to have all the settings done in the english file (where I have defined some other things) or in the database/admin.

 

What do you think about this and also what would it take to add new things to the admin?

 

Let me know your thoughts.

 

Craig

Link to comment
Share on other sites

Update...

I am trying to add a small note stating there are no comments IF there are no comments to be listed. I can not get it to work correctly. Below is a copy of the order comments on the invoice code. Please take a look at it and see if anyone can help with getting it to work right.

 

Read the comments (//...) in the code just above the code that is commented out.

<!-- ORDER COMMENTS CODE STARTS HERE //-->
<?php 
$orders_status_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_status_history_query)) {
    echo '      <br><br>';
    echo '      <table width="100%" border="0" cellpadding="0" cellspacing="0">';
    echo '     	 <tr>';
    echo '        <td width="9"> </td>';
    echo '        <td>';
    echo '        <table width="100%" border="0" cellpadding="0" cellspacing="0">';
    echo '       	 <tr>';
    echo '          <td width="11"><img src="../images/borders/maingrey_01.gif" width="11" height="16" alt=""></td>';
    echo '          <td background="../images/borders/maingrey_02.gif"><img src="../images/borders/maingrey_02.gif" width="24" height="16" alt="" ></td>';
    echo '          <td width="19"><img src="../images/borders/maingrey_03.gif" width="19" height="16" alt=""></td>';
    echo '       	 </tr>';
    echo '       	 <tr>';
    echo '          <td background="../images/borders/maingrey_04.gif"><img src="../images/borders/maingrey_04.gif" width="11" height="21" alt=""></td>';
    echo '          <td align="center" bgcolor="#F2F2F2">';
    echo '          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
    echo '         	 <tr>';
    echo '            <td width="95%"> <b>' . TABLE_HEADING_COMMENTS . '</b><br><br></td>';
    echo '         	 </tr>';

    while ($orders_comments = tep_db_fetch_array($orders_status_history_query)) {
    // Not Null = Has Comments
    if (tep_not_null($orders_comments['comments'])) {
         $sInfo = new objectInfo($orders_comments);
         echo '         	 <tr>';
         echo '            <td align="center" width="95%">';
         echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
         echo '           	 <tr>';
         echo '              <td width="95%" class="smallText">';
         echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
         echo '             	 <tr>';
         echo '                <td width="150" align="left" valign="top" class="smallText"><strong><u>' . TABLE_HEADING_DATE_ADDED . '</u></strong></td>';
         echo '                <td align="left" valign="top" class="smallText"><strong><u>' . TABLE_HEADING_COMMENT_LEFT . '</u></strong></td>';
         echo '             	 </tr>';
         echo '              </table>';
         echo '              </td>';
         echo '           	 </tr>';
         echo '            </table>';
         echo '            </td>';
         echo '         	 </tr>';
         echo '         	 <tr>';
         echo '            <td align="center" width="95%">';
         echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
         echo '           	 <tr>';
         echo '              <td width="95%" class="smallText">';
         echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
         echo '             	 <tr>';
         echo '                <td width="150" align="left" valign="top" class="smallText">' . tep_date_short($sInfo->date_added) . '</td>';
         echo '                <td align="left" valign="top" class="smallText">' . nl2br(tep_db_output($orders_comments['comments'])) . '<br><br></td>';
   echo '             	 </tr>';
   echo '              </table>';
         echo '              </td>';
   echo '           	 </tr>';
         echo '            </table>';
         echo '            </td>';
         echo '         	 </tr>';
  //
  // If there are no Comments recorded...
  // This does not work because each time you update the order status and do NOT type in a comment, 
  // it adds a new order status history entry into the database with no comment. When this happens,
  // the below code prints out "No comments have been left for this order" for each of them.
  // It should only print that out once. Not for each order status history entry into the database
  // with no comment.
  //
  // If you know how to fix this, please post your update at
  // http://www.oscommerce.com/forums/index.php?showtopic=132562
  //
//     } else {
//          echo '         	 <tr>';
//          echo '            <td align="center" width="95%">';
//          echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
//          echo '           	 <tr>';
//          echo '              <td width="95%" class="smallText">';
//          echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
//          echo '             	 <tr>';
//          echo '                <td width="100%" align="left" valign="top" class="smallText">No comments have been left for this order</td>';
//          echo '             	 </tr>';
//          echo '              </table>';
//          echo '              </td>';
//          echo '           	 </tr>';
//          echo '            </table>';
//          echo '            </td>';
//          echo '         	 </tr>';
    }
    }
  echo '         	 <tr>';
  echo '            <td>' . tep_draw_separator('pixel_trans.gif', '1', '7') . '</td>';
  echo '         	 </tr>';
  echo '          </table>';
  echo '          </td>';
  echo '          <td background="../images/borders/maingrey_06.gif"><img src="../images/borders/maingrey_06.gif" width="19" height="21" alt=""></td>';
  echo '       	 </tr>';
  echo '       	 <tr>';
  echo '          <td><img src="../images/borders/maingrey_07.gif" width="11" height="18" alt=""></td>';
  echo '          <td background="../images/borders/maingrey_08.gif"><img src="../images/borders/maingrey_08.gif" width="24" height="18" alt=""></td>';
  echo '          <td><img src="../images/borders/maingrey_09.gif" width="19" height="18" alt=""></td>';
  echo '       	 </tr>';
  echo '        </table>';
  echo '        </td>';
  echo '     	 </tr>';
  echo '      </table>';
}
?>
<!-- ORDER COMMENTS CODE ENDS HERE //-->

 

 

 

I have also moved some stuff to the invoice.php language file AND updated the date to a short format (03/08/2005). I have also added headings above the date and comments as well.

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Update...

 

I haven't got around to updating the contribution as of yet, but here is the new invoice.php language file. Just copy it to the admin/includes/language/english/ folder.

 

I moved all the text type in admin/invoice.php into the admin/includes/language/english/invoice.php language file.

 

My next post will be the new changes...

 

<?php
/*
?$Id: invoice.php,v 1.6 2002/06/11 18:17:59 dgw_ Exp $

?osCommerce, Open Source E-Commerce Solutions
?http://www.oscommerce.com

?Copyright (c) 2002 osCommerce

?Released under the GNU General Public License
*/

// Misc Invoice Info
define('INVOICE_TEXT_CURRENT_YEAR', '05'); // Set this to the current year (2 digits only)
define('INVOICE_TEXT_NUMBER_SIGN', '#');
define('INVOICE_TEXT_DASH', '-');
define('INVOICE_TEXT_COLON', ':');

define('INVOICE_TEXT_INVOICE', 'Invoice');
define('INVOICE_TEXT_ORDER', 'Order');
define('INVOICE_TEXT_DATE_OF_ORDER', 'Date of Order');

// Customer Info
define('ENTRY_SOLD_TO', 'SOLD TO:');
define('ENTRY_SHIP_TO', 'SHIP TO:');
define('ENTRY_PAYMENT_METHOD', 'Payment Method:');

// Product Table Info Headings
define('TABLE_HEADING_PRODUCTS', 'Products');
define('TABLE_HEADING_PRODUCTS_MODEL', 'Model');
define('TABLE_HEADING_PRICE_EXCLUDING_TAX', 'Price (ex)');
define('TABLE_HEADING_PRICE_INCLUDING_TAX', 'Price (inc)');
define('TABLE_HEADING_TOTAL_EXCLUDING_TAX', 'Total (ex)');
define('TABLE_HEADING_TOTAL_INCLUDING_TAX', 'Total (inc)');
define('TABLE_HEADING_TAX', 'Tax');
define('TABLE_HEADING_UNIT_PRICE', 'Unit Price');
define('TABLE_HEADING_TOTAL', 'Total');

// Order Total Details Info
define('ENTRY_SUB_TOTAL', 'Sub-Total:');
define('ENTRY_SHIPPING', 'Shipping:');
define('ENTRY_TAX', 'Tax:');
define('ENTRY_TOTAL', 'Total:');

//Order Comments
define('TABLE_HEADING_COMMENTS', 'ORDER COMMENTS:');
define('TABLE_HEADING_DATE_ADDED', 'Date Added');
define('TABLE_HEADING_COMMENT_LEFT', 'Comment Left');
?>

Edited by PopTheTop

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Update...

 

These are most of the new changes to admin/invoice.php

 

<title><?php echo STORE_NAME; ?> <?php echo INVOICE_TEXT_INVOICE; ?> <?php echo INVOICE_TEXT_NUMBER_SIGN; ?><?php echo INVOICE_TEXT_CURRENT_YEAR; ?><?php echo INVOICE_TEXT_DASH; ?><?php echo $oID; ?></title>

 

 

 

	<tr>
  <td align="left"><img src="/images/pop-the-top4.png" border="0" width="166" height="54" alt=""></td>
  <TD ALIGN="right" VALIGN="top"><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong><?php echo INVOICE_TEXT_INVOICE; ?> <?php echo INVOICE_TEXT_NUMBER_SIGN; ?> <?php echo INVOICE_TEXT_CURRENT_YEAR; ?><?php echo INVOICE_TEXT_DASH; ?> <?php echo $oID; ?><BR><?php echo $date; ?></strong></font></TD>
</tr>

 

 

 

           <tr>
            <td width="10%"><hr size="2"></td>
            <td align="center" class="pageHeading"><em><b><?php echo INVOICE_TEXT_INVOICE; ?></b></em></td>
            <td width="100%"><hr size="2"></td>
          </tr>

 

 

 

                      <tr>
                       <td align="left" valign="top"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
                     </tr>

 

 

 

                      <tr>
                       <td align="left" valign="top"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
                     </tr>

 

 

 

                 <td align="center" bgcolor="#F2F2F2">
    	 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">
      	 <tr>
                <td width="33%"> <b><?php echo INVOICE_TEXT_ORDER; ?> <?php echo INVOICE_TEXT_NUMBER_SIGN; ?><?php echo INVOICE_TEXT_COLON; ?></b> <?php echo tep_db_input($oID); ?></td>
                <td width="33%"> <b><?php echo INVOICE_TEXT_DATE_OF_ORDER; ?><?php echo INVOICE_TEXT_COLON; ?> </b><?php echo tep_date_short($order->info['date_purchased']); ?></td>
                <td> <b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?></td>
             </tr>
               <tr>
              	 <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td>
               </tr>
    	 </table>
    	 </td>

 

 

 

       	 <tr class="dataTableHeadingRow">
           <td class="dataTableHeadingContent" colspan="2"><font color="#000000"><?php echo TABLE_HEADING_PRODUCTS; ?></font></td>
           <td WIDTH="80" class="dataTableHeadingContent"><font color="#000000"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></font></td>
           <td WIDTH="80" class="dataTableHeadingContent" align="right"><font color="#000000"><?php echo TABLE_HEADING_UNIT_PRICE; ?></font></td>
           <TD WIDTH="80" ALIGN="right" CLASS="dataTableHeadingContent"><font color="#000000"><?php echo TABLE_HEADING_TOTAL; ?></font></TD>
      	 </tr>
<?php
   for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

 

 

 

<!-- ORDER COMMENTS CODE STARTS HERE //-->
<?php 
$orders_status_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_status_history_query)) {
    echo '      <br><br>';
    echo '      <table width="100%" border="0" cellpadding="0" cellspacing="0">';
    echo '     	 <tr>';
    echo '        <td width="9"> </td>';
    echo '        <td>';
    echo '        <table width="100%" border="0" cellpadding="0" cellspacing="0">';
    echo '       	 <tr>';
    echo '          <td width="11"><img src="../images/borders/maingrey_01.gif" width="11" height="16" alt=""></td>';
    echo '          <td background="../images/borders/maingrey_02.gif"><img src="../images/borders/maingrey_02.gif" width="24" height="16" alt="" ></td>';
    echo '          <td width="19"><img src="../images/borders/maingrey_03.gif" width="19" height="16" alt=""></td>';
    echo '       	 </tr>';
    echo '       	 <tr>';
    echo '          <td background="../images/borders/maingrey_04.gif"><img src="../images/borders/maingrey_04.gif" width="11" height="21" alt=""></td>';
    echo '          <td align="center" bgcolor="#F2F2F2">';
    echo '          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
    echo '         	 <tr>';
    echo '            <td width="95%"> <b>' . TABLE_HEADING_COMMENTS . '</b><br><br></td>';
    echo '         	 </tr>';

    while ($orders_comments = tep_db_fetch_array($orders_status_history_query)) {
    // Not Null = Has Comments
    if (tep_not_null($orders_comments['comments'])) {
         $sInfo = new objectInfo($orders_comments);
         echo '         	 <tr>';
         echo '            <td align="center" width="95%">';
         echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
         echo '           	 <tr>';
         echo '              <td width="95%" class="smallText">';
         echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
         echo '             	 <tr>';
         echo '                <td width="150" align="left" valign="top" class="smallText"><strong><u>' . TABLE_HEADING_DATE_ADDED . '</u></strong></td>';
         echo '                <td align="left" valign="top" class="smallText"><strong><u>' . TABLE_HEADING_COMMENT_LEFT . '</u></strong></td>';
         echo '             	 </tr>';
         echo '              </table>';
         echo '              </td>';
         echo '           	 </tr>';
         echo '            </table>';
         echo '            </td>';
         echo '         	 </tr>';
         echo '         	 <tr>';
         echo '            <td align="center" width="95%">';
         echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
         echo '           	 <tr>';
         echo '              <td width="95%" class="smallText">';
         echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
         echo '             	 <tr>';
         echo '                <td width="150" align="left" valign="top" class="smallText">' . tep_date_short($sInfo->date_added) . '</td>';
         echo '                <td align="left" valign="top" class="smallText">' . nl2br(tep_db_output($orders_comments['comments'])) . '<br><br></td>';
   echo '             	 </tr>';
   echo '              </table>';
         echo '              </td>';
   echo '           	 </tr>';
         echo '            </table>';
         echo '            </td>';
         echo '         	 </tr>';
  //
  // If there are no Comments recorded...
  // This does not work because each time you update the order status and do NOT type in a comment, 
  // it adds a new order status history entry into the database with no comment. When this happens,
  // the below code prints out "No comments have been left for this order" for each of them.
  // It should only print that out once. Not for each order status history entry into the database
  // with no comment.
  //
  // If you know how to fix this, please post your update at
  // http://www.oscommerce.com/forums/index.php?showtopic=132562
  //
//     } else {
//          echo '         	 <tr>';
//          echo '            <td align="center" width="95%">';
//          echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
//          echo '           	 <tr>';
//          echo '              <td width="95%" class="smallText">';
//          echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
//          echo '             	 <tr>';
//          echo '                <td width="100%" align="left" valign="top" class="smallText">No comments have been left for this order</td>';
//          echo '             	 </tr>';
//          echo '              </table>';
//          echo '              </td>';
//          echo '           	 </tr>';
//          echo '            </table>';
//          echo '            </td>';
//          echo '         	 </tr>';
    }
    }
  echo '         	 <tr>';
  echo '            <td>' . tep_draw_separator('pixel_trans.gif', '1', '7') . '</td>';
  echo '         	 </tr>';
  echo '          </table>';
  echo '          </td>';
  echo '          <td background="../images/borders/maingrey_06.gif"><img src="../images/borders/maingrey_06.gif" width="19" height="21" alt=""></td>';
  echo '       	 </tr>';
  echo '       	 <tr>';
  echo '          <td><img src="../images/borders/maingrey_07.gif" width="11" height="18" alt=""></td>';
  echo '          <td background="../images/borders/maingrey_08.gif"><img src="../images/borders/maingrey_08.gif" width="24" height="18" alt=""></td>';
  echo '          <td><img src="../images/borders/maingrey_09.gif" width="19" height="18" alt=""></td>';
  echo '       	 </tr>';
  echo '        </table>';
  echo '        </td>';
  echo '     	 </tr>';
  echo '      </table>';
}
?>
<!-- ORDER COMMENTS CODE ENDS HERE //-->

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Hi,

 

for the problem of the comment and the change status, you need to modify this part of order.php.

i don't have done this yet, but you need to take the old comment, put it in the box.

Then you cant suppress, add or change this comment and the database will be updated correctly.

It could be a bug in this file.

 

Enjoy,

 

Big

Link to comment
Share on other sites

Hi,

 

for the problem of the comment and the change status, you need to modify this part of order.php.

i don't have done this yet, but you need to take the old comment, put it in the box.

Then you cant suppress, add or change this comment and the database will be updated correctly.

It could be a bug in this file.

 

Enjoy,

 

Big

 

 

I really do not understand what you mean here???

 

We do have the comments in a box at the bottom. Take a look at my copy of the invoice.php file above. It works just fine. The problem is within the invoice.php file, not order.php and it really is not a problem at all.

 

I just wanted to add something that states "There are no comments for this order" if there is no comments. What it is doing is pulling the blank comments from that TABLE for each order status change.

 

I thought that it would be easy to add some sort of "if" statement to do that IF the comments were all blank, no matter what the status was. But I am new so I do not know how to do this.

 

I will be editing the order.php file though in due time to add the name of the person who entered the status change or comments so that it will print the name in the comments next to the date the comments were entered.

 

Right now, I will be focusing on updating the customer's account so that their invoices will look like the admin invoices.

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

I just wanted to add something that states "There are no comments for this order" if there is no comments. What it is doing is pulling the blank comments from that TABLE for each order status change.

 

I thought that it would be easy to add some sort of "if" statement to do that IF the comments were all blank, no matter what the status was. But I am new so I do not know how to do this.

 

 

I think it is because you are using "while" which will process the following code until there are no more rows. Maybe put the "else" AFTER the end of the while statement??

 

Also, I asked this before (I think) but I will ask again ... Do you know what the code would look like if I wanted to pull some info from the database (something I would add and pull to be displayed in the invoice)? If so please give me an example.

 

Craig

Link to comment
Share on other sites

I think it is because you are using "while" which will process the following code until there are no more rows. Maybe put the "else" AFTER the end of the while statement??

 

 

I tried that is I get an error that the "else" does not belong in or as a part of the "while".

 

I did add this UNDER the last bracket for the "while"...

     if (!tep_not_null($orders_comments['comments'])) {
         echo '         	 <tr>';
         echo '            <td align="center" width="95%">';
         echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
         echo '           	 <tr>';
         echo '              <td width="95%" class="smallText">';
         echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
         echo '             	 <tr>';
         echo '                <td width="100%" align="left" valign="top" class="smallText">No comments have been left for this order</td>';
         echo '             	 </tr>';
         echo '              </table>';
         echo '              </td>';
         echo '           	 </tr>';
         echo '            </table>';
         echo '            </td>';
         echo '         	 </tr>';
    }

 

 

And it worked if there were no comments or all the comments were blank. But if you have entered any comments and still have a blank one (like when an order status is updated) it displays all the comments and then at the bottom, it displays that "No comments have been left for this order" under all the comments.

 

 

 

Also, I asked this before (I think) but I will ask again ... Do you know what the code would look like if I wanted to pull some info from the database (something I would add and pull to be displayed in the invoice)? If so please give me an example.

 

Not really, but if you look at other queries in the code, you will see how.

 

Example:

$banner_query = tep_db_query("select banners_image from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'");

$banner = tep_db_fetch_array($banner_query);

 

1) This queries the TABLE "banners"

2) Then it calls for the value of "banners_image" in that TABLE for that "$banners_id".

3) Then where ever you put "$banner['banners_image']" in your code, it will call that value, which in this case, the banner image file name.

 

...I think

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

I tried that is I get an error that the "else" does not belong in or as a part of the "while".

 

I did add this UNDER the last bracket for the "while"...

     if (!tep_not_null($orders_comments['comments'])) {
         echo '         	 <tr>';
         echo '            <td align="center" width="95%">';
         echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
         echo '           	 <tr>';
         echo '              <td width="95%" class="smallText">';
         echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
         echo '             	 <tr>';
         echo '                <td width="100%" align="left" valign="top" class="smallText">No comments have been left for this order</td>';
         echo '             	 </tr>';
         echo '              </table>';
         echo '              </td>';
         echo '           	 </tr>';
         echo '            </table>';
         echo '            </td>';
         echo '         	 </tr>';
    }

And it worked if there were no comments or all the comments were blank. But if you have entered any comments and still have a blank one (like when an order status is updated) it displays all the comments and then at the bottom, it displays that "No comments have been left for this order" under all the comments.

 

 

Hello Scott,

 

I haven't had time to update your latest version to the multilanguage branche but I just read the no-comments problem and I think you can solve it easily this way:

<!-- ORDER COMMENTS CODE STARTS HERE //-->
<?php
$orders_status_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_status_history_query)) {
 $has_comments = false;
....
....

Add a variable $has_comments (or whatever name) initially set to false when you have checked there is an order status history.

then

     while ($orders_comments = tep_db_fetch_array($orders_status_history_query)) {
    if (tep_not_null($orders_comments['comments'])) {
      $has_comments = true;

set this variable to true when you find order comments. This new variable will stay false if all comments are empty so you can check this after the WHILE loop and print the no-comments part when it applies.

     if ($has_comments == false) {
 echo '           <tr>';
 echo '            <td align="center" width="95%">';
 echo '            <table width="95%" border="0" cellpadding="0" cellspacing="0">';
 echo '             <tr>';
 echo '              <td width="95%" class="smallText">';
 echo '              <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">';
 echo '               <tr>';
 echo '                <td width="100%" align="left" valign="top" class="smallText">No comments have been left for this order</td>';
 echo '               </tr>';
 echo '              </table>';
 echo '              </td>';
 echo '             </tr>';
 echo '            </table>';
 echo '            </td>';
 echo '           </tr>';
   }

 

If there are comments they will be printed and the no-comments part is skipped.

I hope I understood correctly what you meant ?!

 

Regards,

Howard

Link to comment
Share on other sites

Scott,

 

Awesome Contribution!

 

I have been looking for an invoice that looked a bit more professional and showed the invoice and order number. PERFECT! NICE JOB!

 

vr,

Adirondack Nutrition.com

Link to comment
Share on other sites

I haven't had time to update your latest version to the multilanguage branche but I just read the no-comments problem and I think you can solve it easily this way:

 

Regards,

Howard

 

Howard, your the greatest! That did the trick and now I've just learned one more lesson when it comes to PHP.

 

I will have the new update uploaded today!

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Ok, version 2.0 has now been released and uploaded to http://www.oscommerce.com/community/contributions,2861

 

Enjoy!

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Sorry about this. I would like to make the text match my site but I don't see a dataTableContent class in my css file. I need to change this to

 

font-family: Verdana, Arial, sans-serif;

font-size: 12px;

 

should I add this class to the css file or to the packingslip file. Can you please explain (with code how to do this?) thanks

 

Elizabeth

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