New Landing How can we help? Atelier Adding external Resdiary Script

Viewing 15 posts - 1 through 15 (of 15 total)
  • Posted in: Atelier
  • #280567
    freddagg
    Member
    Post count: 20

    Hi. Having issues adding external resdiary script into theme. Ive tested with default twentyfourteen theme and works ok.
    Script just asks to add div to page, then scripts to end of body just before closing tag.
    Ive tried this via, enqueue in functions file of child theme… via admin panel script injection, and via custom footer file in child theme… no luck to date.

    Script is :

    
    <!-- Go to www.resdiary.com booking widget -->
    <div id="booking-widget-container"></div> 

    into the page.

    Then (edited for security)

    <script type="text/javascript">
        var booking_deploy = '';
        var booking_channel = 'online';
        var booking_restaurant_id = '***';
        var booking_theme = '***';
        var booking_redirect = 'https://www.resdiary.com/Restaurant/----';
        var booking_style = 'tall';
        var booking_redirect_behavior = 'resdiary';
        var booking_modal_theme  = '***';
    </script>
    <script src="https://bookwith.resdiary.com/booking/js/booking-mini-widget.js" type="text/javascript"></script>
    

    I can see the div and code loading into source of page, So any ideas why this feature is not working within the theme?

    Thanks, John.

    #280613
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please open to edit the functions.php file of child theme and put your given below of code.

    <?php
    
    function add_this_script_footer(){ ?>
    <!-- Go to www.resdiary.com booking widget -->
    <div id="booking-widget-container"></div> 
    
    <script type="text/javascript">
        var booking_deploy = '';
        var booking_channel = 'online';
        var booking_restaurant_id = '***';
        var booking_theme = '***';
        var booking_redirect = 'https://www.resdiary.com/Restaurant/----';
        var booking_style = 'tall';
        var booking_redirect_behavior = 'resdiary';
        var booking_modal_theme  = '***';
    </script>
    <script src="https://bookwith.resdiary.com/booking/js/booking-mini-widget.js" type="text/javascript"></script>
    
    <?php } 
    
    add_action('wp_footer', 'add_this_script_footer'); ?>

    Thanks 🙂
    Mohammad

    #280667
    freddagg
    Member
    Post count: 20

    Hi, yes I had tried this before, and now have your code in the child theme. You can see it loading correctly into the page, and also the DIV to display this within page content, but still not working on the page.

    I cant seem to find any obvious errors within Firebug. As mentioned, the code works in default wordpress theme.
    Would you have any other ideas please?

    #280686
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me login detail to check and resolve the issue.
    Thanks
    Mohammad

    #280689
    freddagg
    Member
    Post count: 20
    This reply has been marked as private.
    #280698
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    What does this code?
    Thanks
    Mohammad

    #280699
    freddagg
    Member
    Post count: 20
    This reply has been marked as private.
    #280747
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You should add this code at footer.php of theme just after this code <?php wp_footer(); ?>.
    Thanks
    Mohammad

    #280754
    freddagg
    Member
    Post count: 20

    Hi Mohammad,
    I appreciate your time to support this, however we are not really making progress.

    Ive mentioned in my first post that Ive already tried to enqueue the script, then also add to the footer file. Ive even tried via Admin JS Box.

    Either way I can get the script loading on the page, and showing in source code…. however I cannot get it to work in this theme, but it does in the default wordpress themes.
    And Firebug does not show any specific script errors or anything on the page… so Im stumped as to why the ATELIER Theme would have this problem?
    Are you also wondering what the issue is? Please check the page.. you will see the scripts loading in, and the div its supposed to load into on the page.

    #280957
    freddagg
    Member
    Post count: 20

    Hello,
    This issue lies someone in the theme, or swift composer as the code works in default HTML page, as it does also in Default WordPress Themes.

    So can you help tell me why it doesn’t work in Atelier please?

    #281005
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    There are many scripts are loading double through your code. While it should load one time that is done by theme but your code load it again without check. That is cause to issue.
    Thanks
    Mohammad

    #281006
    freddagg
    Member
    Post count: 20

    Thanks. That was not the issue,.. I was currently playing with the theme and had it loading in twice.
    Ive loaded script in via an iframe and it’s working fine now.

    Thanks for your time. It’s obviously an issue with this theme and script conflict in some way.

    #281013
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I am glad that you managed to resolve the issue.
    Thanks
    Mohammad

    #281200
    freddagg
    Member
    Post count: 20

    Just out of interest, why would Atelier react like this… so the only way the external script works is to have it in an i-frame (which is not great for us).
    Ive tested again and there seems nothing I can do to get this script working within atelier theme (without the iframe method).
    I can see script in page code sucessfully, but it will not trigger and display in the page.

    Please tell me why this is? Its the first problem Ive had with such a great theme.

    #281547
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    I am not 100% sure, there would appear to be no JS errors visible which would make it hard to debug.

    Do you have any server settings/security plugins blocking the loading of external domain resources?

    Thanks,
    David.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register