X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   BCSE Points - displaying in packing list (https://forum.x-cart.com/showthread.php?t=46528)

amy2203 03-25-2009 02:58 AM

BCSE Points - displaying in packing list
 
I've used th epacking list mod on the forum to create a packing list/invoice combo. I'd like to put the customers current reward points total at the bottom.

I've edited history_order.php to add the following:
Code added:
Code:

                        $username=$order_data["userinfo"]["login"];
                        $agq="select sum(points) as total from points where login = '$username' and (expire >= '".time()."' or expire = '' or expire is null)";
                        $result=mysql_query($agq);
                        $points = mysql_fetch_row($result);
                        $smarty->assign("points", $points[0]);

In Place:
[code]
if ($orders) {
$orders_data = array();
foreach ($orders as $orderid) {
$order_data = func_order_data($orderid);
if (empty($order_data))
continue;

#
# Security check if order owned by another customer
#
if ($current_area == 'C' && $order_data["userinfo"]["login"] != $login) {
func_header_location("error_message.php?access_den ied&id=34");
}

$order = $order_data["order"];
$customer = $order_data["userinfo"];
$giftcerts = $order_data["giftcerts"];
$products = $order_data['products'];
$orders_data[] = array ("order" => $order, "customer" => $customer, "products" => $products, "giftcerts" => $giftcerts);

//Added below

$username=$order_data["userinfo"]["login"];
$agq="select sum(points) as total from points where login = '$username' and (expire >= '".time()."' or expire = '' or expire is null)";
$result=mysql_query($agq);
$points = mysql_fetch_row($result);
$smarty->assign("points", $points[0]);
}

I'm then using {$points} in the template. My problem is that it's pulling the value for the last customer only, and putting the same value in each invoice when i'm batch printing.

can anyone help?

tia

ITVV 03-26-2009 09:42 PM

Re: BCSE Points - displaying in packing list
 
Quote:

I'm then using {$points} in the template. My problem is that it's pulling the value for the last customer only, and putting the same value in each invoice when i'm batch printing.

can anyone help?

Hi, has anyone an answer for this problem? I have a very similar issue with the same points printing on invoices for all customers.

Thanks in advance

Nick

amy2203 03-27-2009 12:27 AM

Re: BCSE Points - displaying in packing list
 
I found it was actually in the install readme, one of the optional extras at the end.

hth


All times are GMT -8. The time now is 03:57 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.