This is a list of the required steps to create an override file:
- Locate your WordPress Upload Directory via FTP. The directory usually used as the upload dir is in /wp-content/uploads/.
- Make sure to have uploaded at least one photo for your cars through the admin pages of Vik Rent Car.
- Locate the Vik Rent Car Upload Directory via FTP. It’s always a sub-directory of the WordPress Upload Directory. Usually /wp-content/uploads/vikrentcar/.
- Locate the Vik Rent CarOverrides Directory via FTP, and keep this path in mind, as this is called the Overrides Base Path. Usually /wp-content/uploads/vikrentcar/overrides/.
- Create a folder inside the Overrides Base Path called “site” that will store all the override files for the pages of the front-end site. Depending on your Upload Directory, the path should be similar to /wp-content/uploads/vikrentcar/overrides/site/.
- Find the name of the page (View) of the front-end in Vik Rent Car that you would like to customize. For example, the list of cars is generated through the View (layout file) called “carslist”.
- Copy the original layout file of the View (default.php) onto the Overrides Base Path directory “site”. For creating a copy of the layout file of the View called “carslist”, you should copy the following file:
/wp-content/plugins/vikrentcar/site/views/carslist/tmpl/default.php
onto the following directory, given the examples above with our Overrides Base Path:
/wp-content/uploads/vikrentcar/overrides/site/carslist/default.php
The view “carslist” was missing in “/site” so this had to be created via FTP. Now the path above will be used by the Vik Rent Car plugin to load the layout file for the page Cars List. - Modify the HTML/PHP/JS/CSS code of the layout file to meet your needs. This override file will never be touched by future updates, and it’s a secure layout file because it can only be executed by Vik Rent Car behind the execution of the WordPress framework.
Imagine that you would like to create an override file for a specific Widget, like the Horizontal Search Form or the Currency Converter: you can create an override layout file also for the Widgets! In this case, next to the folder “site” in the Overrides Base Path directory, create a folder via FTP called “modules“, that contains the name of the Widget and its layout file inside it. Then, by editing the parameters of the Widget from the wp-admin section, you will be able to choose the desired layout file from the overrides.
For example, to create an override file of the Widget “Search Form“, you should copy the following file:
/wp-content/plugins/vikrentcar/modules/mod_vikrentcar_search/tmpl/default.php
onto the following path, by creating the missing directories after your Overrides Base Path of Vik Rent Car:
/wp-content/uploads/vikrentcar/overrides/modules/mod_vikrentcar_search/default.php