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

    (@e4jvikwp)

    Hi,

    The PDF document is generated through a PHP template file that returns some basic HTML code for the parsed to convert it to a PDF document.

    You should never edit the source code of this template file through your server, or by installing a future update of the plugin, your changes will go lost. You should rather use the apposite tool in the back-end section of Vik Rent Items, in the 3rd tab of the Configuration page, from which you can edit the template file for the “Customer PDF”.

    By using our code-mirror editor, changes will also be saved onto the database, and so installing a future update of the plugin will ensure to never lose your modifications.

    If you read the default source code of the PDF template file, you will find some PHP comments at the top where we explain how to access the rental order details (array) to display additional values or to even use queries on the database.

    Please notice that the template file is loaded and rendered by our plugin Vik Rent Items, and so you have access to the entire framework.

    We hope this helps!

    The VikWP Team

    Thread Starter ahmad1034

    (@ahmad1034)

    Hi,
    Thanks for your reply.
    I want to remove these items check image in screenshot https://www.getboat.gr/wp-content/uploads/2022/05/remove.jpg but in this {order_details} variable when I print as array like print_r(${order_details});, this is not giving the heading(first column data), but when I print whole variable it give. I want every variable separate. Also when I print the data like <?PHP echo $order_details[‘order_total’]?> then it breaks the layout of table in PDF. How it is possible to remove the “Net Price” and “Tax” successfully.

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi,

    Thanks for the screen shot. That’s actually a complex modification because via PHP you should re-build the entire HTML layout by fetching from the database the total rental cost per item in case you want to hide the net rate and the tax columns.

    The point is that the content you want to modify is applied by the framework of Vik Rent Car, by replacing the special tag {order_details} with contains the actual HTML layout. This means that you don’t have a string-variable there that could be manipulated there, you would need to completely erase the special tag from the template and via PHP you should re-build and write the entire HTML layout string. This of course involves queries to be made onto the database by accessing the only array-variable available $order_details.

    If this is truly what you need to do, then we suggest looking at the original source code to see how the special tag {order_details} gets replaced. This way you could do pretty much the same thing in your template file for the PDF document. The file you want to look for is /wp-content/plugins/vikrentcar/site/helpers/lib.vikrentcar.php. Just search for the special tag {order_details} to see how the default HTML layout for that placeholder is built so that you can do the same and modify the content accordingly in your PDF email template code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Edit PDF’ is closed to new replies.