Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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

  • 6 months later...
Posted

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

  • 4 weeks later...
Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...