Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author DOTonPAPER

    (@dotonpaper)

    Hello,

    I am sorry, it’s not possible to use the same calendar for booking and in “View only info” mode too.

    Thank you.

    Thread Starter oivind

    (@oivind)

    I’ts okay, I managed to fix it.

    Thread Starter oivind

    (@oivind)

    For posterity, here’s the fix:

    in class-frontend-calendar.php:

    //find:
    $language = $atts[‘lang’];
    //create new variable:
    $view = $atts[‘view’];


    // change this:
    //’view’ => $settings_calendar->view_only == ‘true’ ? true:false),

    //to:
    ‘view’ => !isset($view) ? ($settings_calendar->view_only == ‘true’ ? true:false) : ($view === ‘true’ ? true:false) ) ,

    Now you can use ‘view’ as a shortcode attribute.

    Plugin Author DOTonPAPER

    (@dotonpaper)

    Thank you for your feedback.

    Have a wonderful day.

    @oivind
    would you be so kind to show me how you’ve done this
    and maybe the webpages?

    Thread Starter oivind

    (@oivind)

    Hi, I’ll try to expand the explanation.

    First find this file in the dopbs plugins folder: ‘class-frontend-calendar.php’

    In this file we will make a new variable $view. Add it after the $language variable, like below:

    $language = $atts['lang'];
    //create new variable here:
    $view = $atts['view'];

    Then some lines further down:

    //BEFORE:
    //'view' => $settings_calendar->view_only == 'true' ? true:false),
    
    //AFTER:
    'view' => !isset($view) ? ($settings_calendar->view_only == 'true' ? true:false) : ($view === 'true' ? true:false) ) ,

    ( notice the commas! )

    RESULT:
    Then you can use a shortcode looking like this:
    [dopbsp id=1 view=true lang=no]

    Hope it helps!

    Plugin Author DOTonPAPER

    (@dotonpaper)

    Thank you for your feedback.

    Have a wonderful day.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘"View only info" on/off feature’ is closed to new replies.