Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products Location add-on


Jet200

Recommended Posts

Hi there - I was excited to see this contribution but am having some trouble getting the location to display correctly on my modified packing slip. I use a table layout with seperate columns for qty, description, model#, and now location. Using your code changes, my packing slip stuffs everything into one small column and will only display the first character of the location number. For instance, if the location is AAA-33, all that will display is (LA) after the model number.

 

Here's the contribution: http://addons.oscommerce.com/info/6335

 

Here's my code portion for the packing slip in question:

  <tr>
  <TD COLSPAN="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
  </tr>
  <tr>
     <TD COLSPAN="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    </tr>
    <tr>
  <TD COLSPAN="3">
  <table border="0" width="100%" cellspacing="0" cellpadding="2">
       <tr class="dataTableHeadingRow">
          <td class="dataTableHeadingContent" colspan="1"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
         <td WIDTH="180" class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
          <td WIDTH="80" class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_LOCATION; ?></td>
       </tr>
<?php
  for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
   echo '      <tr class="dataTableRow">' . "\n" .
        '        <td class="dataTableContent" valign="top" align="left">' . $order->products[$i]['qty'] . ' x '. $order->products[$i]['name'] ;

    if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
      for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) {
        echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
        echo '</i></small></nobr>';
      }
    }

    echo '          </td>' . "\n" .
         '          <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
         '         </tr>' . "\n";
  }
?>
      </table>
  </td>
      </tr>
   </table>
</td>
</tr>
</table>
<!-- body_text_eof //-->
<P> </P>
<P> </P>
<CENTER><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong><?php echo STORE_NAME; ?><BR><?php echo STORE_URL_ADDRESS; ?></strong></font></CENTER>
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

It looks like you are missing some code - According to the instructions:

 

#######################################################

in admin/packingslip.php

#######################################################

 

***FIND***:

<?php
   for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
     echo '      <tr class="dataTableRow">' . "\n" .
          '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

     if (sizeof($order->products[$i]['attributes']) > 0) {
       for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
         echo '</i></small></nobr>';
       }
     }

     echo '        </td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
          '      </tr>' . "\n";
   }
?>

 

***CHANGE TO***:

<?php

   for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

$product_query = tep_db_query("select products_locate from " .  TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $order->products[$i]['id'] . "'");

$info_product = tep_db_fetch_array($product_query);

$hold_locate = '';

if ($info_product['products_locate']){$hold_locate = ' L(' . $info_product['products_locate'] . ')';}

     echo '      <tr class="dataTableRow">' . "\n" .
          '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

     if (sizeof($order->products[$i]['attributes']) > 0) {
       for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
         echo '</i></small></nobr>';
       }
     }

     echo '        </td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . $hold_locate . '</td>' . "\n" .
          '      </tr>' . "\n";
   }
?>

Link to comment
Share on other sites

