Pass Query String from Parent to iFrame in ISC Page

Problem

We have an iframe page for package tracking, we want to pre-filled tracking number in the tracking page form and send the direct link to customers

Solution

With this mod, we can send this URL to customer

 https://www.moddiy.com/pages/Package-Tracking.html?track=LD006270920HK

The query string will pass to the iframe src

<iframe src="https://www.moddiy.com/track/index.php?track=LD006270920HK" width="100%" height="850" frameborder="0"></iframe>

Finally the tracking page script /track/index.php will pre-fill the tracking number in the tracking widget

In /includes/classes/class.page.php

Find

$GLOBALS['PageContent'] = $this->_pagecontent;

Replace

if(isset($_GET['track']) && ctype_alnum($_GET['track'])){
	$this->_pagecontent = str_replace("https://www.moddiy.com/track/index.php", "https://www.moddiy.com/track/index.php?track=".$_GET['track'], $this->_pagecontent);
}
$GLOBALS['PageContent'] = $this->_pagecontent;

Leave a Reply

Your email address will not be published. Required fields are marked *