Zen Cart Logo
Forums / Managing Customers and Orders / Adding additoinal information to cart/order/packing slip

Adding additoinal information to cart/order/packing slip

Locked

Views: 3,512

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
8 Jun 2006, 6:43 PM
#1
talib avatar

talib

New Zenner

Join Date:
May 2006
Posts:
17
Plugin Contributions:
0

Adding additoinal information to cart/order/packing slip

Hi

Been reading through this forum and can't find any help. I have the situation where two different products can have the same name, yet are in different categories.

Now my dillema is that on the shopping cart and order and packing slip only the name appears and not the category which it came from. So far it looks like I need to edit templates. I am however not sure how to go about it, can someone please help me.

I am also not versed in PHP.

Thanks for any help

PS Even just displaying the product ID would be a great help, though the category would be better.

8 Jun 2006, 8:26 PM
#2
talib avatar

talib

New Zenner

Join Date:
May 2006
Posts:
17
Plugin Contributions:
0

Re: Adding additoinal information to cart/order/packing slip

Ok, I found the files I am suppose to edit:

admin/invoice.php
admin/packingslip.php
includes/templates/MYTEMPLATE/templates/tpl_shopping_cart_default.php (using override)

Ok so I tried this in invoice.php:

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

yet to no avail, then I tried this:

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

which resulted in the name being printed twice at the right place, so I am on the right track. Why is 'id' not working?

11 Jul 2006, 3:30 PM
#3
jeniczek avatar

jeniczek

New Zenner

Join Date:
Jul 2006
Posts:
6
Plugin Contributions:
0

Re: Adding additoinal information to cart/order/packing slip

bump for ANY answer, I got the same problem...

19 Jul 2006, 10:49 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding additoinal information to cart/order/packing slip

What version of Zen Cart?

20 Jul 2006, 5:24 PM
#5
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: Adding additoinal information to cart/order/packing slip

peep!

I'm looking to add info to invoice.php too. Version 1.3.0.2.

I'm using a purchase order modification and I want to add fields from table_order: account_name, account_number, po_number.

(It would also be nice to include the customer comments, not sure where those are stored. Sometimes the customer has notes about delivery.)

---Diana

20 Jul 2006, 7:26 PM
#6
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: Adding additoinal information to cart/order/packing slip

I figured this out myself, woohoo! Crude, but it works.

in admin/invoice.php line 64

I inserted:

<?php
      $order_check = $db->Execute("select ... account_name, account_number, 
po_number, ... from " . TABLE_ORDERS . "
                             where orders_id = '" . (int)$oID . "'");

and farther down, around line 132, I added a column to the embedded table,

<table border="0" cellspacing="0" cellpadding="2">
   <tr>
      <td class="main"><strong><?php echo ENTRY_DATE_PURCHASED; 
?></strong></td>
      <td class="main"><?php echo zen_date_long($order->info['date_purchased']); ?></td>
      <td class="main"> </td>
    </tr>
    <tr>
       <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
       <td class="main"><?php echo $order->info['payment_method']; ?></td>
       <td class="main">
		
	<?php
// purchaseorder start
	if( (($order->info['account_name']) || ($order->info['account_number']) || 
($order->info['po_number'])) ) {
		  ?>
	 <div><?php echo 'Account: ' . $order->info['account_name']; ?></div>
	 <div><?php echo 'Account number: ' . $order->info['account_number']; ?></div>
	 <div><?php echo 'PO number: ' . $order->info['po_number']; ?></div>
<?php		  
// purchaseorder end
		      }?>
      </td></tr>
    </table>

I will apply the equivalent modification to packingslip.php.

Perhaps this info will help someone else.

The one thing I still don't know, where are customer comments saved in the database (if anywhere) and is there a way to display them on the invoice and packing slip.

---Diana (now an intermediate zen user?)

23 Jul 2006, 3:30 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding additoinal information to cart/order/packing slip

The order comments are stored in the orders_status_history table as the first record for that particular order.

You could retrieve the data like this:

    $orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments
                                    from " . TABLE_ORDERS_STATUS_HISTORY . "
                                    where orders_id = '" . zen_db_input($oID) . "'
                                    order by date_added limit 1");
24 Jul 2006, 2:58 PM
#8
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: Adding additoinal information to cart/order/packing slip

Thank you Dr. Byte!

I added your code above after the $order_check statement.
Then after

<td class="main"><?php echo 
zen_date_long($order->info['date_purchased']); ?></td>

I added:

<td class="main"><?php echo '<b>Customer comments: </b>' . 
$order->info['comments']; ?></td>

but I'm not getting any output on the invoice other than "Customer comments:"

Note that the word "Comments" now appears on the right sidebar detail view of the order in Admin > Customers > Orders.

So, it looks like the code is extracting the name of the field, not its contents?

Suggestions?

24 Jul 2006, 11:10 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Adding additoinal information to cart/order/packing slip

Change$order->info['comments'];to```
$orders_history->fields['comments'];

25 Jul 2006, 5:16 PM
#10
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: Adding additoinal information to cart/order/packing slip

SMOOOCHIES! :wub:

Works like a dream.

---Diana

10 Feb 2007, 9:20 PM
#11
taipa avatar

taipa

New Zenner

Join Date:
Nov 2005
Posts:
54
Plugin Contributions:
0

Re: Adding additoinal information to cart/order/packing slip

Does this work with version 1.3.6? I'd like to display customer comments on the invoices too!

I added to admin/invoice.php at line 87:

<?php $orders_history = $db->Execute("select orders_status_id, date_added, customer_notified, comments
                                    from " . TABLE_ORDERS_STATUS_HISTORY . "
                                    where orders_id = '" . zen_db_input($oID) . "'
                                    order by date_added limit 1");  ?>

and then at line 208:

<td class="main"><?php echo '<b>Customer comments: </b>' . $orders_history->fields['comments']; ?></td>
    </table></td>

But all that appears on my invoice is Customer Comments:, and the actual comment is not displayed.
Did I just make a dumb error with the code, or does the code above only work for 1.3.0?

12 Feb 2007, 8:09 PM
#12
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: Adding additoinal information to cart/order/packing slip

Hi.

I'm using 1.3.6.

You don't neet those <?php ... ?> brackets around the code, they are already present in the preceding and following code. I compared your code to my code for that edit and they are otherwise the same. My invoices are displaying comments.

I handled the presentation of comments differently:

at line 140:

<td class="main"><?php echo '<b>Customer comments: </b>' . $orders_history->fields['comments']; ?></td>

If you're adding an extra cell you need to make sure your ENTRY_DATE_PURCHASED table is still correct. I added an extra column to that table, IIRC.

If you're adding comments at the bottom of the invoice table, you probably need to add an extra row, or you'll have an invalid table. You're familiar with HTML markup for tables?

---Diana