Sorry - that is my current code. When replaced as in the instructions I get the problem described above - everything jammed into one narrow column with the location only dislaying one character (beyond the "(L that proceeds the location number).

 

The way I have it now - everything is still aligned in columns but I cannot get the Location to display nor can I get it to display more characters.

Link to comment
Share on other sites

<?php
/*
$Id: packingslip.php,v 6.1 2005/06/05 00:37:30 PopTheTop Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

include(DIR_WS_CLASSES . 'order.php');
$order = new order($oID);
$date = date('d M, Y');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo STORE_NAME; ?> <?php echo TITLE_PACKING; ?> <?php// echo date("y"); ?><?php echo $oID; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- body_text //-->

<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
     <TD ALIGN="left" VALIGN="top"><span class="pageHeadingSM"><FONT FACE="Verdana" SIZE="1" COLOR="#006699"><strong><?php echo nl2br(STORE_NAME_ADDRESS); ?></strong></font></span><br><br><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong><?php echo INVOICE_TEXT_INVOICE_NR; ?> <?php// echo INVOICE_TEXT_NUMBER_SIGN; ?> <?php// echo date("y"); ?><?php// echo INVOICE_TEXT_DASH; ?> <?php echo $oID; ?><BR><?php echo ORDER_DATE; ?><?php echo tep_date_short($order->info['date_purchased']); ?></strong></font></TD>
   <td style="padding: 10px 10px 0px 0px; vertical-align: top;" align="right"><?php echo '<input type="image" src="' . INVOICE_IMAGE . '" width="' . INVOICE_IMAGE_WIDTH . '" height="' . INVOICE_IMAGE_HEIGHT . '" " alt="' . INVOICE_IMAGE_ALT_TEXT . '" onClick="javascript:ShowHide(\'comments_open\',\'comments_close\');">'; ?></td>
 </tr>
<tr>
  <td colspan="2">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
  <TD>
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
    <td colspan="4">
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td width="10%"><hr size="2"></td>
           <td align="center" nowrap class="pageHeading"><em><b><?php echo TITLE_PACKING; ?></b></em></td>
           <td width="100%"><hr size="2"></td>
         </tr>
        </table>
        </td>
     </tr>
     <tr>
      <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100', '5'); ?></td>
     </tr>
       <tr>
            <td width="3"> </td>
        <td valign="top">
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td>
                <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt="" ></td>
                <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td>
              </tr>
              <tr>
                <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td>
                <td align="center" style="background-color: white;">
       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="main">
                    <tr>
                      <td align="left" valign="top"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>    '); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo $order->customer['telephone']; ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo $order->customer['email_address']; ?></td>
                    </tr>
                    <tr>
                      <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td>
                    </tr>
                  </table>
      </td>
                <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td>
              </tr>
              <tr>
                <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td>
                <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td>
                <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td>
              </tr>
          </table>
          </td>
            <td width="45"> </td>
          <td valign="top">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td>
                <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt=""></td>
                <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td>
              </tr>
              <tr>
                <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td>
                <td align="center" bgcolor="#FFFFFF">
       <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">
                    <tr>
                      <td align="left" valign="top"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>    '); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
                    </tr>
                    <tr>
                      <td>    </td>
                    </tr>
                    <tr>
                      <td>    </td>
                    </tr>
                    <tr>
                      <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td>
                    </tr>
       </table>
      </td>
                <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td>
              </tr>
              <tr>
                <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td>
                <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td>
                <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td>
              </tr>
            </table>
          </td>
       </tr>
     </table>
   </TD>
  </tr>
  <tr>
  <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15'); ?></td>
  </tr>
  <tr>
  <TD COLSPAN="2">
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="9"> </td>
              <td>
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
           <tr>
               <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td>
               <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt="" ></td>
               <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td>
           </tr>
           <tr>
               <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td>
               <td align="center" style="background-color: white;">
     <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">
       <tr>
               <td width="33%"> <b><?php echo ORDER_NUMBER; ?></b> <?php echo tep_db_input($oID); ?></td>
               <td width="33%"> <b><?php echo ORDER_DATE; ?> </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>
            <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td>
           </tr>
           <tr>
            <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td>
            <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td>
            <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td>
           </tr>
        </table>

              </td>
          </tr>
          </table>
  </td>
  </tr>
  <tr>
  <TD COLSPAN="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
  </tr>
  <tr>
     <TD COLSPAN="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    </tr>
    <tr>
  <TD COLSPAN="3">
  <table border="0" width="100%" cellspacing="0" cellpadding="2">
       <tr class="dataTableHeadingRow">
          <td class="dataTableHeadingContent" colspan="1"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
         <td WIDTH="80" class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
          <td WIDTH="80" class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_LOCATION; ?></td>
       </tr>
<?php
  for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
   echo '      <tr class="dataTableRow">' . "\n" .
        '        <td class="dataTableContent" valign="top" align="left">' . $order->products[$i]['qty'] . ' x'. $order->products[$i]['name'] ;

    if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
      for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) {
        echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
        echo '</i></small></nobr>';
      }
    }

    echo '          </td>' . "\n" .
         '          <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .
         '         </tr>' . "\n";
  }
?>
      </table>
  </td>
      </tr>
   </table>
</td>
</tr>
</table>
<!-- body_text_eof //-->
<P> </P>
<P> </P>
<CENTER><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong><?php echo STORE_NAME; ?><BR><?php echo STORE_URL_ADDRESS; ?></strong></font></CENTER>
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

I explained that I added those things. I've gone back to the original code with your add-ons as specified. (screen shot below)

<?php
/*
$Id: packingslip.php,v 6.1 2005/06/05 00:37:30 PopTheTop Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

include(DIR_WS_CLASSES . 'order.php');
$order = new order($oID);
$date = date('d M, Y');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo STORE_NAME; ?> <?php echo TITLE_PACKING; ?> <?php// echo date("y"); ?><?php echo $oID; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- body_text //-->

<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
     <TD ALIGN="left" VALIGN="top"><span class="pageHeadingSM"><FONT FACE="Verdana" SIZE="1" COLOR="#006699"><strong><?php echo nl2br(STORE_NAME_ADDRESS); ?></strong></font></span><br><br><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong><?php echo INVOICE_TEXT_INVOICE_NR; ?> <?php// echo INVOICE_TEXT_NUMBER_SIGN; ?> <?php// echo date("y"); ?><?php// echo INVOICE_TEXT_DASH; ?> <?php echo $oID; ?><BR><?php echo ORDER_DATE; ?><?php echo tep_date_short($order->info['date_purchased']); ?></strong></font></TD>
   <td style="padding: 10px 10px 0px 0px; vertical-align: top;" align="right"><?php echo '<input type="image" src="' . INVOICE_IMAGE . '" width="' . INVOICE_IMAGE_WIDTH . '" height="' . INVOICE_IMAGE_HEIGHT . '" " alt="' . INVOICE_IMAGE_ALT_TEXT . '" onClick="javascript:ShowHide(\'comments_open\',\'comments_close\');">'; ?></td>
 </tr>
<tr>
  <td colspan="2">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
  <TD>
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr>
    <td colspan="4">
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td width="10%"><hr size="2"></td>
           <td align="center" nowrap class="pageHeading"><em><b><?php echo TITLE_PACKING; ?></b></em></td>
           <td width="100%"><hr size="2"></td>
         </tr>
        </table>
        </td>
     </tr>
     <tr>
      <td colspan="4"><?php echo tep_draw_separator('pixel_trans.gif', '100', '5'); ?></td>
     </tr>
       <tr>
            <td width="3"> </td>
        <td valign="top">
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td>
                <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt="" ></td>
                <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td>
              </tr>
              <tr>
                <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td>
                <td align="center" style="background-color: white;">
       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="main">
                    <tr>
                      <td align="left" valign="top"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>    '); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo $order->customer['telephone']; ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo $order->customer['email_address']; ?></td>
                    </tr>
                    <tr>
                      <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td>
                    </tr>
                  </table>
      </td>
                <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td>
              </tr>
              <tr>
                <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td>
                <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td>
                <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td>
              </tr>
          </table>
          </td>
            <td width="45"> </td>
          <td valign="top">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td>
                <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt=""></td>
                <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td>
              </tr>
              <tr>
                <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td>
                <td align="center" bgcolor="#FFFFFF">
       <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">
                    <tr>
                      <td align="left" valign="top"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>    '); ?></td>
                    </tr>
                    <tr>
                      <td>    <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
                    </tr>
                    <tr>
                      <td>    </td>
                    </tr>
                    <tr>
                      <td>    </td>
                    </tr>
                    <tr>
                      <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '7'); ?></td>
                    </tr>
       </table>
      </td>
                <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td>
              </tr>
              <tr>
                <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td>
                <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td>
                <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td>
              </tr>
            </table>
          </td>
       </tr>
     </table>
   </TD>
  </tr>
  <tr>
  <TD COLSPAN="2"><?php echo tep_draw_separator('pixel_trans.gif', '100', '15'); ?></td>
  </tr>
  <tr>
  <TD COLSPAN="2">
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="9"> </td>
              <td>
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
           <tr>
               <td width="11"><img src="../images/borders/mainwhite_01.gif" width="11" height="16" alt=""></td>
               <td background="../images/borders/mainwhite_02.gif"><img src="../images/borders/mainwhite_02.gif" width="24" height="16" alt="" ></td>
               <td width="19"><img src="../images/borders/mainwhite_03.gif" width="19" height="16" alt=""></td>
           </tr>
           <tr>
               <td background="../images/borders/mainwhite_04.gif"><img src="../images/borders/mainwhite_04.gif" width="11" height="21" alt=""></td>
               <td align="center" style="background-color: white;">
     <table width="100%" border="0" cellpadding="0" cellspacing="0" class="main">
       <tr>
               <td width="33%"> <b><?php echo ORDER_NUMBER; ?></b> <?php echo tep_db_input($oID); ?></td>
               <td width="33%"> <b><?php echo ORDER_DATE; ?> </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>
            <td background="../images/borders/mainwhite_06.gif"><img src="../images/borders/mainwhite_06.gif" width="19" height="21" alt=""></td>
           </tr>
           <tr>
            <td><img src="../images/borders/mainwhite_07.gif" width="11" height="18" alt=""></td>
            <td background="../images/borders/mainwhite_08.gif"><img src="../images/borders/mainwhite_08.gif" width="24" height="18" alt=""></td>
            <td><img src="../images/borders/mainwhite_09.gif" width="19" height="18" alt=""></td>
           </tr>
        </table>

              </td>
          </tr>
          </table>
  </td>
  </tr>
  <tr>
  <TD COLSPAN="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
  </tr>
  <tr>
     <TD COLSPAN="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
    </tr>
    <tr>
  <TD COLSPAN="3">
  <table border="0" width="100%" cellspacing="0" cellpadding="2">
       <tr class="dataTableHeadingRow">
          <td class="dataTableHeadingContent" colspan="1"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
         <td WIDTH="80" class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

       </tr>
<?php



   for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {



$product_query = tep_db_query("select products_locate from " .  TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $order->products[$i]['id'] . "'");



$info_product = tep_db_fetch_array($product_query);



$hold_locate = '';



if ($info_product['products_locate']){$hold_locate = ' L(' . $info_product['products_locate'] . ')';}



     echo '      <tr class="dataTableRow">' . "\n" .

          '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];



     if (sizeof($order->products[$i]['attributes']) > 0) {

       for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {

         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];

         echo '</i></small></nobr>';

       }

     }



     echo '        </td>' . "\n" .

          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . $hold_locate . '</td>' . "\n" .

          '      </tr>' . "\n";

   }

?>
      </table>
  </td>
      </tr>
   </table>
</td>
</tr>
</table>
<!-- body_text_eof //-->
<P> </P>
<P> </P>
<CENTER><FONT FACE="Verdana" SIZE="2" COLOR="#006699"><strong><?php echo STORE_NAME; ?><BR><?php echo STORE_URL_ADDRESS; ?></strong></font></CENTER>
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

packingslip.gif

 

This is exactly how it looked when I first installed your code. Two issues - 1. Only one character of the location number is displaying (see where it shows L(A) after the product number). 2. I can't figure out how to restore the columns correctly.

 

I then tried to bust out the location number into it's own column which is the code you saw above. Either one will work for me, I just need to get this to display the entire location number.

 

Thanks

Edited by Jet200
Link to comment
Share on other sites

Your packing slip has been modified, it appears you have an extra or missing HTML tag. The column issue is a HTML issue. Our updated code does not change the HTML code.

 

On the issue of not showing the full text of the location, it appears that either your code is limiting the input (check your table to see if it is) or the code is limiting the output. This is something you will need to address since the code I supplied does not limit the text.

 

Here is a copy of a working standard packingslip.php file.

 

<?php
/*
 $Id: packingslip.php 1739 2007-12-20 00:52:16Z hpdl $

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

 Copyright (c) 2007 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
 $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 include(DIR_WS_CLASSES . 'order.php');
 $order = new order($oID);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- body_text //-->
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
   <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
       <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . 'store_logo.png', STORE_NAME); ?></td>
     </tr>
   </table></td>
 </tr>
 <tr>
   <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
     <tr>
       <td colspan="2"><?php echo tep_draw_separator(); ?></td>
     </tr>
     <tr>
       <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo ENTRY_SOLD_TO; ?></b></td>
         </tr>
         <tr>
           <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->billing, 1, '', '<br>'); ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo $order->customer['telephone']; ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
         </tr>
       </table></td>
       <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo ENTRY_SHIP_TO; ?></b></td>
         </tr>
         <tr>
           <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>
         </tr>
       </table></td>
     </tr>
   </table></td>
 </tr>
 <tr>
   <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 </tr>
 <tr>
   <td><table border="0" cellspacing="0" cellpadding="2">
     <tr>
       <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
       <td class="main"><?php echo $order->info['payment_method']; ?></td>
     </tr>
   </table></td>
 </tr>
 <tr>
   <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
 </tr>
 <tr>
   <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
     <tr class="dataTableHeadingRow">
       <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
       <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
     </tr>
<?php

   for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {

$product_query = tep_db_query("select products_locate from " .  TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $order->products[$i]['id'] . "'");

$info_product = tep_db_fetch_array($product_query);

$hold_locate = '';

if ($info_product['products_locate']){$hold_locate = ' L(' . $info_product['products_locate'] . ')';}

     echo '      <tr class="dataTableRow">' . "\n" .
          '        <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['name'] .' Products ID = '. $order->products[$i]['id'];

     if (sizeof($order->products[$i]['attributes']) > 0) {
       for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
         echo '</i></small></nobr>';
       }
     }

     echo '        </td>' . "\n" .
          '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . ' order id='. (int)$oID . $hold_locate . '</td>' . "\n" .
          '      </tr>' . "\n";
   }
?>
   </table></td>
 </tr>
</table>
<!-- body_text_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

The first place to look is your table

 

It may not have been setup with the needed space. I set it up as

ALTER TABLE products_description ADD products_locate VARCHAR(30);

 

That would give you 30 spaces.

 

What does your table give to products_locate?

Link to comment
Share on other sites

table:products_description

 

products_id int(11)

language_id int(11)

products_name varchar(64)

products_url varchar(255)

products_viewed int(5)

products_locate varchar(30)

 

 

it lets me enter however many i want, but only stores the first character in the db

Edited by Jet200
Link to comment
Share on other sites

It only displays the first character. If I then go into the db and edit, it will display the full number. For some reason it's only capturing that first character when entered on the categories page.

Link to comment
Share on other sites

After some searching, the problem is due to you using 3 languages. The quick fix (for english) is below.

 

In admin/categories.php

 

remove this code:

         <tr>
  <td class="main"><?php echo TEXT_PRODUCTS_LOCATE; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_locate', $pInfo->products_locate); ?></td></tr>
         <tr>

 

 

***FIND***:

         <tr>
           <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
           <td><table border="0" cellspacing="0" cellpadding="0">
             <tr>
               <td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>
               <td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

             </tr>
           </table></td>
         </tr>

 

***ADD JUST BELOW IT *** but above the (<?php } ?>) *** this code:


   <!-- bof locate -->
         <tr>
           <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_LOCATE; ?></td>
           <td><table border="0" cellspacing="0" cellpadding="0">
             <tr>
               <td class="main" valign="top"><?php if ($i == 0) echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?> </td>
               <td class="main"><?php if ($i == 0) echo tep_draw_input_field('products_locate[' . $languages[$i]['id'] . ']', (isset($products_locate[$languages[$i]['id']]) ? $products_locate[$languages[$i]['id']] : tep_get_location($pInfo->products_id, $languages[$i]['id']))); ?></td>

             </tr>
           </table></td>
         </tr>    
   <!-- eof locate -->

Link to comment
Share on other sites

  • 1 year later...

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