* @copyright PrestaShop * @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0 * @version 1.3 * */ include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); class AdminStates extends AdminTab { public function __construct() { $this->table = 'state'; $this->className = 'State'; $this->edit = true; $this->delete = true; $this->fieldsDisplay = array( 'id_state' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 140, 'filter_key' => 'a!name'), 'iso_code' => array('title' => $this->l('ISO code'), 'align' => 'center', 'width' => 50), 'zone' => array('title' => $this->l('Zone'), 'width' => 100, 'filter_key' => 'z!name')); $this->_select = 'z.`name` AS zone'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'zone` z ON (z.`id_zone` = a.`id_zone`)'; parent::__construct(); } public function displayForm($isMainTab = true) { global $currentIndex, $cookie; parent::displayForm(); $obj = $this->loadObject(true); echo '
'.($obj->id ? '' : '').'
'.$this->l('States').'
*

'.$this->l('State name to display in addresses and on invoices').'

*

'.$this->l('1 to 4 letter ISO code').' ('.$this->l('official list here').')

'.$this->l('Country where state, region or city is located').'

'.$this->l('Geographical zone where this state is located').'
'.$this->l('Used for shipping').'

id OR $this->getFieldValue($obj, 'tax_behavior') == PS_PRODUCT_TAX) ? 'checked="checked" ' : '').'/> getFieldValue($obj, 'tax_behavior') == PS_STATE_TAX AND $obj->id) ? 'checked="checked" ' : '').'/> getFieldValue($obj, 'tax_behavior') == PS_BOTH_TAX AND $obj->id) ? 'checked="checked" ' : '').'/>

'.$this->l('Chose how tax will be applied for this state: the product\'s tax, the state\'s tax, or both.').'

id OR $this->getFieldValue($obj, 'active')) ? 'checked="checked" ' : '').'/> getFieldValue($obj, 'active') AND $obj->id) ? 'checked="checked" ' : '').'/>

'.$this->l('Enabled or disabled').'

* '.$this->l('Required field').'
'; } } ?>