WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Datepicker issue
- AuthorPosts
- 22 April, 2018 at 3:32 am #36865
Hello!
It seems that WPP (3.3.5) is affecting the style of the date pickers that are used elsewhere on my site (Hotel Master theme)
I’ve tested various other things and the only thing that seems to be causing this is WWP. When I deactivate WPP, the date picker’s style is restored. Note: The date picker still works of course, just the style is affected.
Link to a SS:
https://www.school31lofts.com/wp-content/uploads/2018/04/SS-olly.jpg
23 April, 2018 at 6:51 pm #36874>It seems that WPP (3.3.5) is affecting the style of the date pickers that are used elsewhere on my site
that’s correct if you enable WPPizza->Order Settings->Item and Cart Updates and Amendments -> “Enable increase/decrease …” (2 options) as it includes a themeroller stylesheet to style the spinner/number input boxes (these jquery/themeroller stylesheets affect all those UI interfaces ).
However, as you have also a dropdown there to choose a particular style, i would think you can make that match the one that comes with the theme (if not, then i would have to see what stylesheet the theme includes if you have wppizza – or those options i mentioned above – disabled )23 April, 2018 at 9:24 pm #36881Thanks Olly. There was nothing like the theme’s default in drop down, so I currently have “I have my own style” selected. There really is no style now associated with those counter boxes.
So at this point I need to ingest a style for them (and it seems the input fields on the order form?)I’d like to be able to use my theme’s default here, but it does not seem like it’s naturally working.
24 April, 2018 at 12:00 am #36882what do i have to click on – on your site – to actually see a wppizza “counter” (as you call them) box
(PS: they are called “spinners” officially, just fyi )24 April, 2018 at 12:31 am #3688324 April, 2018 at 12:55 am #36884thanks
the problem is that neither your theme nor your gdlr-hotel plugin provides css for the spinner element (only the datepicker from what i can see)
so if you want to keep everything as is on that front , you’d have to add your own spinner css to your theme’s css ( and leave it as “I have my own style… etc”)
alternatively “roll” your own theme and include that for all those jquery ui interfaces – https://jqueryui.com/themeroller/
or select a theme from the ones available in wppizza (perhaps the “ui-darkness” one or the “dark hive”) which – as you know – will affect all other ui elements too (which is a good thing in my book to keep things consistent throughout all those elements)
you could – of course – also just get the spinner parts/css of those and add those to your (child)theme’s css
essentially , your theme’s/plugins styling of jQuery UI elements is incomplete as it only assumes usage of the ui element implemented by your particular theme/plugin. That’s understandable somewhat , but results in the issue you are facing
(hope the above makes sense somewhat -kind of late here)
24 April, 2018 at 1:05 am #36885PS: my *guess* is that the theme is using a copy of a themeroller css somewhat anyway , only with a bunch of ui elements omitted so selecting from the appropriate css from the wppizza dropdown will automatically add all missing elements’ css with the added bonus of not having to maintain it as well as consistency across all of them
24 April, 2018 at 1:29 am #36886Thanks that all makes sense and I’ll do my best to make progress over here. (and yes get some rest!)
24 April, 2018 at 1:56 am #36887Is there any way to tell the themeroller CSS to affect only the WPP spinners?
24 April, 2018 at 10:42 am #36888no, because it would defeat the point of using it in the first place
so if you want to have your own custom version, you have to use your own custom css (as mentioned previously in this thread)28 April, 2018 at 5:00 am #36940Hi Olly
I spoke with the theme developer and his response was this. I suppose just let me know your response.This is happening because the plugin loads its styles on all pages instead of loading it on pages where it is used.
Woocommerce provides a function called is_woocommerce which allows us to avoid that. I couldn’t find an equivalent function for wppizza plugin though. Try asking the plugin developer about this and I can help with the code if such function exists.
I tried using his method but it still affects other elements like datepicker:
You can use the jquery-ui.css from the above link to try it yourself.
28 April, 2018 at 10:18 am #36941>This is happening because the plugin loads its styles on all pages instead of loading it on pages where it is used.
that’s simply not true
it’s caused by including the themeroller style – the inclusion of which was made optional for precisely the reason that if themes already include styling for jquery ui-elements it won’t be neededalas – from what i can see – your theme does not actually provide any styling for ui elements and it is the gdlr-hotel plugin that provides and styles the datepicker using it’s own style but only for the datepicker.
furthermore – though somewhat unrelated – the wppizza.css only ever targets it’s own distinct elements and only where strictly necessary. Wherever possible and sensible it will try to use a themes’ style
lastly, using an equivalent of “is_woocommerce” would do no such thing as it would also not load any styles on the checkout pages or in fact any page that shows the wppizza menu items or any wppizza widgets, shortcodes etc etc
(the overheads of checking a page content/sidebar to see if a particular widget/shortcode/whatnot is used are quite high and one would have to do that for every single pagecall. one of the reasons why woo doesn’t do that either one suspects)28 April, 2018 at 10:24 am #36942People might disagree here – and that’s perfectly ok of course – but in my book, if you are using/loading a jquery ui-element you should also use (or at least offer the option to use) one of the themes/styles that are made for that purpose
(not to mention the convenience of not having to maintain it and automatically being able to take advantage of any improvements etc that might get added over time)1 May, 2018 at 10:52 pm #37011Hi Olly–
Would you consider an option that will deploy the spinner only on WPP pages?
That way those who disagree can toggle it that way.1 May, 2018 at 10:58 pm #37012that option already exists by not including/enabling the themeroller css and adding your own css for the spinner (presumably from copying it when creating your own themeroller css) somewhere
4 May, 2018 at 4:49 pm #37072What my programmer is saying (and oh course he can be wrong) is that switching the option off only disables the style and not the JS. So (as a result) adding another instance to style the spinner (only) will be complicated code wise.
Is he thinking about this wrongly?
4 May, 2018 at 5:53 pm #37073>switching the option off only disables the style and not the JS
that is correct. there is an awful lot of functionality attached to this spinner ui element which would not work if the js is not loaded4 May, 2018 at 6:06 pm #37074>So (as a result) adding another instance to style the spinner (only) will be complicated code wise.
why ? it’s just some style and has no bearing on the js.
(unless you force the ui-js to be added again too, for no reasons i can see)4 May, 2018 at 8:42 pm #37075For the record, this makes perfect sense to me. I don’t know why my guy (who’s typically savvy) is totally caught up. He’s convinced a fresh instance of themeroller needs to be installed.
Can you point me to example spinner CSS?
4 May, 2018 at 11:16 pm #37084you already know this from what i can make out…?!
http://jqueryui.com/download/#!version=1.11.4 - AuthorPosts
- The topic ‘Datepicker issue’ is closed to new replies.