Custom styling of PDFs

WCMp PDF Invoice

Custom styling of PDFs Resolved

Tagged: 

Viewing 19 reply threads
  • Author
    Posts
    • #100858

      Hi, I would like to add my own styling to the pdfs. I can see the current location is under `plugins > wcmp-pdf_invoices > assets > pdf > style.css but I would like to add my own style.css and then apply styling accordingly.

      Q1. How do I do that please?

      I’d like to style the 3 boxes highlighted below but cannot locate the template to get the classes.

      Q2. Please can you tell me where this template is located so I can apply my own styling?

      Thanks

    • #100905
      This reply has been marked as private.
    • #100924

      Hey! Yep, I copied it to my theme folder and have changed some items around. What is the process to override the styling?

      Is there a global style sheet or does this need to be done inline? Thanks a lot.

    • #100961
      abhirup
      Moderator

      Hi,
      you can use inline css for your custom modification.

    • #101078

      Ok thanks. Is there an easy way to preview these without having to re-download each time I make an update?

    • #101079

      Also, how do I please change the highlighted area on the attached? as it is displaying this information via a hook?

      Where can I locate this to make the necessary css changes?

      Thank you

    • #101173
      abhirup
      Moderator
      This reply has been marked as private.
    • #101241

      Hi. I applied the code above but it produced an error on the form.

      There has been a critical error on your website.
      Copy

      Please can you take a second look? I’ve attached my template file if that helps?

    • #101242

      File attached.

    • #101265
      abhirup
      Moderator
      This reply has been marked as private.
    • #101269

      Thanks so much. All is good now and I have styled the pdf.

      Final questions; how can I show;

      1. the shipping costs on the Vendor Invoice?
      2. the value of commission DEDUCTED from the final order value e.g. if order total is 100 GBP and the admin charge is 5%, I would like to show -5 GBP just above the final Total price on the Vendor Invoice. This was the Grand Total adds up correctly then.

      Is it normal, and common practise, not to show the shipping value on the Customer Invoice and include this in the grand total? If you can also tell me how to show this on the Customer Invoice that would be great. Thanks

    • #101347
      abhirup
      Moderator

      Hi,
      For your first point you can add vendor shipping cost on pdf-invoice from vendor dashboard store settings >> invoice.

      second point we are looking into this. As this requires custom code support, hence it will need some time.
      thank you.

    • #101481

      Thanks for the information.

      I now have a bigger problem; the invoices all of a sudden are not showing any order information. I’ve reverted back to the default templates, yet still blank invoices.

      Please let me know what you recommend. Thanks

    • #101632
      abhirup
      Moderator

      Hi,please move or remove overridden template from your active theme folder and check. if this problem still exists then please send us screenshot of your pdf invoice.

    • #101642

      Randomly, it is working again. Looking forward to your reply on my other question.

      Cheers

    • #101668
      abhirup
      Moderator

      Hi,
      add this code on your overridden template after line no 120 or after this line “if($order_item_totals) :”
      and check.

      $commission_id = get_post_meta($hook_data["order"]->get_id(), '_commission_id', true) ? get_post_meta($hook_data["order"]->get_id(), '_commission_id', true) : '';
                                  if($commission_id){
                                      $commission_total = get_post_meta($commission_id, '_commission_total', true);
                                      $order_total = get_post_meta($hook_data["order"]->get_id(), '_order_total', true);
                                      $admin_commission = wc_price( $order_total - $commission_total);
                                      $new_array['admin_charge'] = array ( 
                                          'label' => 'Admin Charge:',
                                          'value' => $admin_commission 
                                      );
                                      $total_array['total'] = array_pop( $order_item_totals );
                                      $order_item_totals = array_merge($order_item_totals, $new_array , $total_array );
                                     
                                  }
      Copy
    • #101777

      Thanks. How can I only show this on Seller Invoice only? Thanks

    • #101871
      abhirup
      Moderator

      Hi,
      add this code on your overridden template after line no 120 or after this line “if($order_item_totals):”

       $commission_id = get_post_meta($hook_data["order"]->get_id(), '_commission_id', true) ? get_post_meta($hook_data["order"]->get_id(), '_commission_id', true) : '';
                                  if($commission_id && $hook_data["user_type"]!='customer' ){
                                      $commission_total = get_post_meta($commission_id, '_commission_total', true);
                                      $order_total = get_post_meta($hook_data["order"]->get_id(), '_order_total', true);
                                      $admin_commission = wc_price( $order_total - $commission_total);
                                      $new_array['admin_charge'] = array ( 
                                          'label' => 'Admin Charge:',
                                          'value' => $admin_commission 
                                      );
                                      $total_array['total'] = array_pop( $order_item_totals );
                                      $order_item_totals = array_merge($order_item_totals, $new_array , $total_array );
                                     
                                  }
      Copy
    • #101888

      Thanks a lot. Works perfectly.

    • #107020
      abhirup
      Moderator

      Great to know that.

Viewing 19 reply threads

The topic ‘Custom styling of PDFs’ is closed to new replies.

Buy all Marketplace addons together, check out our Bundle

Buy at Slashed Price