I'm building a OCmod to show the Europe map instead of the World map in de Admin Dashboard.
Somehow it's not all working, the change of the js-vmap works and also the language change. No errors in the logs.
I'm using the following code;
Code: Select all
<modification>
<name>JQVMap Europe</name>
<version>1.0</version>
<author>NoSite.nl</author>
<link>http://nosite.nl/</link>
<code>admin_jqvmap_europe_ocmod</code>
<file path="admin/view/template/dashboard/map.tpl">
<operation error="log">
<search <![CDATA[
<script type="text/javascript" src="view/javascript/jquery/jqvmap/maps/jquery.vmap.world.js"></script>
]]></search>
<add position="replace"><![CDATA[
<script type="text/javascript" src="view/javascript/jquery/jqvmap/maps/jquery.vmap.europe.js"></script>
]]></add>
<search ><![CDATA[
<script type="text/javascript"><!--
$(document).ready(function() {
$.ajax({
url: 'index.php?route=dashboard/map/map&token=<?php echo $token; ?>',
dataType: 'json',
success: function(json) {
data = [];
for (i in json) {
data[i] = json[i]['total'];
}
$('#vmap').vectorMap({
map: 'world_en',
backgroundColor: '#FFFFFF',
borderColor: '#FFFFFF',
color: '#9FD5F1',
hoverOpacity: 0.7,
selectedColor: '#666666',
enableZoom: true,
showTooltip: true,
values: data,
normalizeFunction: 'polynomial',
onLabelShow: function(event, label, code) {
if (json[code]) {
label.html('<strong>' + label.text() + '</strong><br />' + '<?php echo $text_order; ?> ' + json[code]['total'] + '<br />' + '<?php echo $text_sale; ?> ' + json[code]['amount']);
}
}
});
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
//--></script>
]]></search>
<add position="replace"><![CDATA[
<script type="text/javascript"><!--
$(document).ready(function() {
$.ajax({
url: 'index.php?route=dashboard/map/map&token=<?php echo $token; ?>',
dataType: 'json',
success: function(json) {
data = [];
for (i in json) {
data[i] = json[i]['total'];
}
$('#vmap').vectorMap({
map: 'europe_en',
backgroundColor: '#FFFFFF',
borderColor: '#FFFFFF',
color: '#9FD5F1',
hoverOpacity: 0.7,
selectedColor: '#666666',
enableZoom: true,
showTooltip: true,
values: data,
normalizeFunction: 'polynomial',
onLabelShow: function(event, label, code) {
if (json[code]) {
label.html('<strong>' + label.text() + '</strong><br />' + '<?php echo $text_order; ?> ' + json[code]['total'] + '<br />' + '<?php echo $text_sale; ?> ' + json[code]['amount']);
}
}
});
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
//--></script>
]]></add>
</operation>
</file>
<file path="admin/language/english/dashboard/map.php">
<operation error="log">
<search ><![CDATA[
$_['heading_title'] = 'World Map';
]]></search>
<add position="replace"><![CDATA[
$_['heading_title'] = 'Europe Map';
]]></add>
</operation>
</file>
</modification>
Any tips/solutions/etc?
Thanks!