Hello,
I need to integrate a 3rd party booking system search bar and have been provided with the code to do this, which contains 2 php calls which load further JS. I can test run this locally fine in standard php via MAMP but can't get anything loading in MODX when using snippets to call the provided php.
The following is what I’ve been provided with (I changed the domain name here).
This loads a form and fetches a JS file:
<?php
echo file_get_contents("http://accommodation.thedomainname.com/rentals/formularioMiniOptimized.php?bk=bk_thedomainname&Idioma=EN&Fajax=1");
?>
This just loads a bunch of external JS assets:
<?php
echo file_get_contents("http://accommodation.thedomainname.com/rentals/includeJs.php?bk=bk_thedomainname&tipo=formulario");
?>
Firstly I changed
'echo' to
'return' and then just added the 2 code blocks verbatim into a couple of new snippets respectively, however, when I call these snippets I'm getting zero return. I've tried calling them cached/uncached but with no joy. Both snippets do actually work as I added a simple text string which renders fine.
Can anyone advise on how I can get a return from these snippets with the code provided?
For the record I have tried this whole shebang with only the form and external JS assets, i.e. without the need for any php call/snippets, plus loading the JS more performantly. But that is throwing console errors and various other malarkey so I’m looking at the original suggestion.
Here's the build setup:
MODX Revolution: 2.5.7-pl (traditional)
PHP Version: 5.6.30
MySQL Client API version: mysqlnd 5.0.11-dev (from phpinfo file)
Database client version: libmysql - 5.1.73 (from phpMyAdmin)
Server version: 5.6.35 - MySQL Community Server (GPL) (from phpMyAdmin)
Protocol version: 10
Thanks in advance.