Trying to ad the world to a gwo zone, i did succesfully use this for 1.4.9.3 a while back as you will see above.
The code i'm using is taken from above in two places:
Find:
CODE: SELECT ALL
Code: Select all
<a onclick="addGeoZone();" class="button"><span><?php echo $button_utton_add_geo_zone; ?></span></a>
CODE: SELECT ALL
Code: Select all
<a onclick="addAllGeoZones();" class="button"><span>Add All Countries</span></a>
Find:
CODE: SELECT ALL
Code: Select all
function addGeoZone() {
THIS IS THE CORRECTION FROM TONNAER
Before, add:(I changed the fix a bit to cut down on the ajax requests (calling for each of the 180+ countries to get their zones was killing my browser , so the new button code of IBBoard is fine , and the code to place at the end of the page becomes:)
Code: Select all
<script type="text/javascript"><!--
function addAllGeoZones() {
<?php foreach ($countries as $country) { ?>
html = '<tbody id="zone_to_geo_zone_row' + zone_to_geo_zone_row + '">';
html += '<tr>';
html += '<td class="left"><select name="zone_to_geo_zone[' + zone_to_geo_zone_row + '][country_id]" id="country' + zone_to_geo_zone_row + '" onchange="$(\'#zone' + zone_to_geo_zone_row + '\').load(\'index.php?route=localisation/geo_zone/zone&token=<?php echo $token; ?>&country_id=\' + this.value + \'&zone_id=0\');">';
html += '<option value="<?php echo $country['country_id']; ?>"><?php echo addslashes($country['name']); ?></option>';
html += '</select></td>';
html += '<td class="left"><select name="zone_to_geo_zone[' + zone_to_geo_zone_row + '][zone_id]" id="zone' + zone_to_geo_zone_row + '"><option value="0">All zones</option></select></td>';
html += '<td class="left"><a onclick="$(\'#zone_to_geo_zone_row' + zone_to_geo_zone_row + '\').remove();" class="button"><span><?php echo $button_remove; ?></span></a></td>';
html += '</tr>';
html += '</tbody>';
$('#zone_to_geo_zone > tfoot').before(html);
zone_to_geo_zone_row++;
<?php } ?>
}
//--></script>
At the moment though, the button does nothing when clicked?
I don;t like the SQL methods above as it's not usable for a client etc...
Can anyone try to help me fix this for 1.5.0.5 as i was under the impression that this hadn't changed since 1.4x?
Thanks Guys!
Chris