nicmare Posted September 7, 2006 Posted September 7, 2006 I user pdf invoice and it works great. but there is a problem with the totals. it makes me <b> tags. but why? look at my attachment please. i tried on my own to solve this bye looking through the code of invoice.php: ... for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { $pdf->SetY($Y_Table_Position + 5); $pdf->SetX(102); $temp = substr ($order->totals[$i]['text'],0 ,3); //if ($i == 3) $pdf->Text(10,10,$temp); if ($temp == '<b>') { $pdf->SetFont('Arial','B',10); $temp2 = substr($order->totals[$i]['text'], 3); $order->totals[$i]['text'] = substr($temp2, 0, strlen($temp2)-4); } $pdf->MultiCell(94,6,$order->totals[$i]['title'] . ' ' . $order->totals[$i]['text'],0,'R'); $Y_Table_Position += 5; ... but nothing really helps does anybody has an idea? best regards nic Quote
nicmare Posted September 7, 2006 Author Posted September 7, 2006 (edited) attachment: screenshot Edited September 7, 2006 by nicmare Quote
jurro Posted March 13, 2007 Posted March 13, 2007 the <B> tag stands for bold, I think you have a double tag in your invoice so lets say you open bold by typing <b> and then there's a <b> again followed by </b> and another </b> you've gotta remove those double tags I user pdf invoice and it works great.but there is a problem with the totals. it makes me <b> tags. but why? look at my attachment please. i tried on my own to solve this bye looking through the code of invoice.php: ... for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { $pdf->SetY($Y_Table_Position + 5); $pdf->SetX(102); $temp = substr ($order->totals[$i]['text'],0 ,3); //if ($i == 3) $pdf->Text(10,10,$temp); if ($temp == '<b>') { $pdf->SetFont('Arial','B',10); $temp2 = substr($order->totals[$i]['text'], 3); $order->totals[$i]['text'] = substr($temp2, 0, strlen($temp2)-4); } $pdf->MultiCell(94,6,$order->totals[$i]['title'] . ' ' . $order->totals[$i]['text'],0,'R'); $Y_Table_Position += 5; ... but nothing really helps does anybody has an idea? best regards nic Quote
dhoerpel Posted April 9, 2007 Posted April 9, 2007 Hi, I've got the same problem and so I decided to look for a solution for that "bug". In the SQL-table "orders_total" there's a field called "title". In that field there's written the <b>- tag for total. So you get a bold- tag for your pdf-file, which obviously can't be used. The solution is to withdraw the <b>-tag with a PHP- instruction: 1.) Open catalog/admin/invoice.php 2.) Search for this code: for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { (near by 234) 3.) Replace the for - loop with the following code: for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { $temp3 = strip_tags($order->totals[$i]['title']); $pdf->SetY($Y_Table_Position + 5); $pdf->SetX(102); $temp = substr ($order->totals[$i]['text'], 0, 3); //if ($i == 3) $pdf->Text(10,10,$temp); if ($temp == '<b>') { $pdf->SetFont('Arial','B',10); $temp2 = substr($order->totals[$i]['text'], 3); // $temp2 = substr($order->totals[$i]['text'], 3); $order->totals[$i]['text'] = substr($temp2, 0, strlen($temp2)-4); } $pdf->MultiCell(94,6, $temp3 . ' ' . $order->totals[$i]['text'],0,'R'); $Y_Table_Position += 5; } 4. Reload your page and your problem should be solved. If you have any further questions you can contact me in German or English. Greetz David Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.