RasmusKnabe Posted May 2, 2012 Share Posted May 2, 2012 Hi, I'm trying to make some small changes to the invoice PDF. 1) I use a Danish company for handling credit cards called ePay, but i donut want the payment method on the invoice listen as "ePay" but rather as "Credit card" 2) For some reason the tax is shown with 3 decimals, as opposed to all other prices that only have to decimals.. Don't know if their is a good reason for this but would like to change the tax field to only have 2 decimals. Link to comment Share on other sites More sharing options...
RasmusKnabe Posted May 2, 2012 Author Share Posted May 2, 2012 I have located the PDF.php file en the Classes folder, but have a hard time understanding it.. And guess that the payment module name should be changed somewhere else!? Link to comment Share on other sites More sharing options...
bellini13 Posted May 2, 2012 Share Posted May 2, 2012 you could change the ePay payment module, so that the display name is "Credit Card", but unfortunately that breaks a validation check, so you would have to override the PaymentModule class. you could also just change the PDF.php, so that instead of displaying "ePay", it converts it to "Credit Card". I didn't follow you second item, perhaps a screen shot would help. Link to comment Share on other sites More sharing options...
RasmusKnabe Posted May 2, 2012 Author Share Posted May 2, 2012 Thanks for you reply! So i locate the place in the PDF.php where it writes out the name of the payment method, check if it says "ePay" and if yes, replace it with "Credit card"? Will give it a try Here a screenshot to show what i mean about the decimals on Tax: Link to comment Share on other sites More sharing options...
RasmusKnabe Posted May 2, 2012 Author Share Posted May 2, 2012 Guess that changing the name from "ePay" to "Credit card" should be done in these lines of code.. But can't really figure out whats going on? $pdf->Cell(55, 6, self::l('Order #').' '.sprintf('%06d', self::$order->id), 'L', 0); $pdf->Cell(70, 6, self::l('Carrier:').($order->gift ? ' '.Tools::iconv('utf-8', self::encoding(), $carrier->name) : ''), 'L'); $pdf->Cell(0, 6, self::l('Payment method:'), 'LR'); $pdf->Ln(5); $pdf->Cell(55, 6, (isset($shipping_date) ? self::l('Shipping date:').' '.Tools::displayDate($shipping_date, self::$order->id_lang) : ' '), 'LB', 0); $pdf->Cell(70, 6, ($order->gift ? self::l('Gift-wrapped order') : Tools::iconv('utf-8', self::encoding(), $carrier->name)), 'LRB'); $pdf->Cell(0, 6, Tools::iconv('utf-8', self::encoding(), $order->payment), 'LRB'); $pdf->Ln(15); $pdf->ProdTab((self::$delivery ? true : '')); Link to comment Share on other sites More sharing options...
RasmusKnabe Posted May 2, 2012 Author Share Posted May 2, 2012 Figured out how to edit the payment method name.. Now i just need the decimals for Tax Link to comment Share on other sites More sharing options...
bellini13 Posted May 2, 2012 Share Posted May 2, 2012 This should be the line of code, The 3 after "$tax_rate" is how many decimals to use. Try changing the 3 to 2. The line of code is in the function called "TaxTab" $this->Cell($w[1], $lineSize, number_format($tax_rate, 3, ',', ' ').' %', 0, 0, 'R'); Note: The correct way to make these changes is to create an override of the class. But for now, just get the code working how you like it, you can deal with overrides after. Link to comment Share on other sites More sharing options...
RasmusKnabe Posted May 2, 2012 Author Share Posted May 2, 2012 Thanks a lot! - Now that i see it I'm actually a bit embraced that I didn't discover that myself I know the correct way is to do an override but haven't quite learned how that works yet.. got to find a good tutorial - anyways.. Really appreciate the help i have gotten on this Forum! Link to comment Share on other sites More sharing options...
w3bsolutions Posted May 22, 2012 Share Posted May 22, 2012 Hi there, would any of you know how to hide the "State" from the Adresses in the PDF?? I need this for a special need and but I cant figure it out... Any help is appreciated! Link to comment Share on other sites More sharing options...
bellini13 Posted May 23, 2012 Share Posted May 23, 2012 you should really open a new topic for this new question. address formats are controlled via the back office. go to Shipping | Countries. Edit the country in question, and update the address format so it does not include the State. Note: This will impact the entire site, so anywhere that addresses are displayed, the State will no longer appear. Link to comment Share on other sites More sharing options...
w3bsolutions Posted May 23, 2012 Share Posted May 23, 2012 Sorry, I just thought maybe it wasnt necessary to open another thread, since this one was similiar. Thanks for your help, but I need the State to show up everywhere in the site, except for the Pdf, so that wouldnt work... Link to comment Share on other sites More sharing options...
bellini13 Posted May 24, 2012 Share Posted May 24, 2012 then you will need to customize the PDF.php class to ignore the global formatting and print only the fields you want. Link to comment Share on other sites More sharing options...
tuk66 Posted May 25, 2012 Share Posted May 25, 2012 (edited) Thanks for your help, but I need the State to show up everywhere in the site, except for the Pdf, so that wouldnt work... Try to add 'State:name' to the array in PDF.php $patternRules = array( 'avoid' => array( 'address2', 'company', 'phone', 'phone_mobile')); I didn't test. Edited May 25, 2012 by tuk66 (see edit history) Link to comment Share on other sites More sharing options...
w3bsolutions Posted July 20, 2012 Share Posted July 20, 2012 It worked, but not adding it to that array, it worked adding it to the other one on line 584 $patternRules = array( 'optional' => array( 'address2', 'company'), 'avoid' => array( 'State:iso_code', 'State:name')); thanks! Link to comment Share on other sites More sharing options...
sandokan71 Posted August 23, 2012 Share Posted August 23, 2012 (edited) Figured out how to edit the payment method name.. Now i just need the decimals for Tax Hi, could you please share your solution for editing the payment method name ? Thanks Edited August 23, 2012 by sandokan71 (see edit history) Link to comment Share on other sites More sharing options...
www.dressmeglam.com Posted December 2, 2012 Share Posted December 2, 2012 Hi, could you please share your solution for editing the payment method name ? Thanks Please share your solution 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