Support » Plugin: WooCommerce PDF Invoices & Packing Slips » Custom font doesn’t apply to dynamic informations

  • Resolved e3boss

    (@e3boss)


    Hi,
    I created a custom template but the font affect only the text written on the template and not dynamic informations such as products name, prices etc.

    An other question, I don’t know if it is the correct place to ask, I can’t access an attribute of the product that is used only as an information and not as variation.

    Thanks for your help.

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

    (@yordansoares)

    Hi @e3boss,

    This it’s likely because you still haven’t set all the font files for all the font-weight/style we use. See Using custom fonts.

    By the way, if you have a license for any of our two paid extensions for this plugin, please write us to support@wpovernight.com, so I can provide you with a custom font extension we build exclusively for our paid users.

    Thread Starter e3boss

    (@e3boss)

    Hi, I used “font-family: ‘Open Sans’, sans-serif;” not a custom font, do I have to do something?

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Sorry, I understand now. Could you please share a screenshot to see how it looks? You can use imgbb.com to share the image here. It will be also useful if you could share your template code using pastebin.com

    An other question, I don’t know if it is the correct place to ask, I can’t access an attribute of the product that is used only as an information and not as variation.

    You can get a product attribute in your custom template this way:

    $attribute = $product['product']->get_attribute( 'pa_your-attribute' );

    Thread Starter e3boss

    (@e3boss)

    This is the screen: https://ibb.co/pz4GY7H.

    This is the code: https://pastebin.com/xzhFB3bg.

    Thanks.

    • This reply was modified 5 months, 1 week ago by e3boss.
    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for sharing the screenshot and your template code.

    You indeed have built a custom template from scratch!

    Try adding this CSS rule to your custom template stylesheet:

    body, p, h2 {
      font-family: 'Open Sans', sans-serif !important;
    }

    Let me know if it worked.

    Thread Starter e3boss

    (@e3boss)

    I added your rule but nothing changed, this is my stylesheet by the way: https://pastebin.com/h5yhYG9k.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @e3boss,

    Thanks for sharing the CSS stylesheet, too.

    Below, I’ll point you which lines to modify there to change the text size of the following areas:

    1. Distributore, Fattura a, Spedici areas – :60
    2. Order table – :104
    3. Totals’ table – :203

    As final advice, I realized that you’re using em here, but pt is more appropriate, since these documents are intended for printing.

    Thread Starter e3boss

    (@e3boss)

    Thanks for your advice but I still have the problem with the font, it doesn’t change. I tried put font-family: 'Open Sans', sans-serif !important; basically everywhere but it doesn’t work.

    How can this be possible?

    Plugin Support dwpriv

    (@dwpriv)

    @e3boss

    We suspect it’s the font-weight 300 that you apply. We only include normal = 400 and bold = 700 to define our font sizes. You can try setting your font-weight to normal and see how it goes.

    Best regards

    Thread Starter e3boss

    (@e3boss)

    Yes, that was the problem. Everything is perfect now.

    Thanks @yordansoares @dwpriv 🙂

    • This reply was modified 5 months ago by e3boss.
    Plugin Contributor Yordan Soares

    (@yordansoares)

    We’re happy to help!

    By the way, 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 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.