ebdeuslave Posted December 18, 2020 Share Posted December 18, 2020 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 More sharing options...
ebdeuslave Posted April 7, 2022 Author Share Posted April 7, 2022 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now