July 1, 2014

Magento Define country regions for Australia

Just insert SQL following:
INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'AU', 'VIC', 'Victoria'), (NULL, 'AU', 'NSW', 'New South Wales'), (NULL, 'AU', 'QLD', 'Queensland'), (NULL, 'AU', 'ACT', 'Australian Captial Territory'), (NULL, 'AU', 'NT', 'Northern Territory'), (NULL, 'AU', 'WA', 'Western Australia'), (NULL, 'AU', 'SA', 'South Australia'), (NULL, 'AU', 'TAS', 'Tasmania'); INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`) VALUES ('en_AU', '485', 'Victoria'), ('en_AU', '486', 'South Australia'), ('en_AU', '487', 'Western Australia'), ('en_AU', '488', 'Northern Territory'), ('en_AU', '489', 'Queensland'), ('en_AU', '490', 'New South Wales'), ('en_AU', '491', 'Australian Capital Territory'), ('en_AU', '492', 'Tasmania');

February 25, 2014

Create select box month and year for payment form



<select id="expiration-month" name="payment[cc_exp_month]">
	<option value="">MM</option>
	<?php foreach (range(1,12) as $month): ?>
	<option value="<?php echo $month; ?>"><?php echo str_pad($month, 2, "0", STR_PAD_LEFT); ?></option>
	<?php endforeach; ?>
</select>

<select id="expiration-year" name="payment[cc_exp_year]">
	<option value="">YYYY</option>
	<?php foreach (range(date('Y'), date('Y') + 20) as $year): ?>
	<option value="<?php echo $year; ?>"><?php echo $year; ?></option>
	<?php endforeach; ?>
</select>
There was an error in this gadget