• Resolved l0gin

    (@l0gin)


    Hello.

    How can I access your plugin’s variables?

    I would like to download the car list view and display it on a php template page.

    I tried including the main plugin files in the template:

    include_once ABSPATH . 'wp-content/plugins/vikrentcar/autoload.php';
    include_once ABSPATH . 'wp-content/plugins/vikrentcar/vikrentcar.php';
    include_once ABSPATH . 'wp-content/plugins/vikrentcar/defines.php';

    Then I placed the loop code in the page template, which I copied in the location below, but I only have a white page.

    wp-content/plugins/vikrentcar/site/views/carslist/tmpl/default.php

    Can you tell me which files can be included to access all plugin variables?

    I would like to build my own view with a list of cars.

    I managed to implement my search results template without any problems, but now I would like to build the same view to display a list of cars on the website.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter l0gin

    (@l0gin)

    OK, I’ve got it sorted. I have placed the below php code in the php template and now I edit the view template as before for search results.

    <?php
    
    $shortcode_content = do_shortcode('[vikrentcar category_id="" orderby="price" ordertype="asc" lim="1" view="carslist" lang="*"]');
    
    echo $shortcode_content;
    ?>

    However, I have another question: Is it possible to set a minimum rental period if the customer chooses a specific location? I checked all the functions but I am sure that the plugin does not offer such a function.

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hello,

    Thanks for your message. This is actually a technical question, but your first code snippet is not sufficient to let our PHP MVC framework start processing Controllers, Models and Views to render pages through template files. Using the second code snippet is indeed a valid solution, because then all native hooks of our plugin will be triggered and the rendering of the “Cars List” View will start.

    Regarding the minimum rental period: this function is available through the “Restrictions” available in the commercial version of the plugin. By creating a restriction you can define a minimum number of days of rent for some dates of the year, you could eventually define a maximum number of days of rent as well as some week-days closed to pick up and/or drop off. This is a similar functionality to what hoteliers can do through the booking restrictions. However, the minimum rental period is defined at vehicle-level, not at location-level, I’m sorry.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Access to plugin variables’ is closed to new replies.