• Resolved selfhostedlife

    (@selfhostedlife)


    Hey team, Please help me in adding CGST, IGST, SGST columns in my pdf invoice.
    Here VAT is not acceptable in India so I want to add a column of the above-mentioned GST
    I have tried all the settings of Woocommerce but I was unable to do so.
    check this

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

    (@yordansoares)

    Hello @selfhostedlife,

    You can add custom fields to your invoices using the template action hooks. See several examples about adding new fields to your invoices here.

    Let’s say your custom field is stored with the order meta key custom_field_name, then you could add this field to your invoices using the following code snippet:

    add_action( 'wpo_wcpdf_after_billing_address', 'wpo_wcpdf_delivery_date', 10, 2 );
    function wpo_wcpdf_delivery_date ($template_type, $order) {
    ? ? $document = wcpdf_get_document( $template_type, $order );
    ? ? if ($template_type == 'invoice') {
    ? ? ? ? ?>
    ? ? ? ? <tr class="custom-field">
    ? ? ? ? ? ? <th>Custom Field:</th>
    ? ? ? ? ? ? <td><?php $document->custom_field('custom_field_name'); ?></td>
    ? ? ? ? </tr>
    ? ? ? ? <?php
    ? ? }
    }

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    You can also add any field, without no code, using Premium Templates. This extension includes a customizer that allows you to tailor your PDF documents using product columns, total rows, and custom blocks. In addition, Premium Templates provides two additional templates: Business and Modern.

    For your specific case, you only need to add a custom, block this way:

    A screenshot that display an use example of the custom blocks

    Then, your invoices will display your custom field:

    A screenshot that display the example custom field on the invoice

    If you don’t know the name of your custom field, see Finding WooCommerce custom fields

    Let me know if you have more questions ??

    Thread Starter selfhostedlife

    (@selfhostedlife)

    Thanks for your help, sir.
    No that’s not the case.
    Please refer to the screenshot below> https://imgur.com/a/p77uBUV
    and see how GST 18 is added there.
    How to do that please guide

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @selfhostedlife,

    Thanks for clarifying. This can be done with the customizer included in Premium Templates. The customizer allows you to add new total rows to your invoices, including the VAT total row:

    A screenshot that display a VAT total row block

    Then your invoices will display your different VAT rates on your invoices:

    A screenshot that display an invoice with the VAT details highlighted

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add GST columns’ is closed to new replies.