Support » Plugin: VikBooking Hotel Booking Engine & PMS » Vikbooking_styles loading incorrectly on other language pages

  • Resolved nix255

    (@nix255)


    Hi,
    I have a problem with the vikbooking styles loading much later on the page in second languages, than in the original language. I will try to explain the setup and problem.

    I am using the WPML plugin and the base language is German (DE). However, I notice that the vikbooking plugin still has English at the base language, this isn’t a problem as everything works fine for the languages.

    The problem is with the css files. I am creating a custom theme, so any custom css I am adding to the theme.min.css file. This is overriding the vikbooking css correctly on the English page, but for all other languages the vikbooking_styles.css file is loading much later, right in the middle of the page (around line 880) and so the customisations in the theme are being overridden.

    Can you give me an idea as to why this would happen and what I can do? I don’t understand why it would load differently for the other languages.

    (P.S. It would be great if in the future your plugin would be WPML compatible).

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi,

    We obviously do not know your Theme or which “lazy-loading” techniques it uses, but first of all you should resolve the issue with the default website language because WPML is fully supported by Vik Booking as we’ve seen hundreds of our clients using it.

    Vik Booking reads the website default language by using the WordPress native functions, which could be manipulated by WPML. It should be sufficient to de-activate all WPML plugins and re-activate them later.

    Also, you can check the default language that is being read by Vik Booking by using its page “Global – Translations”. Choose a topic to translate from the apposite drop down menu on the right side of the page, and then you will see a list of tabs, one for each language. The very first language tab to the left is your default language, and this should match with the actual default language you want for your website. Moreover, all the contents of Vik Booking (such as the names and the descriptions of the rooms), should be written in the website default language.

    Going back to the lazy-loading issue: we’ve noticed from your website that the Theme is loading the main CSS file of Vik Booking in the so called “footer” of the page when English is not the active language. This looks like a behavior of your Theme (or child theme) which is loading all scripts and styles at the bottom of the body section of the source code. If you can’t find any settings to change this behavior in your theme, then we suggest to also load the CSS file for the customization in the “footer” of the page.

    Just for your information, you can place any CSS customization inside the apposite CSS file of Vik Booking, which can be modified from the Configuration page. This file should always be loaded after the main one, and so it should also resolve your issue.

    nix255

    (@nix255)

    Thank you for your very detailed reply.

    I have managed to fix the problem with the incorrect default language being shown in VIKBooking. It wasn’t enough to deactivate and reactivate WPML, I had to deactactivate WPML and then change the WordPress language in the settings, and then reactivate WPML. I think this is because the site’s default language was originally English and later changed to German. It now works correctly.

    I couldn’t solve the problem with the CSS file loading in the middle of the page. I look through the theme files but couldn’t see anywhere where it is loading the css in the footer or anywhere else. I am not sure where the problem is. I deactivated all plugins in case there was something causing it there, but the problem was still there.

    I have had to add the css to the custom css template in the VIK booking configuration. I hope this will not get overridden when the plugin updates.

    Plugin Author e4jvikwp

    (@e4jvikwp)

    Hi,

    We are glad to hear you solved the problem with WPML. For sure they registered a different default language for the website during the first installation.

    The issue with the loading of the main CSS file of Vik Booking is related to your Theme. All scripts and assets are being included in the “footer” of the page rather than in the “head” section. This is not something you could solve through Vik Booking.

    In any case, if you modified the custom CSS file from the Configuration page, then no future updates will ever touch it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.