Installing Booking and Calendar on Personal Site


  • Newcomer

    Ok perfect thanks for the quick reply. Last question, I went to this link to view my property and it says its broke. Did i forget something when setting up my property?

    Thanks



  • @Ismael-Burciaga That looks like it might be a bug. Could you report that using the “Support” button in MyVR or using our public contact page? There’s also a handy “Report an Issue” button on the home page of the MyVR Community.

    Thanks,
    Danny


  • Newcomer

    Danny thanks for the reply.

    Ok so I have added the correct code onto my wordpress site for the booking button and the calendar but not sure why it keeps taking me to myVR when i visit the page:

    CODE IN HEAD:

    <script type=“text/javascript” src=“https://static.myvr.com/public/myvrjs/v1/myvr.js”></script>
    <script type=“text/javascript”>
    myvr.init(“LIVE_5fa27a801402eb92ef1f4ec27e0a8672”);
    </script>

    CODE IN PAGE TEMPLATE:

    		<div class="booking-form">
    		
    			<div class="myvr-calendar">
    				<script id='myvrCalendarScript' type='text/javascript'>
    				  (function(m,y,v,r,t,a,g){m.MyVRWidgetObject=t,m[t]=m[t]||function(){
    				  (m[t].q=m[t].q||[]).push(arguments);},m[t].l=1*new Date(),a=y.createElement(v),
    				  g=y.getElementsByTagName(v)[0],a.async=1,a.src=r,g.parentNode.insertBefore(a,g);
    				  }(window,document,'script','https://static.myvr.com/public/calendar/widget.js','myvr'));
    				  myvr('calendar', {propertyKey:'8b5a23c3c939090d', showRates:false});
    				
    				  /*
    				    You can optionally specify a unique HTML element id as a 3rd parameter
    				    above.  If specified, the calendar will be rendered at the element
    				    instead of inline.
    				
    				    myvr('calendar', {
    				      propertyKey:'8b5a23c3c939090d',
    				      showRates:false,
    				      elementId:'#elementId'
    				    });
    				  */
    				</script>
    
    			</div>
    
    
    			<script type='text/javascript'>
    			    var _myvr = _myvr || {};
    			    _myvr.bookingButtons = _myvr.bookingButtons || [];
    			    _myvr.bookingButtons.push({
    			        property: '8b5a23c3c939090d',
    			        text: 'Book Now',
    			        index: _myvr.bookingButtons.length,
    			        id: ''
    			    });
    			    (function(buttonIndex) {
    			        var allScripts = document.getElementsByTagName('script');
    			        var thisScript = allScripts[allScripts.length -1];
    			        thisScript.id = 'myvrBookingButtonScript_' + buttonIndex;
    			        if (!document.getElementById('myvrBookingButtonScriptLoader')) {
    			            var bookingButton = document.createElement('script');
    			            bookingButton.type = 'text/javascript';
    			            bookingButton.async = true;
    			            bookingButton.id = 'myvrBookingButtonScriptLoader';
    			            bookingButton.src = ('https:' == document.location.protocol ? 'https://' : 'http://')
    			                + 'static.myvr.com/public/booking-button/widget.js';
    			            var s = document.getElementsByTagName('script')[0];
    			            s.parentNode.insertBefore(bookingButton, s);
    			        }
    			    })(_myvr.bookingButtons.length - 1);
    			</script>
    
    
    		</div>
    

    PAGE I HAVE THE CODE ON: http://184.168.30.222/~buttercuphaven/the-property/

    Is there something I am doing wrong?

    Thanks


  • MyVR Employee

    @Ismael-Burciaga Looking at your page source I see other invalid code in there.

    <script>
    					var promise = myvr.book({
    					    property: "b6b0f2fe278f612b",
    					    adults: 1,
    					    children: 1,
    					    checkIn: "2016-01-01",
    					    checkOut: "2016-02-01",
    					    addons: ["caeb9c167089c18e", "99676ebdd62342e3"],
    					});					
    				</script>
    

    For example.

    My suggestion: clean up and remove all of the javascript in your page, and use the booking link provided to you in the widget for your book now button.


  • Newcomer

    Hello tristan,

    Where did you see that code at? I looked at my page-template and didnt see

    <script>
    var promise = myvr.book({
    property: “b6b0f2fe278f612b”,
    adults: 1,
    children: 1,
    checkIn: “2016-01-01”,
    checkOut: “2016-02-01”,
    addons: [“caeb9c167089c18e”, “99676ebdd62342e3”],
    });
    </script>

    Thanks


  • Newcomer

    OH man I was putting the code on the wrong page template… Ok if i have any other issues, I will ping you.


  • Newcomer

    Ok So i see the book now button but now I dont see my calendar. I used the code:

    			<div class="myvr-calendar">
    				<script id='myvrCalendarScript' type='text/javascript'>
    				  (function(m,y,v,r,t,a,g){m.MyVRWidgetObject=t,m[t]=m[t]||function(){
    				  (m[t].q=m[t].q||[]).push(arguments);},m[t].l=1*new Date(),a=y.createElement(v),
    				  g=y.getElementsByTagName(v)[0],a.async=1,a.src=r,g.parentNode.insertBefore(a,g);
    				  }(window,document,'script','https://static.myvr.com/public/calendar/widget.js','myvr'));
    				  myvr('calendar', {propertyKey:'8b5a23c3c939090d', showRates:false});
    				
    				  /*
    				    You can optionally specify a unique HTML element id as a 3rd parameter
    				    above.  If specified, the calendar will be rendered at the element
    				    instead of inline.
    				
    				    myvr('calendar', {
    				      propertyKey:'8b5a23c3c939090d',
    				      showRates:false,
    				      elementId:'#elementId'
    				    });
    				  */
    				</script>
    
    			</div>
    

    Thanks



  • Hi Ismael,

    The issue is that you still have some MyVR.js code on your page that is preventing the calendar widget from working properly. If you remove the following bits of code, the calendar should work.

    <script type="text/javascript" src="https://static.myvr.com/public/myvrjs/v1/myvr.js"></script>
    
    <script type="text/javascript">
      myvr.init("LIVE_5fa27a801402eb92ef1f4ec27e0a8672");
    </script>
    

    Here is an example with those lines of code commented out. You can see that the calendar appears. If you uncomment the lines of code (e.g. remove the <!-- -->), you will see that the calendar stops working.

    Best,
    Danny


  • Newcomer

    Danny Thanks. I will remove that.

    Also, my client is wanting the GET A QUOTE page like this page: http://www.sonomasquarecottage.com/rates-and-calendar/ who is using your service.

    Is that a form you offer your customers too if someone has their own website? like maybe a link similar to the BOOK NOW link?

    Thanks
    Ismael



  • Also, my client is wanting the GET A QUOTE page like this page: >http://www.sonomasquarecottage.com/rates-and-calendar/ who is using your service.

    Is that a form you offer your customers too if someone has their own website? like maybe a link similar to the BOOK NOW link?

    Unfortunatly we do not offer a pre-built widget to get a quote. If you are comfortable writing custom HTML and JS, you can create your own form and use the MyVR.js Quote function to get a quote based on user input. However, as I mentioned earlier, using both MyVR.js and widgets on the same page can cause issues.


Log in to reply
 

About the MyVR Community

Looks like your connection to MyVR Community was lost, please wait while we try to reconnect.