Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

BCSE Points - displaying in packing list

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #1  
Old 03-25-2009, 02:58 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default 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
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #2  
Old 03-26-2009, 09:42 PM
 
ITVV ITVV is online now
 

X-Wizard
  
Join Date: Nov 2006
Location: UK
Posts: 1,164
 

Default 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
__________________
X-Cart Pro 4.7.12 Active and working great with reBOOT-reDUX
X-Cart Pro 4.6.6 Retired after 6 years of first class service
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Apache: 2.4.25
PHP: 7.4.5
MariaDB: 10.1.44
Arch: x86_64
Reply With Quote
  #3  
Old 03-27-2009, 12:27 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default 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
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:44 AM.

   

 
X-Cart forums © 2001-2020