How do I change the wording on the Customer PDF, and the Check-In forms?
-
Hi there. We have the pro version of Vik Car Rent. I am trying to edit the PDF Check-in form, and the customer PDF. I can edit the layout in “views and layouts”, and I can edit the CSS in “conditional texts”, but how do I edit the wording? I don’t want any mention of cars. We rent snowmobiles and trailers. Thanks.
The page I need help with: [log in to see the link]
-
Also, where is the “Customer PDF” viewed? Where in the process of booking a rental does it appear? Does it have to be signed before the customer can book? I see under ‘Configuration’ > ‘Orders and Company’ there is an option to ‘Attach PDF to the order eMail’. Is this in reference to the Customer PDF document listed in the “Views and Layouts” and “Conditional Texts” sections?
Just FYI- your plugin is incredibly confusing. You could use more help button icons to help people know what all of your settings mean.
Hi,
Thanks for the detailed message. We are sorry to hear you find the plugin confusing, but we believe you just need to familiarize with all the functions available, especially for what concerns the template files. Once these will be properly set up according to your needs, you won’t need to touch them anymore.
We are also going to consider your request for having more help tooltip icons.Before we answer to your actual question, we would like to explain better when such template files are used to generate PDF documents. The “Customer PDF” template file is used to generate a document that contains a summary of the rental order, as well as an agreement/contract for the rent. This will be attached to the confirmation email for the customers. By default, the template file contains a sample text available in multiple languages for translation through the native PO/MO files. You can find that line of code responsible of generating the sample text of the contract/agreement inside the template file, it’s in between some PHP comments to help anyone find it to eventually remove it and replace it with your own text. If you don’t need to be able to translate the new text into multiple languages, because maybe your website is only in English, then you could also write plain text or HTML code directly inside the template file. Alternatively, you could create a “Conditional Text” from the Configuration page by using the apposite WYSIWYG editor and by adding a rule that will always be compliant, like “Status = Confirmed”. The Conditional Texts support translations into multiple languages by using the apposite and built-in function in Vik Rent Car.
Otherwise, using native WordPress PHP code to access a custom translation string through Gettext will always work (i.e.__('Your custom and translatable text');
) inside any template file.Thanks to the Conditional Texts you can place the special tags on any position of your template files by using the inspector tool. This way you won’t need to work on the source code of the template files, unless you need to remove some default contents, HTML blocks or texts.
All the wordings you find in our plugin (pages and template files) are taken from the default PO/MO files, and so this means that you could override an existing translation string by using the WordPress native Gettext translations. There are many free plugins that allow you to overwrite a Gettext translation into a different value, and this is useful if you don’t want to have any mention for “Cars”, “Car” etc.. please be aware of the fact that Gettext translation overrides are case sensitive, and so in order to override any mention for “cars” into “vehicles” or anything else you prefer, you should create an override for “Cars” into “Vehicles”, another for “Car” into “Vehicle” etc.. if you visit the Knowledge Base section on our official website and then click on Customization Tips, you will find an article where we explain how to override existing translations through free plugins. Just make sure to always target the exact original translation string, which can be found inside the default PO/MO files for English.
The other template file called “PDF Check-in” is used when you manually check a customer in through the back-end. By default, this template file will display the distinctive feature of the exact sub-unit booked for your vehicle (if any sub-unit is assigned to the rental order, and if your vehicles have more than one unit available), as well as the vehicle status, which is an image showing custom damages or notes that indicate the status of the vehicle at the time of rent. Beside this information, the default template file also includes a space for the signatures for those who need them.
We hope this clarifies how the template files and the conditional texts work.
Feel free to contact us again should you have any questions.
The VikWP Team
Can you show me where I can edit the template file exactly? I don’t see the text in the template anywhere. Please keep in mind my PHP coding skills are limited. I need to replace the verbiage with our own Terms of Service entirely:
`<?php
/**
* @package VikRentCar
* @subpackage com_vikrentcar
* @author Alessio Gaggii – e4j – Extensionsforjoomla.com
* @copyright Copyright (C) 2018 e4j – Extensionsforjoomla.com. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @link https://vikwp.com
*/defined(‘ABSPATH’) or die(‘No script kiddies please!’);
/**
* Some special tags between curly brackets can be used to display certain values such as:
* {logo}, {company_name}, {order_id}, {confirmnumb}, {order_status}, {order_date}, {customer_info}, {item_name},
* {pickup_date}, {pickup_location}, {dropoff_date}, {dropoff_location}, {order_details}, {order_total},
* {customfield 2} (will print the custom field with ID 2), {order_link}, {footer_emailtext}, {vrc_add_pdf_page} (to break and add a page to the PDF)
*
* The record of the order can be accessed from the following global array in case you need any extra content or to perform queries for a deeper customization level:
* $order_details (order array)
* Example: the ID of the order is contained in $order_details[‘id’] – you can see the whole array content with the code “print_r($order_details)”
*
* It is also possible to access the customer information array by using this code:
* $customer = VikRentCar::getCPinIstance()->getCustomerFromBooking($order_details[‘id’]);
* The variable $customer will always be an array, even if no customers were found. In this case, the array will be empty.
* Debug the content of the array with the code “print_r($customer)” by placing it on any part of the PHP content below.
*/// Custom PDF Parameters
define(‘VRC_PAGE_PDF_PAGE_ORIENTATION’, ‘P’); //define a constant – P=portrait, L=landscape (P by default or if not specified)
define(‘VRC_PAGE_PDF_UNIT’, ‘mm’); //define a constant – [pt=point, mm=millimeter, cm=centimeter, in=inch] (mm by default or if not specified)
define(‘VRC_PAGE_PDF_PAGE_FORMAT’, ‘A4’); //define a constant – A4 by default or if not specified. Could be also a custom array of width and height but constants arrays are only supported in PHP7
define(‘VRC_PAGE_PDF_MARGIN_LEFT’, 10); //define a constant – 15 by default or if not specified
define(‘VRC_PAGE_PDF_MARGIN_TOP’, 10); //define a constant – 27 by default or if not specified
define(‘VRC_PAGE_PDF_MARGIN_RIGHT’, 10); //define a constant – 15 by default or if not specified
define(‘VRC_PAGE_PDF_MARGIN_HEADER’, 1); //define a constant – 5 by default or if not specified
define(‘VRC_PAGE_PDF_MARGIN_FOOTER’, 5); //define a constant – 10 by default or if not specified
define(‘VRC_PAGE_PDF_MARGIN_BOTTOM’, 5); //define a constant – 25 by default or if not specified
define(‘VRC_PAGE_PDF_IMAGE_SCALE_RATIO’, 1.25); //define a constant – ratio used to adjust the conversion of pixels to user units (1.25 by default or if not specified)
$page_params = array(
‘show_header’ => 0, //0 = false (do not show the header) – 1 = true (show the header)
‘header_data’ => array(), //if empty array, no header will be displayed. The array structure is: array(logo_in_tcpdf_folder, logo_width_mm, title, text, rgb-text_color, rgb-line_color). Example: array(‘logo.png’, 30, ‘Car Rental xy’, ‘Versilia Coast, xyz street’, array(0,0,0), array(0,0,0))
‘show_footer’ => 1, //0 = false (do not show the footer) – 1 = true (show the footer)
‘pdf_page_orientation’ => ‘VRC_PAGE_PDF_PAGE_ORIENTATION’, //must be a constant – P=portrait, L=landscape (P by default)
‘pdf_unit’ => ‘VRC_PAGE_PDF_UNIT’, //must be a constant – [pt=point, mm=millimeter, cm=centimeter, in=inch] (mm by default)
‘pdf_page_format’ => ‘VRC_PAGE_PDF_PAGE_FORMAT’, //must be a constant defined above or an array of custom values like: ‘pdf_page_format’ => array(400, 300)
‘pdf_margin_left’ => ‘VRC_PAGE_PDF_MARGIN_LEFT’, //must be a constant – 15 by default
‘pdf_margin_top’ => ‘VRC_PAGE_PDF_MARGIN_TOP’, //must be a constant – 27 by default
‘pdf_margin_right’ => ‘VRC_PAGE_PDF_MARGIN_RIGHT’, //must be a constant – 15 by default
‘pdf_margin_header’ => ‘VRC_PAGE_PDF_MARGIN_HEADER’, //must be a constant – 5 by default
‘pdf_margin_footer’ => ‘VRC_PAGE_PDF_MARGIN_FOOTER’, //must be a constant – 10 by default
‘pdf_margin_bottom’ => ‘VRC_PAGE_PDF_MARGIN_BOTTOM’, //must be a constant – 25 by default
‘pdf_image_scale_ratio’ => ‘VRC_PAGE_PDF_IMAGE_SCALE_RATIO’, //must be a constant – ratio used to adjust the conversion of pixels to user units (1.25 by default)
‘header_font_size’ => ’10’, //must be a number
‘body_font_size’ => ’10’, //must be a number
‘footer_font_size’ => ‘8’ //must be a number
);
defined(‘_VIKRENTCAR_PAGE_PARAMS’) OR define(‘_VIKRENTCAR_PAGE_PARAMS’, ‘1’);?>
<div style=”display: inline-block; width: 100%;”>
<table>
<tr>
<td>{logo}</td><td><h3>{company_name}</h3></td>
</tr>
</table><table>
<tr>
<td align=”center”><strong><?php echo JText::_(‘VRCORDERNUMBER’); ?></strong></td>
<td align=”center”><strong><?php echo JText::_(‘VRCCONFIRMATIONNUMBER’); ?></strong></td>
<td align=”center”><strong><?php echo JText::_(‘VRLIBSEVEN’); ?></strong></td>
<td align=”center”><strong><?php echo JText::_(‘VRLIBEIGHT’); ?></strong></td>
</tr>
<tr>
<td align=”center”>{order_id}</td>
<td align=”center”>{confirmnumb}</td>
<td align=”center”><span style=”color: {order_status_class};”>{order_status}</span></td>
<td align=”center”>{order_date}</td>
</tr>
</table><h4><?php echo JText::_(‘VRLIBNINE’); ?>:</h4>
<p>{customer_info}</p><p><strong><?php echo JText::_(‘VRLIBTEN’); ?>:</strong> {item_name}</p>
<table>
<tr>
<td align=”center”><strong><?php echo JText::_(‘VRLIBELEVEN’); ?></strong></td>
<td align=”center”><strong><?php echo JText::_(‘VRRITIROCAR’); ?></strong></td>
<td> </td>
<td align=”center”><strong><?php echo JText::_(‘VRLIBTWELVE’); ?></strong></td>
<td align=”center”><strong><?php echo JText::_(‘VRRETURNCARORD’); ?></strong></td>
</tr>
<tr>
<td align=”center”>{pickup_date}</td>
<td align=”center”>{pickup_location}</td>
<td> </td>
<td align=”center”>{dropoff_date}</td>
<td align=”center”>{dropoff_location}</td>
</tr>
</table><p> <br/><br/></p>
<h4><?php echo JText::_(‘VRCORDERDETAILS’); ?>:</h4>
<br/>
<table width=”100%” align=”left” style=”border: 1px solid #DDDDDD;”>
<tr><td bgcolor=”#C9E9FC” width=”30%” style=”border: 1px solid #DDDDDD;”></td><td bgcolor=”#C9E9FC” width=”10%” align=”center” style=”border: 1px solid #DDDDDD;”><?php echo JText::_(‘VRCPDFDAYS’); ?></td><td bgcolor=”#C9E9FC” width=”20%” style=”border: 1px solid #DDDDDD;”><?php echo JText::_(‘VRCPDFNETPRICE’); ?></td><td bgcolor=”#C9E9FC” width=”20%” style=”border: 1px solid #DDDDDD;”><?php echo JText::_(‘VRCPDFTAX’); ?></td><td bgcolor=”#C9E9FC” width=”20%” style=”border: 1px solid #DDDDDD;”><?php echo JText::_(‘VRCPDFTOTALPRICE’); ?></td></tr>
{order_details}
{order_total}
</table><p> <br/><br/></p>
<p>
<br/>
<small>
<strong>{customfield 2} {customfield 3}, <?php echo JText::_(‘VRLIBTENTHREE’); ?>:</strong>
<br/>
{order_link}
</small>
<br/>
</p>
<small>{footer_emailtext}</small><?php
//BEGIN: Contract/Agreement Sample Code
?>
{vrc_add_pdf_page}
<?php
//with the line above we add a new page to the PDF
?>
<h3><?php echo JText::_(‘VRCAGREEMENTTITLE’); ?></h3>
<?php echo JText::sprintf(‘VRCAGREEMENTSAMPLETEXT’, ‘{customfield 2}’, ‘{customfield 3}’, ‘{company_name}’, ‘{order_date}’, ‘{dropoff_date}’); ?>
<?php
//the line above will print the following sample text:
//”This agreement between %s %s and %s was made on the %s and is valid until the %s.”
//The wildcards “%s” will be replaced with all the parameters of the function sprintf so in the example above, the text will become:
//”This agreement between {customfield 2} {customfield 3} and {company_name} was made on the {order_date} and is valid until the {dropoff_date}.”
//The system will replace the values in {} with the real values
?>
<p> <br/><br/></p>
<?php echo JText::_(‘VRCAGREEMENTSAMPLETEXTMORE’); ?>
<?php
//END: Contract/Agreement Sample Code
?></div>
<style type=”text/css”>
<!–
p {
font-size: 12px;
}
h3 {
font-size: 16px;
font-weight: bold;
}
h4 {
font-size: 14px;
font-weight: bold;
}
span.confirmed {
color: #009900;
}
span.standby {
color: #ff0000;
}–>
</style>
`Hello,
In the original source code of the template we added some comments. If you look at the line 130 you will find the PHP comment
//BEGIN: Contract/Agreement Sample Code
and around the line 148 you will find//END: Contract/Agreement Sample Code
.If you get rid of all those lines of code, you will have removed the sample text of the contract. At that point, all you need to do is to enter your own text.
Please refer to our previous message where we were suggesting to use the Conditional Text tags, plain text in the HTML portion of the template file in case no translations are required, or PHP code printing your Gettext translation string with the entire text you want to have in case you would like to translate the text into multiple languages.
We understand your PHP coding skills are limited, but please pay attention to where you add your own text. You cannot add plain text inside PHP tags, because only PHP code is expected inside PHP tags, or your modifications would break the source code, which we strongly recommend backing up in case you have problems.
In short, if you wish to use Gettext translation strings for your next, this is what you should use (please notice the code is inside PHP tags):<?php _e('Your custom and translatable text'); ?>
Instead, if you need to add plain text or HTML code, just make sure to not be inside the PHP opening or closing tag, or your plain text would break the whole file as code would be expected when after
<?php
or before?>
.This is technical stuff, and so we would appreciate if you could actually get in touch with our technicians through our website, because posting the whole source code in this forum is probably not going to be helpful for others.
If you don’t want to deal with coding or HTML, then the best and easiest thing to do is to get rid of the default sample text by following the instructions above (the default sample text is within those PHP comments), and then you should simply use the Conditional Texts to add your own tag to the desired position of the template file by using the apposite tool in the Configuration page.
The good thing about Conditional Texts is that they can be translated into other languages by using the built-in Translations feature in Vik Rent Car. Moreover, thanks to the customizer tool, you can add the special tag of your conditional text with the ease of a click on your template file. On top of that, you have an editor available to customize the content of your text. Just remember that Conditional Texts are called “conditional” because they require at least one “rule” to be “compliant” with the rental order. If you select a rule of type “Status” and choose the value “Confirmed” you will know that your Conditional Text will be displayed inside the PDF for all confirmed rental orders, and that’s probably what you want. Alternatively, you can choose any other rules that will be compliant with your orders, but at least one rule is mandatory for your conditional text in order to be displayed inside the template file with the actual text, and all rules you provide must be compliant with the rental order.We implemented the Conditional Texts to allow anyone to have dynamic contents inside the template files (email, PDF documents, cron jobs etc..), but they also serve as an easy way to avoid working on the source code of such templates.
We hope this helps!
The VikWP Team
Thank you. I was able to use the conditional text to insert text into the customer PDF. I have another question about changing verbiage, but it’s on the search page. When I input my search parameters, the results page says “Cars found: 4”. We don’t rent cars. We rent snowmobiles. How do I change this to say “rentals found” instead? I’m assuming the above explanation is not helpful as this isn’t an email or PDF. Your help is greatly appreciated.
Thanks.
Hi,
We are glad to hear the Conditional Texts were helpful.
If you would like to change a default language translation, then the best solution is to create an override for the original translation string of the PO/MO file of Vik Rent Car.
Such overrides can be managed by any WordPress plugin supporting Gettext overrides. If you visit the Knowledge Base section on our official website for Vik Rent Car, you will find more information about a popular and free plugin for WordPress that we recommend using in these case. Just click on Vik Rent Car – Customization Tips – Wording and Translation Overrides. The free and light-weight plugin we suggest using is called “Gettext override translations”.
With this kind of plugins you need to enter the exact translation string, case-sensitive, that you would like to override, and to provide the override text. In your case, the exact and original translation string will be “Cars Found” which should be overridden with “Rentals found”. This way you will be able to override a default Gettext translation of Vik Rent Car.
We hope this helps!
The VikWP TeamThank you. I was able to change the verbiage. At first, it wasn’t working, then instead of changing “Cars” to “Rentals” I had to change “Cars Found” to “Rentals Found.”
- The topic ‘How do I change the wording on the Customer PDF, and the Check-In forms?’ is closed to new replies.