Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)
Also had to decode the order status and order comments:
Code:
if ($orders_history->RecordCount() > 0) {
while (!$orders_history->EOF) {
if ($orders_history->fields['comments'] != '' && strpos($orders_history->fields['comments'], 'PayPal status:') === false){
$count_comments++;
$pdf->Cell(120, 14, zen_datetime_short($orders_history->fields['date_added']));
$pdf->MultiCell(456, 14, utf8_decode($orders_status_array[$orders_history->fields['orders_status_id']]));
$pdf->Cell(27, 14, '', 0, 0, '', 1);
$pdf->MultiCell(549, 14, (utf8_decode(zen_db_output($orders_history->fields['comments']))), 'B');
$pdf->SetLineWidth(.5);
$pdf->Line(18,$pdf->GetY(),594,$pdf->GetY());
}
$orders_history->MoveNext();
if (ORDER_COMMENTS_PACKING_SLIP == 1 && $count_comments >= 1) {
break;
}
}
}
Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)
Quote:
Originally Posted by
abcisme
Also had to decode the order status and order comments:
Code:
if ($orders_history->RecordCount() > 0) {
while (!$orders_history->EOF) {
if ($orders_history->fields['comments'] != '' && strpos($orders_history->fields['comments'], 'PayPal status:') === false){
$count_comments++;
$pdf->Cell(120, 14, zen_datetime_short($orders_history->fields['date_added']));
$pdf->MultiCell(456, 14, utf8_decode($orders_status_array[$orders_history->fields['orders_status_id']]));
$pdf->Cell(27, 14, '', 0, 0, '', 1);
$pdf->MultiCell(549, 14, (utf8_decode(zen_db_output($orders_history->fields['comments']))), 'B');
$pdf->SetLineWidth(.5);
$pdf->Line(18,$pdf->GetY(),594,$pdf->GetY());
}
$orders_history->MoveNext();
if (ORDER_COMMENTS_PACKING_SLIP == 1 && $count_comments >= 1) {
break;
}
}
}
To help others it would be useful if you included the approximate line numbers where you made your changes..
Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)
Quote:
Originally Posted by
DivaVocals
To help others it would be useful if you included the approximate line numbers where you made your changes..
Sorry! Here you go. My store is in French and English, so I needed to specify UTF-8 in order for the French characters to show up correctly. I am sure there must be a better way to specify the default charset for the whole pdf file, but this was the only way I knew how to do it.
These were the changes I made in admin/includes/functions/extra_functions/lcsd_merged_packing_slips.php
I have made a LOT of changes to this file, so line numbers are approximate.
Around line 242:
Code:
$orderText .= utf8_decode( ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText);
Around line 345:
Code:
function draw_packing_slip_customer($order, &$pdf){
$billTo = utf8_decode(zen_address_format($order->customer['format_id'], $order->billing, 0, '', "\n"));
if($order->billing['street_address'] == ''){
$billTo = utf8_decode(zen_address_format($order->customer['format_id'], $order->customer, 0, '', "\n"));
}
$shipTo = utf8_decode(zen_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\n"));
if($order->delivery['street_address'] == ''){
$shipTo = utf8_decode(zen_address_format($order->customer['format_id'], $order->customer, 0, '', "\n"));
}
Around line 426:
Code:
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
$prod_name = utf8_decode($order->products[$i]['name']);
if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) {
$prod_name .= utf8_decode(' ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
}
Around line 493:
Code:
if ($orders_history->RecordCount() > 0) {
while (!$orders_history->EOF) {
if ($orders_history->fields['comments'] != '' && strpos($orders_history->fields['comments'], 'PayPal status:') === false){
$count_comments++;
$pdf->Cell(120, 14, zen_datetime_short($orders_history->fields['date_added']));
$pdf->MultiCell(456, 14, utf8_decode($orders_status_array[$orders_history->fields['orders_status_id']]));
$pdf->Cell(27, 14, '', 0, 0, '', 1);
$pdf->MultiCell(549, 14, (utf8_decode(zen_db_output($orders_history->fields['comments']))), 'B');
$pdf->SetLineWidth(.5);
$pdf->Line(18,$pdf->GetY(),594,$pdf->GetY());
}
Also, to get rid of hardcoded text and use the define text for multi-language you will need to define ENTRY_PHONE, ENTRY_EMAIL and ENTRY_ORDER_STATUS in admin/includes/languages/YOUR_LANGUAGE/super_batch_forms.php
Then, in admin/includes/functions/extra_functions/lcsd_merged_packing_slips.php
Around 359:
Code:
$pdf->SetFont('Arial','', 9);
$billToY = $pdf->GetY();
$pdf->MultiCell(220, 13, ENTRY_SOLD_TO . "\n\n" . $billTo);
$pdf->Ln(8);
$pdf->MultiCell(220, 13, ENTRY_PHONE . ' : ' . $customerPhone);
$pdf->MultiCell(220, 13, ENTRY_EMAIL . ' : ' . $customerEmail);
$pdf->Ln(6);
$EndY = $pdf->GetY();
$pdf->SetXY(306, $billToY);
$pdf->SetFont('Arial','B', 12);
$pdf->MultiCell(220, 13, ENTRY_SHIP_TO . "\n\n" . $shipTo);
$pdf->SetXY(18, $EndY);
}
And around line 479:
Code:
if (ORDER_COMMENTS_PACKING_SLIP > 0) {
$pdf->Ln();
$pdf->SetFillColor(180,180,180);
$pdf->SetFont('Arial','B', 10);
$pdf->MultiCell(576, 14, ENTRY_ORDER_STATUS . ' ', 'B');
$pdf->SetFont('Arial','', 8);
$pdf->SetFillColor(256,256,256);
Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)
To be clear this was all done for SO v3.0 for Zen Cart 1.3.9 correct??
Quote:
Originally Posted by
abcisme
Sorry! Here you go. My store is in French and English, so I needed to specify UTF-8 in order for the French characters to show up correctly. I am sure there must be a better way to specify the default charset for the whole pdf file, but this was the only way I knew how to do it.
These were the changes I made in admin/includes/functions/extra_functions/lcsd_merged_packing_slips.php
I have made a LOT of changes to this file, so line numbers are approximate.
Around line 242:
Code:
$orderText .= utf8_decode( ' ' . $order->products[$i]['qty'] . 'x ' . $order->products[$i]['name'] . '/' . $order->products[$i]['model'] . $attribText);
Around line 345:
Code:
function draw_packing_slip_customer($order, &$pdf){
$billTo = utf8_decode(zen_address_format($order->customer['format_id'], $order->billing, 0, '', "\n"));
if($order->billing['street_address'] == ''){
$billTo = utf8_decode(zen_address_format($order->customer['format_id'], $order->customer, 0, '', "\n"));
}
$shipTo = utf8_decode(zen_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\n"));
if($order->delivery['street_address'] == ''){
$shipTo = utf8_decode(zen_address_format($order->customer['format_id'], $order->customer, 0, '', "\n"));
}
Around line 426:
Code:
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
$prod_name = utf8_decode($order->products[$i]['name']);
if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) {
$prod_name .= utf8_decode(' ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
}
Around line 493:
Code:
if ($orders_history->RecordCount() > 0) {
while (!$orders_history->EOF) {
if ($orders_history->fields['comments'] != '' && strpos($orders_history->fields['comments'], 'PayPal status:') === false){
$count_comments++;
$pdf->Cell(120, 14, zen_datetime_short($orders_history->fields['date_added']));
$pdf->MultiCell(456, 14, utf8_decode($orders_status_array[$orders_history->fields['orders_status_id']]));
$pdf->Cell(27, 14, '', 0, 0, '', 1);
$pdf->MultiCell(549, 14, (utf8_decode(zen_db_output($orders_history->fields['comments']))), 'B');
$pdf->SetLineWidth(.5);
$pdf->Line(18,$pdf->GetY(),594,$pdf->GetY());
}
Also, to get rid of hardcoded text and use the define text for multi-language you will need to define ENTRY_PHONE, ENTRY_EMAIL and ENTRY_ORDER_STATUS in admin/includes/languages/YOUR_LANGUAGE/super_batch_forms.php
Then, in admin/includes/functions/extra_functions/lcsd_merged_packing_slips.php
Around 359:
Code:
$pdf->SetFont('Arial','', 9);
$billToY = $pdf->GetY();
$pdf->MultiCell(220, 13, ENTRY_SOLD_TO . "\n\n" . $billTo);
$pdf->Ln(8);
$pdf->MultiCell(220, 13, ENTRY_PHONE . ' : ' . $customerPhone);
$pdf->MultiCell(220, 13, ENTRY_EMAIL . ' : ' . $customerEmail);
$pdf->Ln(6);
$EndY = $pdf->GetY();
$pdf->SetXY(306, $billToY);
$pdf->SetFont('Arial','B', 12);
$pdf->MultiCell(220, 13, ENTRY_SHIP_TO . "\n\n" . $shipTo);
$pdf->SetXY(18, $EndY);
}
And around line 479:
Code:
if (ORDER_COMMENTS_PACKING_SLIP > 0) {
$pdf->Ln();
$pdf->SetFillColor(180,180,180);
$pdf->SetFont('Arial','B', 10);
$pdf->MultiCell(576, 14, ENTRY_ORDER_STATUS . ' ', 'B');
$pdf->SetFont('Arial','', 8);
$pdf->SetFillColor(256,256,256);
Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)
Quote:
Originally Posted by
DivaVocals
To be clear this was all done for SO v3.0 for Zen Cart 1.3.9 correct??
Here's what my header says:
PHP Code:
/*
//////////////////////////////////////////////////////////////////////////
// SUPER ORDERS v3.0 //
// //
// Based on Super Order 2.0 //
// By Frank Koehl - PM: BlindSide (original author) //
// //
// Super Orders Updated by: //
// ~ JT of GTICustom //
// ~ C Jones Over the Hill Web Consulting (http://overthehillweb.com) //
// ~ Loose Chicken Software Development, [email protected] //
// //
// Powered by Zen-Cart (www.zen-cart.com) //
// Portions Copyright (c) 2005 The Zen-Cart Team //
// //
// Released under the GNU General Public License //
// available at www.zen-cart.com/license/2_0.txt //
// or see "license.txt" in the downloaded zip //
//////////////////////////////////////////////////////////////////////////
// DESCRIPTION: PDF version of super_packingslip.php, //
// Features include: //
// ~ Pricing information which supports tax included pricing options //
// identical to super_invoices.php //
// ~ Admin configurable options to use with forms that have a peel //
// off mailing label in place of the default "Packing Slip" text //
//////////////////////////////////////////////////////////////////////////
// $Id: super_batch_forms.php v 2010-10-24 $
Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)
Awesome!!! Thanks for sharing..:smile:
Quote:
Originally Posted by
abcisme
Here's what my header says:
PHP Code:
/*
//////////////////////////////////////////////////////////////////////////
// SUPER ORDERS v3.0 //
// //
// Based on Super Order 2.0 //
// By Frank Koehl - PM: BlindSide (original author) //
// //
// Super Orders Updated by: //
// ~ JT of GTICustom //
// ~ C Jones Over the Hill Web Consulting (http://overthehillweb.com) //
// ~ Loose Chicken Software Development, [email protected] //
// //
// Powered by Zen-Cart (www.zen-cart.com) //
// Portions Copyright (c) 2005 The Zen-Cart Team //
// //
// Released under the GNU General Public License //
// available at www.zen-cart.com/license/2_0.txt //
// or see "license.txt" in the downloaded zip //
//////////////////////////////////////////////////////////////////////////
// DESCRIPTION: PDF version of super_packingslip.php, //
// Features include: //
// ~ Pricing information which supports tax included pricing options //
// identical to super_invoices.php //
// ~ Admin configurable options to use with forms that have a peel //
// off mailing label in place of the default "Packing Slip" text //
//////////////////////////////////////////////////////////////////////////
// $Id: super_batch_forms.php v 2010-10-24 $
Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)
Quote:
Originally Posted by
DivaVocals
Awesome!!! Thanks for sharing..:smile:
You're welcome. Like I said, I'm sure someone will come up with a better way of doing it, but that's what I could come up with for now. :)
Re: Super Orders v3.0 Support Thread (for ZC v1.3.9)
Found one more hard coded text in the file. The "packing slip" title.
Define TITLE_PACK_SLIP in admin/includes/languages/YOUR_LANGUAGE/super_batch_forms.php
Code:
define('TITLE_PACK_SLIP','Packing Slip');
in admin/includes/functions/extra_functions/lcsd_merged_packing_slips.php
Around line 73:
Code:
if(LCSD_SHOW_SHIPPING_LABEL == 'False'){
$this->SetFont('Arial','B', 28);
$this->SetXY(350, 85);
$this->MultiCell(270, 24, TITLE_PACK_SLIP);
}
Re: Super Orders v3.0 Support Thread
I may be not seeing something but when I download all I get is a .php page without any accompanying files, i.e., the extensive readme noted.
I am not seeing any current comments, either, although it seems that the module is being currently supported.
Re: Super Orders v3.0 Support Thread
Did you unzip the download package? If yes, and a single .php file is all that's there, then something went wrong with your download. Try again.
Quote:
Originally Posted by
WWWD
I may be not seeing something but when I download all I get is a .php page without any accompanying files, i.e., the extensive readme noted.
I am not seeing any current comments, either, although it seems that the module is being currently supported.