Titel
-
Hey kann man den Titel etwas nach unter verschieben?
Als den oben rechts auf der Rechnung und dem Lieferschein.
-
Hi @maxxcgn,
If I understood correctly (after translating your message to English using Google Translate), you want to move the title to the right, isn’t?
If so, you can achieve it with this code snippet:
/** * WooCommerce PDF Invoices & Packing Slips: * Align the PDF invoice title to the right */ add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) { if ( $document_type == 'invoice' ) { ?> .document-type-label { text-align: right; } <?php } }, 10, 2 );If you haven’t worked with code snippets (actions/filters) or
functions.phpbefore, read this guide: How to use filtersNot quite I would like to put it down a bit xD
Sorry, do you mean that you didn’t want to move the title to the right but just adding extra margin to the top, in order to move the title down a bit? If so, replace the code above with this one:
/** * WooCommerce PDF Invoices & Packing Slips: * Add extra top margin to PDF invoice title */ add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) { if ( $document_type == 'invoice' ) { ?> table.head { margin-bottom: 20mm; } <?php } }, 10, 2 );Where do I have to insert code so that the template is changed?
If you have a child theme, you can add code snippets in its
functions.phpfile: don’t add code snippets to thefunctions.phpfile from your parent theme, because you may lose your customizations after updating your parent theme! The another way to add code snippets, that is safer in my humble opinion, is to use the Code Snippets plugin: This plugin stores the code snippets in your database, so you don’t have to worry about losing your customizations after updating your plugins or theme 😉and how can I change that in the delivery bill
Hi @maxxcgn,
You can apply the changes to all documents just removing the check
$document_typecheck, like this:/** * WooCommerce PDF Invoices & Packing Slips: * Add extra top margin to PDF documents */ add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) { ?> table.head { margin-bottom: 20mm; } <?php }, 10, 2 );got it right but how can I move it down a bit now ?
Based on your screenshot, I understood that you want to decrease the margin bottom between the addresses/order data and the order table, right? If so, I added a second CSS rule within the code snippet to do so (replace the above with this one):
/** * WooCommerce PDF Invoices & Packing Slips: * Add custom styles to the PDF documents */ add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) { ?> table.head { margin-bottom: 20mm; } table.order-data-addresses { margin-bottom: 5mm; } <?php }, 10, 2 );is it possible to move only the store name to the top without moving the invoice name ?
Could you please send a mockup pointing where you want to move the shop name?
Can I make the red ones as black as the yellow ones ?
Yes, you can set the background color for these borders adding this extra CSS rule within the code snippet above:
.order-details td, .order-details th, .totals th, .totals td { border-color: black; }Unfortunately only the upper one has changed
The topic ‘Titel’ is closed to new replies.