Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Model number ??


Recommended Posts

I hope you can help me with this one...


I am making a mod that will display a barcode (EAN-13 code) behind every article in the invoice. With this mod, everyone with a cashregister (incl scanner) can scan the articles sold into the register.

Everything is going just fine, but I need to know what function is used to create the model number in invoice.php.


The end result would have to be something like this:

<img src="osbarcode.php?barcode= (function that creates model#) ">


Does anybody know what to use ?


As soon as it's finished, I'll post the contribution.



Link to comment
Share on other sites

There isn't a function per se to display the product model.


If you look at the invoice.php code you will find.


    for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {


this loops through all of the products in the order. A little later on,


           '        <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "n";


this actually displays the product model. The important bit is




as this contains the model for the current product



Trust me, I'm an Accountant.

Link to comment
Share on other sites

The mod that already exists, puts a 3 for 9 barcode (ONLY 3 for 9) at the bottom of the invoice, representing the order no. Most European cashregisters can't handle 3 for 9 barcodes.

The new mod creates the barcode for products..ready to scan with your cashregister in EAN-8 or EAN-13.


Could you post the full syntaxis here, Ian ? My PHP isn't that good..

Is it like this ?:


<img src="osbarcode.php?barcode= '$order->products[$i]['model']'">


Thanks !

Link to comment
Share on other sites

O sorry Pascal...

Yes I understand what you mean!!! - Well done!!!


The syntax is:


<img src="osbarcode.php?barcode="<?php echo $order->products[$i]['model']; ?>">

Link to comment
Share on other sites

I get a parse error...what's wrong with this?




 '  <td class="dataTableContent" align="right" valign="top"><img src="osbarcode.php?barcode="<?php echo $order->products[$i]['model']; ?>"></td>' . "n";



I pasted it right below this line in invoice.php:

'        <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "n" .

Link to comment
Share on other sites

The code is part of an echo statement and therefore does not need the extra php tags


'      <td class="dataTableContent" align="right" valign="top"><img src="osbarcode.php?barcode="' . $order->products[$i]['model']. '"></td>' . "n";

Trust me, I'm an Accountant.

Link to comment
Share on other sites

I've got it working now..thanks !


The " after barcode= in your syntax is not correct:


<img src="osbarcode.php?barcode=' . $order->products[$i]['model']. '">


This does the trick.


Thanks !




I'll post the mod asap. !

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...