Jump to content

How to call phone number from barcode generator


ebdeuslave

Recommended Posts

Hello Friends,

i'm using this code below to generate some data to a barcode in invoice.tpl  using TCPDF method "write1DBarcode" and it works perfectly, but i want the phone number to be in the barcode and i don't know how to call it :

<tr>

<td style="width: 17%"></td>

<td style="width: 83%">  

{assign var=black value=[0,0,0]}{assign var=white value=[255,255,255]}

{assign var=stuff value=['position'=>'S', 'border'=>false, 'padding'=>4, 'fgcolor'=>$black, 'bgcolor'=>$white, 'text'=>false, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4]}

{assign var=params value=TCPDF::serializeTCPDFtagParameters(array($order->getUniqReference(), 'C39', '', '', 40, 15, 0.4, $stuff, 'N'))} <tcpdf method="write1DBarcode" params="{$params}" />   </td> </tr>

 

where getUniqReference() is the data generated (order reference) 

i tried $address->phone or phone_mobile it doesn't work

Anyone can help !!

THANKS

Link to comment
Share on other sites

  • 1 year later...

i found the solution in PS 1.5

Go to Classes/pdf/HTMLTemplateInvoice.php

go to function getContent (line 54) and add the following code at the first 

$mobile = $invoice_address->phone_mobile;
$fix = $invoice_address->phone;

Then add the following code at $this->smarty->assign(array(

'mobile' => $mobile,
 'fix' => $fix,

Then you set the variables $mobile et $fix to invoice.tpl like this

 

Hello Friends,

i'm using this code below to generate some data to a barcode in invoice.tpl  using TCPDF method "write1DBarcode" and it works perfectly, but i want the phone number to be in the barcode and i don't know how to call it :

<tr>

<td style="width: 17%"></td>

<td style="width: 83%">  

{assign var=black value=[0,0,0]}{assign var=white value=[255,255,255]}

{assign var=stuff value=['position'=>'S', 'border'=>false, 'padding'=>4, 'fgcolor'=>$black, 'bgcolor'=>$white, 'text'=>false, 'font'=>'helvetica', 'fontsize'=>8, 'stretchtext'=>4]}

{assign var=params value=TCPDF::serializeTCPDFtagParameters(array( $mobile, 'C39', '', '', 40, 15, 0.4, $stuff, 'N'))} <tcpdf method="write1DBarcode" params="{$params}" />   </td> </tr>

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...