Commit 16ee3f2a authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V4.3: Change <config> to <vmconfig> in the xml file, simplify UK postcode regexp

parent 3ba96dcc
This diff is collapsed.
......@@ -22,7 +22,7 @@
<scriptfile>rules_shipping.script.php</scriptfile>
<!-- VM 3.x support (fields rather than params): -->
<config>
<vmconfig>
<fields name="params" addfieldpath="/plugins/vmshipment/rules_shipping/fields">
<fieldset name="shipment" label="VMSHIPMENT_RULES_PLUGIN" addfieldpath="/administrator/components/com_virtuemart/fields">
<field type="vmcurl"/>
......@@ -86,7 +86,7 @@
</fieldset>
</fields>
</config>
</vmconfig>
<!-- VM 2.0 support (params rather than fields): -->
......
......@@ -68,7 +68,7 @@ class plgVmShipmentRules_Shipping_Advanced extends plgVmShipmentRules_Shipping_B
// Postal code Check for UK postal codes: Use regexp to determine if ZIP structure matches and also to extract the parts.
// Also handle UK overseas areas/islands that use four-letter outward codes rather than "A{1,2}0{1,2}A{0,1} 0AA"
if (isset($zip) and preg_match('/^\s*(([A-Za-z]{1,2})(\d{1,2})([A-Za-z]?)|[A-Za-z]{4})\s*(\d[A-Za-z]{2})\s*$/', $zip, $match)) {
if (isset($zip) and preg_match('/^\s*(([A-Z]{1,2})(\d{1,2})([A-Z]?)|[A-Z]{4}|GIR)\s*(\d[A-Z]{2})\s*$/', $zip, $match)) {
$values['uk_outward'] = $match[1];
$values['uk_area'] = $match[2];
$values['uk_district'] = $match[3];
......
......@@ -22,7 +22,7 @@
<scriptfile>rules_shipping_advanced.script.php</scriptfile>
<!-- VM 3.0 support (fields rather than params): -->
<config>
<vmconfig>
<fields name="params" addfieldpath="/plugins/vmshipment/rules_shipping/fields">
<fieldset name="shipment" label="VMSHIPMENT_RULES_PLUGIN_ADV" addfieldpath="/administrator/components/com_virtuemart/fields">
<field type="vmcurl"/>
......@@ -86,7 +86,7 @@
</fieldset>
</fields>
</config>
</vmconfig>
<!-- VM 2.0 support (params rather than fields): -->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment