Zen Cart Logo
Forums / General Questions / Number of Orders - shown on Invoice

Number of Orders - shown on Invoice

Views: 861

Results 1 to 7 of 7
3 Jan 2013, 1:44 PM
#1
farrel avatar

farrel

New Zenner

Join Date:
Nov 2012
Posts:
28
Plugin Contributions:
0

Number of Orders - shown on Invoice

Hi
Happy New Year.
Could anyone help me get the "number of orders" information (as seen when looking at admin - customers) printed on the invoices.

This would be very useful for packing order e.g.: if first order then include full brochure etc.

Ideal way would be a suffix to order number: e.g instead of 1234 it could be 1234-3 for third order from customer etc.

Thanks

4 Jan 2013, 3:37 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Number of Orders - shown on Invoice

You could customize the file:
/your_secret_admin/invoice.php

with the code in RED:

      <tr>
        <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
        <td class="main"><?php echo $order->info['payment_method']; ?></td>
      </tr>
[B]<?php
// bof: number of orders
         $customers_orders = $db->Execute("select o.orders_id,  o.date_purchased, o.order_total, o.currency,  o.currency_value                                          from " .  TABLE_ORDERS . " o
                                          where customers_id='" . $order->customer['id'] . "'");
?>
      <tr>
        <td class="main"><b><?php echo 'Number of Orders: '; ?></b></td>
        <td class="main"><?php echo $customers_orders->RecordCount(); ?></td>
      </tr>
<?php
// eof: number of orders
?>
[/B]    </table></td>
4 Jan 2013, 4:17 PM
#3
farrel avatar

farrel

New Zenner

Join Date:
Nov 2012
Posts:
28
Plugin Contributions:
0

Re: Number of Orders - shown on Invoice

Ajeh:

You could customize the file:
/your_secret_admin/invoice.php

with the code in RED:

  <tr>
    <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
    <td class="main"><?php echo $order->info['payment_method']; ?></td>
  </tr>

[B]<?php // bof: number of orders $customers_orders = $db->Execute("select o.orders_id, o.date_purchased, o.order_total, o.currency, o.currency_value from " . TABLE_ORDERS . " o where customers_id='" . $order->customer['id'] . "'"); ?>
<tr>
<td class="main"><b><?php echo 'Number of Orders: '; ?></b></td>
<td class="main"><?php echo $customers_orders->RecordCount(); ?></td>
</tr>

<?php // eof: number of orders ?>

[/B] </table></td>


BRILLIANT. Thank you so much!!
4 Jan 2013, 4:57 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Number of Orders - shown on Invoice

You are most welcome ... thanks for the update that this worked for you ... :smile:

17 Mar 2013, 4:06 PM
#5
srqhoyas avatar

srqhoyas

Inactive

Join Date:
Jul 2011
Location:
FLORIDA US
Posts:
5
Plugin Contributions:
0

Re: Number of Orders - shown on Invoice

This is absolutely perfect for my uses also. I added the code to my 1.5.1 version and it works like a charm!
Thanks Ajeh

17 Mar 2013, 4:08 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Number of Orders - shown on Invoice

Thanks for the update that this works for you ... :smile:

12 Apr 2013, 5:41 PM
#7
seanscully avatar

seanscully

Zen Follower

Join Date:
Apr 2006
Location:
Largo, Florida USA
Posts:
99
Plugin Contributions:
0

Re: Number of Orders - shown on Invoice

I was able to add it to my orders.php and MaxMindOrders.php page as well my question is How Can I Add The Number To The Order Status Box In Upper Right Corner On My Admin Page So I See Info?