Forums / Managing Customers and Orders / Group pricing field in invoice

Group pricing field in invoice

Locked

Views: 903

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
20 Aug 2010, 10:46 PM
#1
klynn avatar

klynn

New Zenner

Join Date:
Feb 2008
Posts:
6
Plugin Contributions:
0

Group pricing field in invoice

First thanks for Zen Cart and the great support forum!!!
I have also installed and using mod Group Pricing (per Item) with no problems.

I would now like the field customers_group_pricing from TABLE_CUSTOMERS to be visible inside admin orders or just the admin printable** invoice.**

The reason is that the admin should know if the order of the particular customer belongs to a discounted Group pricing group.

It seems the affected files are admin/invoice.php
and maybe admin/includes/classes/order.php
admin/orders.php

The field customers_group_pricing of table CUSTOMERS is what I need to be printed on the invoice (since it is the id of the group. For example Group A has id 2, no discount group customers have id 0).

My problem is that table ORDERS holds the information orders_id and customers_id but it doesn't hold the field customers_group_pricing. So I do not know how to reference the customers_group_pricing from table CUSTOMERS inside admin/invoice.php

21 Aug 2010, 12:52 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Group pricing field in invoice

You could do a search of the customers_id in the orders table and look up their customers_group_pricing to see what id is used ...

On the orders.php you can get the customers_id from the:
$orders->fields['customers_id']

On the invoice.php you need to add to the SELECT statement the customers_id so that it is available to do this look up ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Aug 2010, 3:07 PM
#3
klynn avatar

klynn

New Zenner

Join Date:
Feb 2008
Posts:
6
Plugin Contributions:
0

Re: Group pricing field in invoice

Thanks a lot, it now works fine.

I only edited file admin/invoice.php where
added there inside the select statement
of $order_check, the field **customers_id **.

Then below this statement added the code

$xinfocode = "SELECT customers_group_pricing
                  from " . TABLE_CUSTOMERS . "
                  where customers_id ='" . $order_check->fields['customers_id'] . "'";
          $xinfo = $db->Execute($xinfocode);

Then further below where the print outs are, added

<tr>
<td class="main" style="color:#FF0000"><?php echo "Discount Group: "; ?>
<?php if($xinfo->fields['customers_group_pricing']== 2) echo "Wholesale (Group A)";
if($xinfo->fields['customers_group_pricing']== 1) echo "1";
if($xinfo->fields['customers_group_pricing']== 0) echo "Retail";?></td>
</tr>
25 Aug 2010, 3:47 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Group pricing field in invoice

Thanks for the update that you have this working and for posting your solution ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!