first commit
This commit is contained in:
62
modules/dpdpoland/views/templates/hook/pudo.tpl
Normal file
62
modules/dpdpoland/views/templates/hook/pudo.tpl
Normal file
@@ -0,0 +1,62 @@
|
||||
{** 2019 DPD Polska Sp. z o.o.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* prestashop@dpd.com.pl so we can send you a copy immediately.
|
||||
*
|
||||
* @author DPD Polska Sp. z o.o.
|
||||
* @copyright 2019 DPD Polska Sp. z o.o.
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of DPD Polska Sp. z o.o.
|
||||
*}
|
||||
|
||||
<div class="pudo-map-container">
|
||||
<script id="dpd-widget" type="text/javascript">
|
||||
var id_pudo_carrier = '{$id_pudo_carrier|intval}';
|
||||
|
||||
function pointSelected(pudoCode)
|
||||
{
|
||||
dpdPolandPointId = pudoCode;
|
||||
$.ajax("{$dpdpoland_ajax_uri|escape:'htmlall':'UTF-8'}", {
|
||||
data: {
|
||||
'pudo_code': pudoCode,
|
||||
'save_pudo_id': 1,
|
||||
'token': "{$dpdpoland_token|escape:'htmlall':'UTF-8'}",
|
||||
'id_cart': "{$dpdpoland_cart|intval}"
|
||||
}
|
||||
});
|
||||
togglePudoMap();
|
||||
togglePudoMap17();
|
||||
togglePudoMap14();
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
const iframe = document.createElement("iframe");
|
||||
iframe.src = '//pudofinder.dpd.com.pl/widget?key=1ae3418e27627ab52bebdcc1a958fa04';
|
||||
iframe.style.width = "100%";
|
||||
iframe.style.border = "none";
|
||||
iframe.style.minHeight = "400px";
|
||||
|
||||
const script = document.getElementById("dpd-widget");
|
||||
script.parentNode.insertBefore(iframe, script);
|
||||
|
||||
const eventListener = window[window.addEventListener ? "addEventListener" : "attachEvent"];
|
||||
const messageEvent = ("attachEvent" == eventListener)? "onmessage" : "message";
|
||||
eventListener(messageEvent, function(a) {
|
||||
if(a.data.height && !isNaN(a.data.height)){
|
||||
iframe.style.height = a.data.height + "px"
|
||||
}else if( a.data.point_id){
|
||||
pointSelected(a.data.point_id);
|
||||
}
|
||||
}, !1);
|
||||
|
||||
</script>
|
||||
<br /><br />
|
||||
</div>
|
||||
Reference in New Issue
Block a user