• Resolved maxxcgn

    (@maxxcgn)


    Hey kann man den Titel etwas nach unter verschieben?
    Als den oben rechts auf der Rechnung und dem Lieferschein.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    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.php before, read this guide: How to use filters

    Thread Starter maxxcgn

    (@maxxcgn)

    Not quite I would like to put it down a bit xD

    Plugin Contributor Yordan Soares

    (@yordansoares)

    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 );
    Thread Starter maxxcgn

    (@maxxcgn)

    Where do I have to insert code so that the template is changed?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    If you have a child theme, you can add code snippets in its functions.php file: don’t add code snippets to the functions.php file 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 ??

    Thread Starter maxxcgn

    (@maxxcgn)

    and how can I change that in the delivery bill

    Thread Starter maxxcgn

    (@maxxcgn)

    https://ibb.co/7rxd9X0

    got it right but how can I move it down a bit now ?

    thank you

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @maxxcgn,

    You can apply the changes to all documents just removing the check $document_type check, 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 );
    Plugin Contributor Yordan Soares

    (@yordansoares)

    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 );
    Thread Starter maxxcgn

    (@maxxcgn)

    is it possible to move only the store name to the top without moving the invoice name ?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Could you please send a mockup pointing where you want to move the shop name?

    Thread Starter maxxcgn

    (@maxxcgn)

    Can I make the red ones as black as the yellow ones ?

    https://ibb.co/7jwx8Wz

    Plugin Contributor Yordan Soares

    (@yordansoares)

    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;
    }
    Thread Starter maxxcgn

    (@maxxcgn)

    https://ibb.co/f07FFjx

    Unfortunately only the upper one has changed

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Titel’ is closed to new replies.