Viewing 2 reply threads
  • Author
    Posts
    • #2246

      Hi

      After a bit of digging to find the cause of a problem, I found that Piklist conflicts with this plugin:

      Opening Hours

      You can see the problem by going to the Opening Hours plugin Special Openings settings. With Piklist activated, clicking on the date field will do nothing, whereas without Piklist, a date picker will pop up.

    • #2250
      Marcus
      Member

      Hi Cotswold.

      From what I can see, (installed opening-hours and checked piklist datepicker fields)
      It comes from these lines in Opening Hours init.php file:

      function op_register_styles_backend() {
      	wp_enqueue_style('jQuery-ui-timepicker', op_baseurl() . '/js/jQuery.ui.timepicker/jquery.ui.timepicker.css', false, false, 'all');
      	wp_enqueue_style('jQuery-ui-style', 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css', false, false, 'all');
      	wp_enqueue_style('opening-hours-backend', apply_filters( 'op_backend_stylesheet', op_baseurl() . '/css/backend.css' ), false, false, 'all');
      	
      	wp_register_script('jQuery-ui', 'http://code.jquery.com/ui/1.10.3/jquery-ui.js', false, null, false);
      	wp_register_script('jQuery-ui-timepicker', op_baseurl() . '/js/jQuery.ui.timepicker/jquery.ui.timepicker.js', false, null, false);
      	wp_enqueue_script('jQuery-ui');
      	wp_enqueue_script('jQuery-ui-timepicker');
      }
      

      In opening-hours-backend all of the css is changed completely from what piklist has. (due to the same naming conventions)
      If you comment out the following:

      
      function op_register_styles_backend() {
      	wp_enqueue_style('jQuery-ui-timepicker', op_baseurl() . '/js/jQuery.ui.timepicker/jquery.ui.timepicker.css', false, false, 'all');
      //	wp_enqueue_style('jQuery-ui-style', 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css', false, false, 'all');
      //	wp_enqueue_style('opening-hours-backend', apply_filters( 'op_backend_stylesheet', op_baseurl() . '/css/backend.css' ), false, false, 'all');
      	
      	wp_register_script('jQuery-ui', 'http://code.jquery.com/ui/1.10.3/jquery-ui.js', false, null, false);
      	wp_register_script('jQuery-ui-timepicker', op_baseurl() . '/js/jQuery.ui.timepicker/jquery.ui.timepicker.js', false, null, false);
      	wp_enqueue_script('jQuery-ui');
      	wp_enqueue_script('jQuery-ui-timepicker');
      }
      

      You should find that piklist datepickers work again, (at least it did for me) but your styles for opening hours will no longer work.

      So either you need to hook into a filter that only loads those styles on an opening hours page or plugin, or Piklist will have to change their naming conventions, or opening hours will need to learn how to load native jquery-ui styles and scripts. (as all of those don’t need to be loaded remotely)

      There will probably need to be a more elegant solution, but for the 2 minutes I looked at it, this is what I found.

      Marcus

    • #2251

      mmm

      I will have to rethink how I do this then. Thanks for getting back to me.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.