• Resolved pwindpub

    (@pwindpub)


    Hello. this code snippet was working up until this past week. Can someone help me resolve the issue? I want the weight sku removed from the packng slip.

    add_action( ‘wpo_wcpdf_custom_styles’, ‘wpo_wcpdf_custom_styles’, 10, 2 ); function wpo_wcpdf_custom_styles ( $document_type, $document ) { if ( $document_type == ‘packing-slip’ ) { ?> .product .meta .sku, .product .meta .weight { display: none; } <?php } }

    And I would like to enlarge the print size of the remaining META notes, i.e. responses to questions from purchasing the item… IS THIS A GIFT? YES/NO…

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

    (@yordansoares)

    Hi @pwindpub,

    This may be because we have recently updated the document markup to make our default “Simple” template compatible with the mPDF extension (see: PR#810).

    That said, please try updating your code snippet with this one, to hide the SKU and weight again:

    /**
    * PDF Invoices & Packing Slips for WooCommerce
    * Apply custom styles to the PDF documents
    */
    add_action( 'wpo_wcpdf_custom_styles', function( $document_type, $document ) {
    ?>
    /* Hide the weight in packing slips */
    .packing-slip .item-meta .sku, .packing-slip .item-meta .weight { display:none }
    <?php
    }, 10, 2 );

    Let me know if you need more help!

    Thread Starter pwindpub

    (@pwindpub)

    Hi Yordan. Apologize for being away.

    The new snippet doesn’t seem to be working. This is the message I am getting:

    Snippet automatically deactivated due to an error on line 1:

    Syntax error, unexpected ‘function’ (T_FUNCTION), expecting ‘)’.

    UPDATE: Just got it to work! I needed to HARD update and activate. Thank you for your help!!!

    • This reply was modified 2 weeks, 1 day ago by pwindpub.
    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for confirming that it worked, @pwindpub! ??

    If you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

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