• Resolved pursuitforjustice

    (@pursuitforjustice)


    Hello. I enjoy this plugin. However, I am experiencing issues with both inline CSS & adding CSS with the wcdn_head action hook. Also, I did read the post submitted by user pihasurfer about 2 weeks ago regarding the HTML being stripped. The HTML is now working. However, it appears that some inline CSS is being stripped. For instance, when I add “display: flex;” that is removed, but other inline CSS will remain, such as “justify-content: center;” Moreover, when I attempt to use the wcdn_head action hook, it doesn’t work. I tried using this hook inside the functions.php file & I tried using it with the WPCode plugin, but I wasn’t successful. Maybe I’m doing it wrong.

    This is pertaining to the Invoice template. I currently do not use the Receipt nor Delivery Notes template.

    How I’m using the action hook.

    <?php

    function custom_invoice_css()
    {
    ?>
    <style>

    /* Custom CSS */

    </style>
    <?php
    }

    add_action('wcdn_head', 'custom_invoice_css', 20);

    ?>


    Below is an example of my CSS coding being stripped.

    Before I save my code:

    <div style="display: flex; flex-wrap: wrap; justify-content: space-evenly; margin: 1rem 0 0;">

    After I save my code (display property & value are missing):

    <div style="flex-wrap: wrap; justify-content: space-evenly; margin: 1rem 0 0;">

    Any assistance is greatly appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @pursuitforjustice,

    I will check this custom code snippet with the development team and will get back to you with an update of the same. I hope that is fine.

    Thread Starter pursuitforjustice

    (@pursuitforjustice)

    Hi @priyankajagtap,

    That is fine. I appreciate it. Also, I did try different priorities with the hook, such as the following:

    add_action('wcdn_head', 'custom_invoice_css', 20);

    add_action('wcdn_head', 'custom_invoice_css', 10, 1);

    add_action('wcdn_head', 'custom_invoice_css', 10, 2);
    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @pursuitforjustice,

    First of all, I apologize for the inconvenience this may have caused to you.

    Our developer checked this hook at our end and observed that the hook “wcdn_head” is working properly. The output of the function code will be shown on the button only. The changes done in the code using this hook will not be reflected in the PDF and live preview because this hook is not attached to that.

    If you want to apply that hook output in the PDF then you can add the styling with the important! tag in the “style.css” file located at the below-mentioned path. So the changes will be applied in the PDF also.
    wp-content / plugins / woocommerce-delivery-notes / templates / pdf / default

    Also, can you please provide the full custom code that you are adding to the “functions.php” file? So our development team can check the code snippet and investigate why it is not working for you. We will check and let you know the update of the same.

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