Skip to content
form.tpl 3.44 KiB
Newer Older
* 2007-2014 PrestaShop
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to so we can send you a copy immediately.
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to for more information.
*  @author PrestaShop SA <>
*  @copyright  2007-2014 PrestaShop SA
*  @license  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
{extends file="helpers/form/form.tpl"}
{block name="label"}
	{if $ == 'zipcode' && isset($input.label)}
		<label id="zipcode-label" class="control-label col-lg-3 ">{$input.label}</label>
	{elseif $ == 'states[]'}
		<label id="states-label" class="control-label col-lg-3 ">{$input.label}</label>

{block name="script"}
	$(document).ready(function() {
		$('#country').click(function() {
			populateStates($(this).val(), '');
		$('#desc-tax_rules_group-new').click(function() {
			return false;
	function populateStates(id_country, id_state)
		if ($("#country option:selected").size() > 1)

		} else {
Rémi Gaillard's avatar
Rémi Gaillard committed
				url: "index.php",
				cache: false,
Rémi Gaillard's avatar
Rémi Gaillard committed
				data: "ajax=1&tab=AdminStates&token={getAdminToken tab='AdminStates'}&action=states&id_country="+id_country+"&id_state="+id_state+"&empty_value={l s='All'}",
				success: function(html){
					if (html == "false")


	function loadTaxRule(id_tax_rule)
			type: 'POST',
Rémi Gaillard's avatar
Rémi Gaillard committed
			url: 'index.php',
			async: true,
			dataType: 'json',
Rémi Gaillard's avatar
Rémi Gaillard committed
			data: 'ajax=1&tab=AdminTaxRulesGroup&token={getAdminToken tab='AdminTaxRulesGroup'}&ajaxStates=1&action=updateTaxRule&id_tax_rule='+id_tax_rule,
			success: function(data){

				zipcode = 0;
				if (data.zipcode_from != 0)
					zipcode = data.zipcode_from;

					if (data.zipcode_to != 0)
						zipcode = zipcode +"-"+data.zipcode_to


				populateStates(data.id_country, data.id_state);

	function initForm()