Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
<?php
// $Id: malaysia_88_1.cif,v 1.5 2008/07/10 12:41:06 successideaweb.com Exp $
function malaysia_install() {
// VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
db_query("INSERT INTO {uc_countries} VALUES (88, 'Malaysia', 'MY', 'MY', 1)");
db_query("INSERT INTO {uc_zones} (zone_country_id, zone_code, zone_name) VALUES "
."(88, 'JH', 'Johor'),"
."(88, 'KD', 'Kedah'),"
."(88, 'KN', 'Kelantan'),"
."(88, 'KL', 'Kuala Lumpur'),"
."(88, 'ML', 'Malacca'),"
."(88, 'NS', 'Negeri Sembilan'),"
."(88, 'PH', 'Pahang'),"
."(88, 'PK', 'Perak'),"
."(88, 'PS', 'Perlis'),"
."(88, 'PG', 'Penang'),"
."(88, 'WP', 'Wilayah Persekutuan'),"
."(88, 'SL', 'Selangor'),"
."(88, 'TR', 'Terengganu'),"
."(88, 'LB', 'Labuan'),"
."(88, 'SB', 'Sabah'),"
."(88, 'SR', 'Sarawak')");
variable_set('uc_address_format_88',
"!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
."\r\n!city, !zone_code !postal_code\r\n!country_name_if");
}
Comment | File | Size | Author |
---|---|---|---|
#3 | malaysia.patch | 1.34 KB | alpritt |
Comments
Comment #1
alpritt CreditAttribution: alpritt commentedId at top is filled in automatically so that line should just read
// $Id$
Country codes are wrong. The code should be 458. And the 3 digit code should be MYS.
There is a helper function called uc_set_address_format() to use instead of the variable set.
Technically this isn't a patch.
Comment #2
najibx CreditAttribution: najibx commentedThanks. Not a patch. It just was not in the folder. So I added on my own and actually I was copying USA and didn't read the docs. Just wondering how can I have all the counntry without importing the xx.cif file one by one? Furthermore, I don't see the uc_zones being used like Dependant filed as per country?
It should like below?
Comment #3
alpritt CreditAttribution: alpritt commentedNot sure about how to add new files in patches for bzr, but hopefully this is fine.
Should the zone codes be tested against a payment gateway?
Comment #4
rszrama CreditAttribution: rszrama commentedThe values should be checked against Wikipedia for the ISO-3166 names and codes. Unfortunately, I didn't do this before replacing the other contributed version of this .cif on UC.org. This file has some names wrong, and one that was totally wrong. I updated the zones and abbreviations based on these two pages on Wikipedia:
http://en.wikipedia.org/wiki/ISO_3166-2:MY
http://en.wikipedia.org/wiki/States_of_Malaysia
I'm adding this to both branches.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
ckngReopen, as for the malaysia_458_1.cif included in ubercart, the db_query portion is wrong.
Comment #7
YesCT CreditAttribution: YesCT commentedI might be confused, but the recent version I got out of the bazaar dev has that line already correct.