• Resolved whflive

    (@whflive)


    The recent update has messed up the plugin for me. I’ve been using the below code with code snippets plugin to hide weight for a while now and the latest update has started to display the weight again on my packing slip when generating new slips. How can I remove the weight? The below code no longer works. Thanks!

    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_hide_weight', 10, 2 );
    function wpo_wcpdf_hide_weight( $document_type, $document ) {
    ?>
    .meta .weight { display:none !important; }
    <?php
    }
Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter whflive

    (@whflive)

    I rolled back the plugin to older 3.8.4 version and the weight is hidden. If anyone knows how to fix the new version, please do reply.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @whflive,

    We have applied some improvements recently to our default “Simple” template, to make it compatible with the mPDF extension (see?PR#810), that is why the CSS rule for the item meta does no longer work with that specific selectors.

    That said, here is an updated version of that code snippet that should work:

    add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_hide_weight', 10, 2 );
    function wpo_wcpdf_hide_weight( $document_type, $document ) {
    ?>
    .item-meta .weight { display:none !important; }
    <?php
    }

    Let me know if you need more help!

    Thread Starter whflive

    (@whflive)

    Hi Yordan,

    Thanks. That worked flawlessly but I’m having another issue. The pack slip/invoice font size adjustment code isn’t working. All fonts are way to large and changing the “pt” number on each font sizes does not change anything for me. Any ideas? The code I’m using:

    /**
    * Custom styles for PDF documents
    */
    add_action( 'wpo_wcpdf_custom_styles', function ( $document_type, $document ) {
    ?>
    .invoice tr.order-number, .invoice tr.order-date {
    font-size: 4pt;
    margin-top: 0px;
    margin-bottom: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    }
    /* Document label */
    h1 {
    font-size: 6pt;
    margin-top: 5px;
    margin-bottom: 5px;
    padding-top: 0px;
    padding-bottom: 0px;
    }
    /* Shop name and other labels */
    h3, h4 {
    font-size: 4pt;
    padding-top: 0px;
    padding-bottom: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    }
    /* Document body and order table */
    body {
    font-size: 4pt;
    padding-top: 0px;
    padding-bottom: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    }
    dt, dd, dd p, .wc-item-meta {
    font-size: 4pt;
    padding-top: 0px;
    padding-bottom: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    }
    table.order-data-addresses, table.head {
    margin-bottom: 10px;
    }
    <?php
    }, 10, 2 );
    Thread Starter whflive

    (@whflive)

    Works now with:

    /**
    * Custom styles for PDF documents
    */
    add_action( 'wpo_wcpdf_custom_styles', function ( $document_type, $document ) {
    ?>
    /* Document label */
    h1 {
    font-size: 6pt;
    margin-top: 0px;
    margin-bottom: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    }
    /* Shop name and other labels */
    h3, h4 {
    font-size: 6pt;
    padding-top: 0px;
    padding-bottom: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    }
    /* Document body and order table */
    body {
    font-size: 6pt;
    padding-top: 0px;
    padding-bottom: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    }
    dt, dd, dd p, .wc-item-meta {
    font-size: 6pt;
    padding-top: 0px;
    padding-bottom: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    }
    .invoice tr.order-number, .invoice tr.order-date {
    font-size: 6pt;
    margin-top: 0px;
    margin-bottom: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    <?php
    }, 10, 2 );

    But the spacing between logo image header and the bottom of the info box (as shown by the two black arrows) is too much. How can I reduce the spacing?

    Thread Starter whflive

    (@whflive)

    @yordansoares

    Also the SKU field text is a little large. How to change that one? Cheers ??

    Plugin Contributor dwpriv

    (@dwpriv)

    @whflive you can use this guide to find the CSS selectors for these areas. You can then add the styles you need to these selectors to get them to look the way you want.

    Thread Starter whflive

    (@whflive)

    Thanks for the tips. Adjusting the following identified by the selectors fixed the issues above.

    table.head, table.order-data-addresses

    and

    .wc-item-meta p, .item-meta p
    Plugin Contributor Yordan Soares

    (@yordansoares)

    We’re glad to hear that @whflive!

    Let us know if you need anything else ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.