realpascal Posted May 28, 2003 Posted May 28, 2003 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. Pascal
Ian Posted May 28, 2003 Posted May 28, 2003 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 $order->products[$i]['model'] as this contains the model for the current product HTH Trust me, I'm an Accountant.
Guest Posted May 28, 2003 Posted May 28, 2003 Also - The barcode mod already exisits... And it calls ecactly the way you are doing... Warren
realpascal Posted May 28, 2003 Author Posted May 28, 2003 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 !
Guest Posted May 28, 2003 Posted May 28, 2003 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']; ?>">
realpascal Posted May 28, 2003 Author Posted May 28, 2003 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" .
realpascal Posted May 29, 2003 Author Posted May 29, 2003 Could anyone tell me what's wrong with it ? Please...
Ian Posted May 29, 2003 Posted May 29, 2003 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.
realpascal Posted May 29, 2003 Author Posted May 29, 2003 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. !
Nieko Posted May 29, 2003 Posted May 29, 2003 realpascal: I am making a mod that will display a barcode (EAN-13 code) W: Yes I understand what you mean!!! - Well done!!! Actually, it was I that coded it. See http://nieko.net/barcode and http://nieko.net/comp_tools.php for more.
realpascal Posted May 29, 2003 Author Posted May 29, 2003 I wouldn't dare to take credit for someone else's efforts. I didn't claim to write the script...i made the mod. Left the author's name in the original, and supplied a howto install. Contribution is here: http://www.oscommerce.com/community/contri...ns,1268/page,10
Recommended Posts
Archived
This topic is now archived and is closed to further replies.