// merge 1.4 => 6117

This commit is contained in:
fBrignoli committed 2011-04-29 09:09:38 +00:00
1 parent eb254814c0
commit b8f460ed46
29 files changed
+195 -213

No files matched your search

+1 -1
View File
@@ -92,7 +92,7 @@ class AdminAttributes extends AdminTab
<div id="colorAttributeProperties" style="'.((Validate::isLoadedObject($obj) AND $obj->isColorAttribute()) ? 'display: block;' : 'display: none;').'"> <div id="colorAttributeProperties" style="'.((Validate::isLoadedObject($obj) AND $obj->isColorAttribute()) ? 'display: block;' : 'display: none;').'">
<label>'.$this->l('Color').'</label> <label>'.$this->l('Color').'</label>
<div class="margin-form"> <div class="margin-form">
<input type="color" data-hex="true" class="color mColorPickerInput" name="color" value="'.(Tools::getValue('color', $color) ? htmlentities(Tools::getValue('color', $color)) : '#000000').'" /> <sup>*</sup> <input width="20px" type="color" data-hex="true" class="color mColorPickerInput" name="color" value="'.(Tools::getValue('color', $color) ? htmlentities(Tools::getValue('color', $color)) : '#000000').'" /> <sup>*</sup>
<p class="clear">'.$this->l('HTML colors only (e.g.,').' "lightblue", "#CC6600")</p> <p class="clear">'.$this->l('HTML colors only (e.g.,').' "lightblue", "#CC6600")</p>
</div> </div>
<label>'.$this->l('Texture:').' </label> <label>'.$this->l('Texture:').' </label>
+53 -34
View File
@@ -692,7 +692,7 @@ class AdminOrders extends AdminTab
// '.$addressDelivery->country.($addressDelivery->id_state ? ' - '.$deliveryState->name : '').'<br /> // '.$addressDelivery->country.($addressDelivery->id_state ? ' - '.$deliveryState->name : '').'<br />
// '.(!empty($addressDelivery->phone) ? $addressDelivery->phone.'<br />' : '').' // '.(!empty($addressDelivery->phone) ? $addressDelivery->phone.'<br />' : '').'
// '.(!empty($addressDelivery->phone_mobile) ? $addressDelivery->phone_mobile.'<br />' : '').' // '.(!empty($addressDelivery->phone_mobile) ? $addressDelivery->phone_mobile.'<br />' : '').'
// '.(!empty($addressDelivery->other) ? '<hr />'.$addressDelivery->other.'<br />' : '').' .(!empty($addressDelivery->other) ? '<hr />'.$addressDelivery->other.'<br />' : '')
.'</fieldset> .'</fieldset>
</div> </div>
<div style="float: left; margin-left: 40px"> <div style="float: left; margin-left: 40px">
@@ -700,6 +700,8 @@ class AdminOrders extends AdminTab
<legend><img src="../img/admin/invoice.gif" alt="'.$this->l('Invoice address').'" />'.$this->l('Invoice address').'</legend> <legend><img src="../img/admin/invoice.gif" alt="'.$this->l('Invoice address').'" />'.$this->l('Invoice address').'</legend>
<div style="float: right"><a href="?tab=AdminAddresses&id_address='.$addressInvoice->id.'&addaddress&realedit=1&id_order='.$order->id.($addressDelivery->id == $addressInvoice->id ? '&address_type=2' : '').'&back='.urlencode($_SERVER['REQUEST_URI']).'&token='.Tools::getAdminToken('AdminAddresses'.(int)(Tab::getIdFromClassName('AdminAddresses')).(int)($cookie->id_employee)).'"><img src="../img/admin/edit.gif" /></a></div> <div style="float: right"><a href="?tab=AdminAddresses&id_address='.$addressInvoice->id.'&addaddress&realedit=1&id_order='.$order->id.($addressDelivery->id == $addressInvoice->id ? '&address_type=2' : '').'&back='.urlencode($_SERVER['REQUEST_URI']).'&token='.Tools::getAdminToken('AdminAddresses'.(int)(Tab::getIdFromClassName('AdminAddresses')).(int)($cookie->id_employee)).'"><img src="../img/admin/edit.gif" /></a></div>
'.$this->displayAddressDetail($addressInvoice) '.$this->displayAddressDetail($addressInvoice)
.(!empty($addressInvoice->other) ? '<hr />'.$addressInvoice->other.'<br />' : '')
.'</fieldset> .'</fieldset>
</div> </div>
<div class="clear">&nbsp;</div>'; <div class="clear">&nbsp;</div>';
@@ -930,7 +932,7 @@ class AdminOrders extends AdminTab
echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />'; echo '<br /><br /><a href="'.$currentIndex.'&token='.$this->token.'"><img src="../img/admin/arrow2.gif" /> '.$this->l('Back to list').'</a><br />';
} }
public function displayAddressDetail($address) public function displayAddressDetail($addressDelivery)
{ {
$optional_fields = array( $optional_fields = array(
'company' => 1 'company' => 1
@@ -938,49 +940,66 @@ class AdminOrders extends AdminTab
, 'phone_mobile' => 1 , 'phone_mobile' => 1
, 'address2' => 1 , 'address2' => 1
); );
$out_field_sep = ' ';
$out_line_sep = '<br />';
$out = ''; $out = '';
$address_datas = AddressFormat::getAddressCountryFormat($address->id_country); $lines_out = array();
$field_other = $address->other; $address_datas = explode("\n", AddressFormat::getAddressCountryFormat($addressDelivery->id_country));
$lines_out = $address->getOrderedValues(array(
'spacer' => ' '
, 'optional' => $optional_fields
)
, $address_datas);
$out = implode("<br />", $lines_out) .((!(is_null($field_other) || $field_other == '') )? '<hr />'.$field_other: ''); foreach ($address_datas as $fields_line)
{
$fields_arr = array();
$is_empty = true;
foreach(explode(' ',$fields_line) as $field_item)
{
$field_item = trim($field_item);
if (!empty($addressDelivery->$field_item))
{
$fields_arr[] = $this->_getAddressFieldValue($addressDelivery, $field_item);
$is_empty = false;
}
else
{
if (!isset($optional_fields[$field_item]))
{
$fields_arr[] = $this->_getAddressFieldValue($addressDelivery, $field_item);
$is_empty = false;
}
}
}
if (!$is_empty)
{
$tmp_line = implode($out_field_sep, $fields_arr);
$line_out[] = $tmp_line;
}
}
$out = implode($out_line_sep, $line_out);
return $out; return $out;
} }
/** private function _getAddressFieldValue(Address $address, $field_name)
* returns String array values according to the given string pattern
*
*/
public function getOrderedValues($address, $pattern, array $given_values = null)
{ {
$out = array(); $out = '';
if (!empty($fields) && $fields != '' && !is_null($address)) if(!empty($field_name) && $field_name!= '' && !is_null($address))
{ switch($field_name)
$sep = "\n";
$line_sep = ' ';
$lines = explode($sep, $pattern);
foreach ($lines as $one_line)
{ {
if(!empty($one_line) && $one_line!= '') // Note: add other cases as needed
{ case 'state':
$tmp_values = array(); $deliveryState = new State((int)($address->id_state));
$words = explode($line_sep, trim($one_line)); $out = (isset($deliveryState->name)) ? ' - '.$deliveryState->name : '';
$tmp_words = array(); break;
case 'state_iso':
$deliveryState = new State((int)($address->id_state));
$out = (isset($deliveryState->iso_code)) ? ' - '.$deliveryState->iso_code : '';
break;
// String append instead of Array append default:
foreach ($words as $one_word) $out = $address->$field_name;
$tmp_values[$one_word] = (is_null($given_values)) ? $address->{$one_word} : $given_values[$one_word];
$out[] = array($tmp_values, implode(' ', $tmp_values));
}
} }
}
return $out; return $out;
} }
+1 -1
View File
@@ -139,7 +139,7 @@ class AdminOrdersStates extends AdminTab
</div> </div>
<label>'.$this->l('Color:').' </label> <label>'.$this->l('Color:').' </label>
<div class="margin-form"> <div class="margin-form">
<input type="color" data-hex="true" class="color mColorPickerInput" name="color" value="'.htmlentities($this->getFieldValue($obj, 'color'), ENT_COMPAT, 'UTF-8').'" /> <input width="20px" type="color" data-hex="true" class="color mColorPickerInput" name="color" value="'.htmlentities($this->getFieldValue($obj, 'color'), ENT_COMPAT, 'UTF-8').'" />
<p>'.$this->l('Status will be highlighted in this color. HTML colors only (e.g.,').' "lightblue", "#CC6600")</p> <p>'.$this->l('Status will be highlighted in this color. HTML colors only (e.g.,').' "lightblue", "#CC6600")</p>
</div> </div>
<div class="margin-form"> <div class="margin-form">
+5
View File
@@ -748,9 +748,14 @@ class AdminTranslations extends AdminTab
if ($lang_packs!== false && $lang_packs != '' && $lang_packs = Tools::jsonDecode($lang_packs)) if ($lang_packs!== false && $lang_packs != '' && $lang_packs = Tools::jsonDecode($lang_packs))
{ {
echo '<select id="params_import_language" name="params_import_language">'; echo '<select id="params_import_language" name="params_import_language">';
echo '<optgroup label="'.$this->l('Add a language').'">';
$alreadyInstalled = '<optgroup label="'.$this->l('Update a language').'">';
foreach($lang_packs AS $lang_pack) foreach($lang_packs AS $lang_pack)
if (!Language::isInstalled($lang_pack->iso_code)) if (!Language::isInstalled($lang_pack->iso_code))
echo '<option value="'.$lang_pack->iso_code.'|'.$lang_pack->version.'">'.$lang_pack->name.'</option>'; echo '<option value="'.$lang_pack->iso_code.'|'.$lang_pack->version.'">'.$lang_pack->name.'</option>';
else
$alreadyInstalled.='<option value="'.$lang_pack->iso_code.'|'.$lang_pack->version.'">'.$lang_pack->name.'</option>';
echo '</optgroup>'.$alreadyInstalled.'</optgroup>';
echo '</select>'; echo '</select>';
} }
echo ' </div> echo ' </div>
-91
View File
@@ -216,97 +216,6 @@ class AddressCore extends ObjectModel
return $out; return $out;
} }
/**
* Returns values ordered in an array according to given fields
* @param array $config set options for the method formated as
$config = array(
'spacer' => ' '
, 'optional' => array(
'company' => 1
,'phone' => 1
)
, 'ignore' => array(
'phone_mobile' => 1
)
, 'return_set' => true (true: hash return, false: String array)
)
* @param String $pattern lines of each needed fields \n splitted
* @param array $values optionnal given values
* @return array field values or hash values
*/
public static function getOrderedValuesFromArray($config, $pattern, array $values = null)
{
$tmp_address = new Address();
$out = $tmp_address->getOrderedValues($config, $pattern, $values);
unset($tmp_address);
return $out;
}
/**
* Returns values ordered in an array according to given fields
* @param array $config set options for the method formated as
$config = array(
'spacer' => ' '
, 'optional' => array(
'company' => 1
,'phone' => 1
,'phone_mobile' => 1
)
, 'return_set' => true
)
* @param String $address_datas lines of each needed fields \n splitted
* @param array $given_values optionnal given values
* @return array field values or values in a hash
*/
public function getOrderedValues(array $config, $address_datas, array $given_values = null)
{
$spacer = $config["spacer"]; // String used for joining lines_out
$optional_fields = (isset($config["optional"]))? $config["optional"] : array(); // array hash tells which fields are optional
$ignore = (isset($config["ignore"]))? $config["ignore"] : array(); // array hash tells which fields are ignored
$return_set = (!empty($config["return_set"])) ? $config["return_set"] : false;
$line_breaker = "\n"; // used in address_datas format
$lines_out = array();
$fields_lines = explode($line_breaker, $address_datas);
foreach ($fields_lines as $one_line)
if(!empty($one_line) && $one_line!= '')
{
$tmp_values = array();
$val_added = false;
$words = explode(' ', trim($one_line));
$tmp_words = array();
foreach ($words as $one_word)
{
if (!isset($ignore[$one_word]))
{
$one_word = trim($one_word);
$val = (is_null($given_values)) ? $this->{$one_word} : $given_values[$one_word];
if ((!empty($val) && $val != '') || ((empty($val) || $val == '') && (isset($optional_fields[$one_word]) != 1)))
{
$tmp_values[$one_word] = $val;
$val_added = true;
}
}
}
if ($val_added)
$lines_out[] = ($return_set) ? $tmp_values : implode($spacer, $tmp_values);
}
return $lines_out;
}
public function getFields() public function getFields()
{ {
parent::validateFields(); parent::validateFields();
+24 -5
View File
@@ -60,6 +60,8 @@ class AddressFormatCore extends ObjectModel
$out = true; $out = true;
$addr_f_validate = Address::getFieldsValidate(); $addr_f_validate = Address::getFieldsValidate();
$addr_f_validate['state_iso'] = 1; // adding state iso code into allowed fields
$fields_format = explode("\n", $this->format); $fields_format = explode("\n", $this->format);
foreach($fields_format as $field_line) foreach($fields_format as $field_line)
{ {
@@ -74,19 +76,29 @@ class AddressFormatCore extends ObjectModel
return $out; return $out;
} }
/** /**
* Returns address format fields in array by country * Returns address format fields in array by country
* *
* @param Integer PS_COUNTRY.id * @param Integer PS_COUNTRY.id if null using default country
* @return Array String field address format * @return Array String field address format
*/ */
public static function getOrderedAddressFields($id_country) public static function getOrderedAddressFields($id_country = 0, $split_all = false)
{ {
$out = array(); $out = array();
$field_set = explode("\n", self::getAddressCountryFormat($id_country)); $field_set = explode("\n", self::getAddressCountryFormat($id_country));
foreach ($field_set as $field_item) foreach ($field_set as $field_item)
{ {
$out[] = trim($field_item); // $field_item = trim($field_item);
if ($split_all)
{
foreach(explode(' ',$field_item) as $word_item)
$out[] = trim($word_item);
}
else
$out[] = trim($field_item);
} }
return $out; return $out;
} }
@@ -97,9 +109,16 @@ class AddressFormatCore extends ObjectModel
* @param Integer PS_COUNTRY.id * @param Integer PS_COUNTRY.id
* @return String field address format * @return String field address format
*/ */
public static function getAddressCountryFormat($id_country) public static function getAddressCountryFormat($id_country = 0)
{ {
$out = ''; $out = '';
$id_country = (int) $id_country;
if ($id_country <= 0)
{
$selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT'));
}
$tmp_obj = new AddressFormat(); $tmp_obj = new AddressFormat();
$tmp_obj->id_country = $id_country; $tmp_obj->id_country = $id_country;
$out = $tmp_obj->getFormat($tmp_obj->id_country); $out = $tmp_obj->getFormat($tmp_obj->id_country);
@@ -131,7 +150,7 @@ class AddressFormatCore extends ObjectModel
FROM `'._DB_PREFIX_.$this->table.'` FROM `'._DB_PREFIX_.$this->table.'`
WHERE `id_country` = '.(int)($id_country)); WHERE `id_country` = '.(int)($id_country));
return isset($result['format']) ? $result['format'] : false; return isset($result['format']) ? trim($result['format']) : '';
} }
} }
+2 -2
View File
@@ -319,7 +319,7 @@ abstract class AdminTabCore
public function includeSubTab($methodname, $actions = array()) public function includeSubTab($methodname, $actions = array())
{ {
if (!isset($this->_includeTab) OR !is_array($this->_includeTab)) if (!isset($this->_includeTab) OR !is_array($this->_includeTab))
return ; return false;
$key = 0; $key = 0;
$inc = false; $inc = false;
foreach ($this->_includeTab as $subtab => $extraVars) foreach ($this->_includeTab as $subtab => $extraVars)
@@ -1553,7 +1553,7 @@ abstract class AdminTabCore
global $currentIndex, $cookie, $tab; global $currentIndex, $cookie, $tab;
if (!isset($this->_fieldsOptions) OR !sizeof($this->_fieldsOptions)) if (!isset($this->_fieldsOptions) OR !sizeof($this->_fieldsOptions))
return ; return false;
$defaultLanguage = (int)Configuration::get('PS_LANG_DEFAULT'); $defaultLanguage = (int)Configuration::get('PS_LANG_DEFAULT');
$this->_languages = Language::getLanguages(false); $this->_languages = Language::getLanguages(false);
+1 -1
View File
@@ -305,7 +305,7 @@ class CustomerCore extends ObjectModel
public function getAddresses($id_lang) public function getAddresses($id_lang)
{ {
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT a.*, cl.`name` AS country, s.name AS state SELECT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
FROM `'._DB_PREFIX_.'address` a FROM `'._DB_PREFIX_.'address` a
LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`) LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`)
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`) LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`)
+1
View File
@@ -146,6 +146,7 @@ class FeatureValueCore extends ObjectModel
LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.`id_feature_value` = fv.`id_feature_value`) LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.`id_feature_value` = fv.`id_feature_value`)
WHERE `value` = \''.pSQL($name).'\' WHERE `value` = \''.pSQL($name).'\'
AND fv.`id_feature` = '.(int)$id_feature.' AND fv.`id_feature` = '.(int)$id_feature.'
AND fv.`custom` = 0
GROUP BY fv.`id_feature_value` LIMIT 1'); GROUP BY fv.`id_feature_value` LIMIT 1');
if (!isset($rq[0]['id_feature_value']) OR !$id_feature_value = (int)$rq[0]['id_feature_value']) if (!isset($rq[0]['id_feature_value']) OR !$id_feature_value = (int)$rq[0]['id_feature_value'])
+3 -3
View File
@@ -79,7 +79,7 @@ class FrontControllerCore
return; return;
self::$initialized = true; self::$initialized = true;
if ($this->ssl AND !(empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) != 'off') AND Configuration::get('PS_SSL_ENABLED')) if ($this->ssl AND (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off') AND Configuration::get('PS_SSL_ENABLED'))
{ {
header('HTTP/1.1 301 Moved Permanently'); header('HTTP/1.1 301 Moved Permanently');
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']); header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
@@ -194,8 +194,8 @@ class FrontControllerCore
$navigationPipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>'); $navigationPipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>');
$smarty->assign('navigationPipe', $navigationPipe); $smarty->assign('navigationPipe', $navigationPipe);
$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? 'https://' : 'http://'; $protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
$protocol_content = ((isset($useSSL) AND $useSSL AND Configuration::get('PS_SSL_ENABLED')) OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? 'https://' : 'http://'; $protocol_content = ((isset($useSSL) AND $useSSL AND Configuration::get('PS_SSL_ENABLED')) OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';
if (!defined('_PS_BASE_URL_')) if (!defined('_PS_BASE_URL_'))
define('_PS_BASE_URL_', Tools::getShopDomain(true)); define('_PS_BASE_URL_', Tools::getShopDomain(true));
if (!defined('_PS_BASE_URL_SSL_')) if (!defined('_PS_BASE_URL_SSL_'))
+4 -3
View File
@@ -439,7 +439,8 @@ class PDFCore extends PDF_PageGroupCore
); );
$ignore_fields = array( $ignore_fields = array(
'phone' => 1 'phone' => 1
, 'mobile_phone' =>1 , 'mobile_phone' => 1
, 'state_iso' => 1
); );
$width = 100; $width = 100;
@@ -469,12 +470,12 @@ class PDFCore extends PDF_PageGroupCore
$tmp_dlv = $delivery_address->{$field_name}; $tmp_dlv = $delivery_address->{$field_name};
if (!((empty($tmp_inv) || $tmp_inv == '') && isset($optional_fields[$field_name]))) if (!((empty($tmp_inv) || $tmp_inv == '') && isset($optional_fields[$field_name])))
{ {
$tmp_inv = ($field_name == "country") ? $tmp_inv.($deliveryState ? ' - '.$deliveryState->name : ''): $tmp_inv; $tmp_inv = ($field_name == "country") ? $tmp_inv.($deliveryState ? ' - '.$deliveryState->iso_code : ''): $tmp_inv;
$tmp_inv_vals[] = Tools::iconv('utf-8', self::encoding(), $tmp_inv); $tmp_inv_vals[] = Tools::iconv('utf-8', self::encoding(), $tmp_inv);
} }
if (!((empty($tmp_dlv) || $tmp_dlv == '') && isset($optional_fields[$field_name]))) if (!((empty($tmp_dlv) || $tmp_dlv == '') && isset($optional_fields[$field_name])))
{ {
$tmp_dlv = ($field_name == "country") ? $tmp_dlv.($deliveryState ? ' - '.$deliveryState->name : ''): $tmp_dlv; $tmp_dlv = ($field_name == "country") ? $tmp_dlv.($deliveryState ? ' - '.$deliveryState->iso_code : ''): $tmp_dlv;
$tmp_dlv_vals[] = Tools::iconv('utf-8', self::encoding(), $tmp_dlv); $tmp_dlv_vals[] = Tools::iconv('utf-8', self::encoding(), $tmp_dlv);
} }
} }
-1
View File
@@ -88,7 +88,6 @@ abstract class PaymentModuleCore extends Module
* @param string $paymentMethod Payment method (eg. 'Credit card') * @param string $paymentMethod Payment method (eg. 'Credit card')
* @param string $message Message to attach to order * @param string $message Message to attach to order
*/ */
public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false) public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false)
{ {
global $cart; global $cart;
+18 -19
View File
@@ -1594,35 +1594,34 @@ class ProductCore extends ObjectModel
$quantity = ($id_cart AND $cart_quantity) ? $cart_quantity : $quantity; $quantity = ($id_cart AND $cart_quantity) ? $cart_quantity : $quantity;
$id_currency = (int)(Validate::isLoadedObject($cur_cart) ? $cur_cart->id_currency : ((isset($cookie->id_currency) AND (int)($cookie->id_currency)) ? $cookie->id_currency : Configuration::get('PS_CURRENCY_DEFAULT'))); $id_currency = (int)(Validate::isLoadedObject($cur_cart) ? $cur_cart->id_currency : ((isset($cookie->id_currency) AND (int)($cookie->id_currency)) ? $cookie->id_currency : Configuration::get('PS_CURRENCY_DEFAULT')));
// retrieve address informations // retrieve address informations
$id_country = (int)Country::getDefaultCountryId(); $id_country = (int)Country::getDefaultCountryId();
$id_state = 0; $id_state = 0;
$id_county = 0; $id_county = 0;
if (!$id_address) if (!$id_address)
{ $id_address = $cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')};
if ($id_address = $cur_cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')})
{
$address_infos = Address::getCountryAndState($id_address);
if ($address_infos['id_country'])
{
$id_country = (int)($address_infos['id_country']);
$id_state = (int)($address_infos['id_state']);
$postcode = (int)$address_infos['postcode'];
$id_county = (int)County::getIdCountyByZipCode($id_state, $postcode); if ($id_address)
} {
} else if (isset($cookie->id_country)) { $address_infos = Address::getCountryAndState($id_address);
// fetch address from cookie if ($address_infos['id_country'])
$id_country = (int)$cookie->id_country; {
$id_state = (int)$cookie->id_state; $id_country = (int)($address_infos['id_country']);
$postcode = (int)$cookie->postcode; $id_state = (int)($address_infos['id_state']);
$postcode = (int)$address_infos['postcode'];
$id_county = (int)County::getIdCountyByZipCode($id_state, $postcode); $id_county = (int)County::getIdCountyByZipCode($id_state, $postcode);
} }
}
elseif (isset($cookie->id_country))
{
// fetch address from cookie
$id_country = (int)$cookie->id_country;
$id_state = (int)$cookie->id_state;
$postcode = (int)$cookie->postcode;
$id_county = (int)County::getIdCountyByZipCode($id_state, $postcode);
} }
if (Tax::excludeTaxeOption()) if (Tax::excludeTaxeOption())
+1 -1
View File
@@ -219,7 +219,7 @@ class WebserviceRequestCore
$display_errors = strtolower(ini_get('display_errors')) != 'off'; $display_errors = strtolower(ini_get('display_errors')) != 'off';
// Error handler // Error handler
set_error_handler(array('WebserviceRequest', 'webserviceErrorHandler')); set_error_handler(array($this, 'webserviceErrorHandler'));
ini_set('html_errors', 'off'); ini_set('html_errors', 'off');
$this->_wsUrl = Tools::getHttpHost(true).__PS_BASE_URI__.'api/'; $this->_wsUrl = Tools::getHttpHost(true).__PS_BASE_URI__.'api/';
+1 -5
View File
@@ -9,7 +9,6 @@
<module name="blockcategories"/> <module name="blockcategories"/>
<module name="blockcms"/> <module name="blockcms"/>
<module name="blockcurrencies"/> <module name="blockcurrencies"/>
<module name="blockinfos"/>
<module name="blocklanguages"/> <module name="blocklanguages"/>
<module name="blocklayered"/> <module name="blocklayered"/>
<module name="blocklink"/> <module name="blocklink"/>
@@ -26,11 +25,10 @@
<module name="blocksupplier"/> <module name="blocksupplier"/>
<module name="blocktags"/> <module name="blocktags"/>
<module name="blockuserinfo"/> <module name="blockuserinfo"/>
<module name="blockvariouslinks"/>
<module name="blockviewed"/> <module name="blockviewed"/>
<module name="blockwishlist"/> <module name="blockwishlist"/>
<module name="canonicalurl"/>
<module name="cashondelivery"/> <module name="cashondelivery"/>
<module name="carriercompare"/>
<module name="cheque"/> <module name="cheque"/>
<module name="crossselling"/> <module name="crossselling"/>
<module name="dateofdelivery"/> <module name="dateofdelivery"/>
@@ -74,7 +72,6 @@
<module name="statsequipment"/> <module name="statsequipment"/>
<module name="statsforecast"/> <module name="statsforecast"/>
<module name="statsgeolocation"/> <module name="statsgeolocation"/>
<module name="statshome"/>
<module name="statslive"/> <module name="statslive"/>
<module name="statsnewsletter"/> <module name="statsnewsletter"/>
<module name="statsorigin"/> <module name="statsorigin"/>
@@ -110,7 +107,6 @@
<module name="ogone"/> <module name="ogone"/>
<module name="paysafecard"/> <module name="paysafecard"/>
<module name="paypal"/> <module name="paypal"/>
<module name="paypalapi"/>
<module name="reverso"/> <module name="reverso"/>
<module name="secuvad"/> <module name="secuvad"/>
<module name="socolissimo"/> <module name="socolissimo"/>
+11
View File
@@ -257,6 +257,15 @@ class AddressControllerCore extends FrontController
)); ));
} }
protected function _processAddressFormat()
{
$id_country = is_null($this->_address)? 0 : (int)$this->_address->id_country;
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($id_country, $split_all = true);
self::$smarty->assign('ordered_adr_fields', $dlv_adr_fields);
}
public function displayHeader() public function displayHeader()
{ {
if (Tools::getValue('ajax') != 'true') if (Tools::getValue('ajax') != 'true')
@@ -266,6 +275,8 @@ class AddressControllerCore extends FrontController
public function displayContent() public function displayContent()
{ {
parent::displayContent(); parent::displayContent();
$this->_processAddressFormat();
self::$smarty->display(_PS_THEME_DIR_.'address.tpl'); self::$smarty->display(_PS_THEME_DIR_.'address.tpl');
} }
+9 -8
View File
@@ -120,7 +120,7 @@ class OrderOpcControllerCore extends ParentOrderController
$blockUserInfo = new BlockUserInfo(); $blockUserInfo = new BlockUserInfo();
} }
self::$smarty->assign('isVirtualCart', self::$cart->isVirtualCart()); self::$smarty->assign('isVirtualCart', self::$cart->isVirtualCart());
$this->processAddressFormat(); $this->_processAddressFormat();
$this->_assignAddress(); $this->_assignAddress();
// Wrapping fees // Wrapping fees
$wrapping_fees = (float)(Configuration::get('PS_GIFT_WRAPPING_PRICE')); $wrapping_fees = (float)(Configuration::get('PS_GIFT_WRAPPING_PRICE'));
@@ -267,7 +267,7 @@ class OrderOpcControllerCore extends ParentOrderController
{ {
parent::displayContent(); parent::displayContent();
$this->processAddressFormat(); $this->_processAddressFormat();
self::$smarty->display(_PS_THEME_DIR_.'errors.tpl'); self::$smarty->display(_PS_THEME_DIR_.'errors.tpl');
self::$smarty->display(_PS_THEME_DIR_.'order-opc.tpl'); self::$smarty->display(_PS_THEME_DIR_.'order-opc.tpl');
@@ -450,11 +450,15 @@ class OrderOpcControllerCore extends ParentOrderController
return 0; return 0;
} }
protected function processAddressFormat() protected function _processAddressFormat()
{ {
$selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT')); $selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT'));
$inv_adr_fields = AddressFormat::getOrderedAddressFields($selectedCountry);
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($selectedCountry); $address_delivery = new Address((int)self::$cart->id_address_delivery);
$address_invoice = new Address((int)self::$cart->id_address_invoice);
$inv_adr_fields = AddressFormat::getOrderedAddressFields((int)$address_delivery->id_country);
$dlv_adr_fields = AddressFormat::getOrderedAddressFields((int)$address_invoice->id_country);
$inv_all_fields = array(); $inv_all_fields = array();
$dlv_all_fields = array(); $dlv_all_fields = array();
@@ -465,9 +469,6 @@ class OrderOpcControllerCore extends ParentOrderController
foreach(explode(' ',$fields_line) as $field_item) foreach(explode(' ',$fields_line) as $field_item)
${$adr_type.'_all_fields'}[] = trim($field_item); ${$adr_type.'_all_fields'}[] = trim($field_item);
// DEBUG echo('<br />processAddressFormat: inv_all_fields: ' . var_export($inv_all_fields, true)
// DEBUG .'<br />processAddressFormat: inv_all_fields: ' . var_export($dlv_all_fields, true));
self::$smarty->assign($adr_type.'_adr_fields', ${$adr_type.'_adr_fields'}); self::$smarty->assign($adr_type.'_adr_fields', ${$adr_type.'_adr_fields'});
self::$smarty->assign($adr_type.'_all_fields', ${$adr_type.'_all_fields'}); self::$smarty->assign($adr_type.'_all_fields', ${$adr_type.'_all_fields'});
+1 -3
View File
@@ -363,9 +363,7 @@ INSERT INTO `PREFIX_feature_product` (`id_feature`, `id_product`, `id_feature_va
(1, 1, 11),(1, 2, 15),(2, 1, 12),(2, 2, 16),(3, 1, 14),(3, 2, 18),(4, 1, 13),(4, 2, 17),(5, 1, 10),(5, 2, 10),(3, 7, 26),(5, 7, 9),(4, 7, 25),(2, 7, 24),(1, 7, 23); (1, 1, 11),(1, 2, 15),(2, 1, 12),(2, 2, 16),(3, 1, 14),(3, 2, 18),(4, 1, 13),(4, 2, 17),(5, 1, 10),(5, 2, 10),(3, 7, 26),(5, 7, 9),(4, 7, 25),(2, 7, 24),(1, 7, 23);
INSERT INTO `PREFIX_feature_value` (`id_feature_value`, `id_feature`, `custom`) VALUES INSERT INTO `PREFIX_feature_value` (`id_feature_value`, `id_feature`, `custom`) VALUES
(11, 1, 1),(15, 1, 1),(12, 2, 1),(16, 2, 1),(14, 3, 1),(18, 3, 1),(13, 4, 1),(17, 4, 1),(26, 3, 1),(25, 4, 1),(24, 2, 1),(23, 1, 1); (11, 1, 1),(15, 1, 1),(12, 2, 1),(16, 2, 1),(14, 3, 1),(18, 3, 1),(13, 4, 1),(17, 4, 1),(26, 3, 1),(25, 4, 1),(24, 2, 1),(23, 1, 1),(9, 5, 0),(10, 5, 0);
INSERT INTO `PREFIX_feature_value` (`id_feature_value`, `id_feature`, `custom`) VALUES (9, 5, NULL), (10, 5, NULL);
INSERT INTO `PREFIX_feature_value_lang` (`id_feature_value`, `id_lang`, `value`) VALUES INSERT INTO `PREFIX_feature_value_lang` (`id_feature_value`, `id_lang`, `value`) VALUES
(13, 1, '49.2 g'),(13, 2, '49,2 g'),(13, 3, '49,2 g'),(13, 4, '49.2 g'),(13, 5, '49.2 g'),(12, 2, '52,3 mm'),(12, 1, '2.06 in'),(12, 3, '52.3 mm'),(12, 4, '52.3 mm'),(12, 5, '52.3 mm'),(11, 2, '69,8 mm'),(11, 1, '2.75 in'),(11, 3, '69.8 mm'),(11, 4, '69.8 mm'),(11, 5, '69.8 mm'), (13, 1, '49.2 g'),(13, 2, '49,2 g'),(13, 3, '49,2 g'),(13, 4, '49.2 g'),(13, 5, '49.2 g'),(12, 2, '52,3 mm'),(12, 1, '2.06 in'),(12, 3, '52.3 mm'),(12, 4, '52.3 mm'),(12, 5, '52.3 mm'),(11, 2, '69,8 mm'),(11, 1, '2.75 in'),(11, 3, '69.8 mm'),(11, 4, '69.8 mm'),(11, 5, '69.8 mm'),
+5 -6
View File
@@ -332,7 +332,7 @@ INSERT INTO `PREFIX_country_lang` (`id_country`, `id_lang`, `name`) VALUES
(14, 1, 'Poland'),(14, 2, 'Pologne'),(14, 3, 'Polonia'),(15, 1, 'Portugal'),(15, 2, 'Portugal'),(15, 3, 'Portugal'), (14, 1, 'Poland'),(14, 2, 'Pologne'),(14, 3, 'Polonia'),(15, 1, 'Portugal'),(15, 2, 'Portugal'),(15, 3, 'Portugal'),
(16, 1, 'Czech Republic'),(16, 2, 'République Tchèque'),(16, 3, 'República Checa'),(17, 1, 'United Kingdom'),(17, 2, 'Royaume-Uni'),(17, 3, 'Reino Unido'), (16, 1, 'Czech Republic'),(16, 2, 'République Tchèque'),(16, 3, 'República Checa'),(17, 1, 'United Kingdom'),(17, 2, 'Royaume-Uni'),(17, 3, 'Reino Unido'),
(18, 1, 'Sweden'),(18, 2, 'Suède'),(18, 3, 'Suecia'),(19, 1, 'Switzerland'),(19, 2, 'Suisse'),(19, 3, 'Suiza'),(20, 1, 'Denmark'), (18, 1, 'Sweden'),(18, 2, 'Suède'),(18, 3, 'Suecia'),(19, 1, 'Switzerland'),(19, 2, 'Suisse'),(19, 3, 'Suiza'),(20, 1, 'Denmark'),
(20, 2, 'Danemark'),(20, 3, 'Dinamarca'),(21, 1, 'USA'),(21, 2, 'États-Unis'),(21, 3, 'EE.UU.'),(22, 1, 'HongKong'),(22, 2, 'Hong-Kong'), (20, 2, 'Danemark'),(20, 3, 'Dinamarca'),(21, 1, 'United States'),(21, 2, 'États-Unis'),(21, 3, 'EE.UU.'),(22, 1, 'HongKong'),(22, 2, 'Hong-Kong'),
(22, 3, 'Hong Kong'),(23, 1, 'Norway'),(23, 2, 'Norvège'),(23, 3, 'Noruega'),(24, 1, 'Australia'),(24, 2, 'Australie'),(24, 3, 'Australia'), (22, 3, 'Hong Kong'),(23, 1, 'Norway'),(23, 2, 'Norvège'),(23, 3, 'Noruega'),(24, 1, 'Australia'),(24, 2, 'Australie'),(24, 3, 'Australia'),
(25, 1, 'Singapore'),(25, 2, 'Singapour'),(25, 3, 'Singapur'),(26, 1, 'Ireland'),(26, 2, 'Eire'),(26, 3, 'Irlanda'),(27, 1, 'New Zealand'), (25, 1, 'Singapore'),(25, 2, 'Singapour'),(25, 3, 'Singapur'),(26, 1, 'Ireland'),(26, 2, 'Eire'),(26, 3, 'Irlanda'),(27, 1, 'New Zealand'),
(27, 2, 'Nouvelle-Zélande'),(27, 3, 'Nueva Zelanda'),(28, 1, 'South Korea'),(28, 2, 'Corée du Sud'),(28, 3, 'Corea del Sur'),(29, 1, 'Israel'), (27, 2, 'Nouvelle-Zélande'),(27, 3, 'Nueva Zelanda'),(28, 1, 'South Korea'),(28, 2, 'Corée du Sud'),(28, 3, 'Corea del Sur'),(29, 1, 'Israel'),
@@ -1029,10 +1029,9 @@ INSERT INTO `PREFIX_stock_mvt_reason_lang` (`id_stock_mvt_reason`, `id_lang`, `n
INSERT INTO `PREFIX_address_format` (`id_country`, `format`) INSERT INTO `PREFIX_address_format` (`id_country`, `format`)
(SELECT `id_country` as id_country, 'firstname lastname\ncompany\nvat_number\naddress1\naddress2\npostcode city\ncountry\nphone' as format FROM `PREFIX_country`); (SELECT `id_country` as id_country, 'firstname lastname\ncompany\nvat_number\naddress1\naddress2\npostcode city\ncountry\nphone' as format FROM `PREFIX_country`);
UPDATE `PREFIX_address_format` set `format`='firstname lastname UPDATE `PREFIX_address_format` set `format`='company
company firstname lastname
address1 address1 address2
address2 city state_iso postcode
city state postcode
country country
phone' where `id_country`=21; phone' where `id_country`=21;
+1 -8
View File
@@ -2,13 +2,6 @@ SET NAMES 'utf8';
INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`, `live_edit`) VALUES ('afterSaveAdminMeta', 'After save configuration in AdminMeta', 'After save configuration in AdminMeta', 0, 0); INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`, `live_edit`) VALUES ('afterSaveAdminMeta', 'After save configuration in AdminMeta', 'After save configuration in AdminMeta', 0, 0);
INSERT INTO `PREFIX_hook_module` (`id_module`, `id_hook`, `position`) VALUES
(
(SELECT `id_module` FROM `PREFIX_module` WHERE `name` = 'blockcategories'),
(SELECT `id_hook` FROM `PREFIX_hook` WHERE `name` = 'afterSaveAdminMeta'), 1
);
ALTER TABLE `PREFIX_webservice_account` ADD `is_module` TINYINT( 2 ) NOT NULL DEFAULT '0' AFTER `class_name` , ALTER TABLE `PREFIX_webservice_account` ADD `is_module` TINYINT( 2 ) NOT NULL DEFAULT '0' AFTER `class_name` ,
ADD `module_name` VARCHAR( 50 ) NULL DEFAULT NULL AFTER `is_module`; ADD `module_name` VARCHAR( 50 ) NULL DEFAULT NULL AFTER `is_module`;
@@ -47,4 +40,4 @@ country
phone' where `id_country`=21; phone' where `id_country`=21;
/* PHP:alter_cms_block(); */; /* PHP:alter_cms_block(); */;
/* PHP:add_module_to_hook(blockcategories, afterSaveAdminMeta); */;
+4 -4
View File
@@ -251,8 +251,8 @@ if (!$params['category']->active)
break; break;
case 'id_attribute_group': case 'id_attribute_group':
$queryFilters .= ' AND p.id_product IN ( SELECT pa.`id_product` $queryFilters .= ' AND p.id_product IN ( SELECT pa.`id_product`
FROM `ps_product_attribute_combination` pac FROM `'._DB_PREFIX_.'product_attribute_combination` pac
LEFT JOIN `ps_product_attribute` pa LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
ON (pa.`id_product_attribute` = pac.`id_product_attribute`) WHERE '; ON (pa.`id_product_attribute` = pac.`id_product_attribute`) WHERE ';
foreach ($filterValues AS $filterValue) foreach ($filterValues AS $filterValue)
@@ -260,10 +260,10 @@ if (!$params['category']->active)
$queryFilters = rtrim($queryFilters, 'OR ').')'; $queryFilters = rtrim($queryFilters, 'OR ').')';
break; break;
case 'category': case 'category':
$parent = new category($id_parent); $parent = new Category($id_parent);
if (!sizeof($selectedFilters['category'])) if (!sizeof($selectedFilters['category']))
$queryFilters .= ' AND p.id_product IN ( SELECT id_product FROM '._DB_PREFIX_.'category_product cp $queryFilters .= ' AND p.id_product IN ( SELECT id_product FROM '._DB_PREFIX_.'category_product cp
LEFT JOIN ps_category c ON (c.id_category = cp.id_category) LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category)
WHERE 1 AND c.nleft >= parent->nleft AND c.nright <= parent->nright'; WHERE 1 AND c.nleft >= parent->nleft AND c.nright <= parent->nright';
else else
{ {
+1 -1
View File
@@ -81,7 +81,7 @@ class BlockSearch extends Module
{ {
global $smarty; global $smarty;
$smarty->assign('ENT_QUOTES', ENT_QUOTES); $smarty->assign('ENT_QUOTES', ENT_QUOTES);
$smarty->assign('search_ssl', (int)(isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')); $smarty->assign('search_ssl', (int)(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'));
$ajaxSearch=(int)(Configuration::get('PS_SEARCH_AJAX')); $ajaxSearch=(int)(Configuration::get('PS_SEARCH_AJAX'));
$smarty->assign('ajaxsearch', $ajaxSearch); $smarty->assign('ajaxsearch', $ajaxSearch);
+3 -1
View File
@@ -28,6 +28,7 @@
require_once(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php'); require_once(dirname(__FILE__).'/../../init.php');
require_once(dirname(__FILE__).'/WishList.php'); require_once(dirname(__FILE__).'/WishList.php');
require_once(dirname(__FILE__).'/blockwishlist.php');
$errors = array(); $errors = array();
@@ -53,7 +54,8 @@ if ($cookie->isLogged())
if(!isset($cookie->id_wishlist) OR $cookie->id_wishlist == '') if(!isset($cookie->id_wishlist) OR $cookie->id_wishlist == '')
{ {
$wishlist = new WishList(); $wishlist = new WishList();
$wishlist->name = 'My WishList'; $modWishlist = new BlockWishList();
$wishlist->name = $modWishlist->l('My wishlist');
$wishlist->id_customer = (int)($cookie->id_customer); $wishlist->id_customer = (int)($cookie->id_customer);
list($us, $s) = explode(' ', microtime()); list($us, $s) = explode(' ', microtime());
srand($s * $us); srand($s * $us);
+1
View File
@@ -10,6 +10,7 @@ $_MODULE['<{blockwishlist}prestashop>blockwishlist-ajax_09dc02ecbb078868a3a86dde
$_MODULE['<{blockwishlist}prestashop>blockwishlist-extra_15b94c64c4d5a4f7172e5347a36b94fd'] = 'Ajouter à ma liste'; $_MODULE['<{blockwishlist}prestashop>blockwishlist-extra_15b94c64c4d5a4f7172e5347a36b94fd'] = 'Ajouter à ma liste';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_2715a65604e1af3d6933b61704865daf'] = 'Bloc liste de cadeaux'; $_MODULE['<{blockwishlist}prestashop>blockwishlist_2715a65604e1af3d6933b61704865daf'] = 'Bloc liste de cadeaux';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_7244141a5de030c4c882556f4fd70a8b'] = 'Ajoute un bloc gérant les listes de cadeaux'; $_MODULE['<{blockwishlist}prestashop>blockwishlist_7244141a5de030c4c882556f4fd70a8b'] = 'Ajoute un bloc gérant les listes de cadeaux';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_4840f4437f55e68a587d358090b948d1'] = 'Ma liste de cadeaux';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_5ef2d617096ae7b47a83f3d4de9c84bd'] = 'Choix invalide pour l\'activation du module'; $_MODULE['<{blockwishlist}prestashop>blockwishlist_5ef2d617096ae7b47a83f3d4de9c84bd'] = 'Choix invalide pour l\'activation du module';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation'; $_MODULE['<{blockwishlist}prestashop>blockwishlist_f4d1ea475eaa85102e2b4e6d95da84bd'] = 'Confirmation';
$_MODULE['<{blockwishlist}prestashop>blockwishlist_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres enregistrés'; $_MODULE['<{blockwishlist}prestashop>blockwishlist_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres enregistrés';
+1 -1
View File
@@ -80,7 +80,7 @@ class Treepodia extends Module
private function _getShopURL() private function _getShopURL()
{ {
return ((Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? Tools::getShopDomainSsl() : Tools::getShopDomain()).__PS_BASE_URI__; return ((Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? Tools::getShopDomainSsl() : Tools::getShopDomain()).__PS_BASE_URI__;
} }
public function generateXmlFlow() public function generateXmlFlow()
+17 -6
View File
@@ -90,6 +90,11 @@ $(function(){ldelim}
<label for="company">{l s='Company'}</label> <label for="company">{l s='Company'}</label>
<input type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{if isset($address->company)}{$address->company|escape:'htmlall':'UTF-8'}{/if}{/if}" /> <input type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{if isset($address->company)}{$address->company|escape:'htmlall':'UTF-8'}{/if}{/if}" />
</p> </p>
<p class="required text dni">
<label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{else}{if isset($address->dni)}{$address->dni|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{if $vat_display == 2} {if $vat_display == 2}
<div id="vat_area"> <div id="vat_area">
{elseif $vat_display == 1} {elseif $vat_display == 1}
@@ -104,40 +109,43 @@ $(function(){ldelim}
</p> </p>
</div> </div>
</div> </div>
{foreach from=$ordered_adr_fields item=field_name}
{if $field_name eq 'firstname'}
<p class="required text"> <p class="required text">
<label for="firstname">{l s='First name'}</label> <label for="firstname">{l s='First name'}</label>
<input type="text" name="firstname" id="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{else}{if isset($address->firstname)}{$address->firstname|escape:'htmlall':'UTF-8'}{/if}{/if}" /> <input type="text" name="firstname" id="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{elseif isset($address->firstname)}{$address->firstname|escape:'htmlall':'UTF-8'}{/if}" />
<sup>*</sup> <sup>*</sup>
</p> </p>
{elseif $field_name eq 'lastname'}
<p class="required text"> <p class="required text">
<label for="lastname">{l s='Last name'}</label> <label for="lastname">{l s='Last name'}</label>
<input type="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{else}{if isset($address->lastname)}{$address->lastname|escape:'htmlall':'UTF-8'}{/if}{/if}" /> <input type="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{else}{if isset($address->lastname)}{$address->lastname|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<sup>*</sup> <sup>*</sup>
</p> </p>
<p class="required text dni"> {elseif $field_name eq 'address1'}
<label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{else}{if isset($address->dni)}{$address->dni|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
<p class="required text"> <p class="required text">
<label for="address1">{l s='Address'}</label> <label for="address1">{l s='Address'}</label>
<input type="text" id="address1" name="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{else}{if isset($address->address1)}{$address->address1|escape:'htmlall':'UTF-8'}{/if}{/if}" /> <input type="text" id="address1" name="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{else}{if isset($address->address1)}{$address->address1|escape:'htmlall':'UTF-8'}{/if}{/if}" />
<sup>*</sup> <sup>*</sup>
</p> </p>
{elseif $field_name eq 'address2'}
<p class="required text"> <p class="required text">
<label for="address2">{l s='Address (Line 2)'}</label> <label for="address2">{l s='Address (Line 2)'}</label>
<input type="text" id="address2" name="address2" value="{if isset($smarty.post.address2)}{$smarty.post.address2}{else}{if isset($address->address2)}{$address->address2|escape:'htmlall':'UTF-8'}{/if}{/if}" /> <input type="text" id="address2" name="address2" value="{if isset($smarty.post.address2)}{$smarty.post.address2}{else}{if isset($address->address2)}{$address->address2|escape:'htmlall':'UTF-8'}{/if}{/if}" />
</p> </p>
{elseif $field_name eq 'postcode'}
<p class="required postcode text"> <p class="required postcode text">
<label for="postcode">{l s='Zip / Postal Code'}</label> <label for="postcode">{l s='Zip / Postal Code'}</label>
<input type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'htmlall':'UTF-8'}{/if}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" /> <input type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'htmlall':'UTF-8'}{/if}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
<sup>*</sup> <sup>*</sup>
</p> </p>
{elseif $field_name eq 'city'}
<p class="required text"> <p class="required text">
<label for="city">{l s='City'}</label> <label for="city">{l s='City'}</label>
<input type="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{else}{if isset($address->city)}{$address->city|escape:'htmlall':'UTF-8'}{/if}{/if}" maxlength="64" /> <input type="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{else}{if isset($address->city)}{$address->city|escape:'htmlall':'UTF-8'}{/if}{/if}" maxlength="64" />
<sup>*</sup> <sup>*</sup>
</p> </p>
{elseif $field_name eq 'country'}
<p class="required select"> <p class="required select">
<label for="id_country">{l s='Country'}</label> <label for="id_country">{l s='Country'}</label>
<select id="id_country" name="id_country">{$countries_list}</select> <select id="id_country" name="id_country">{$countries_list}</select>
@@ -175,6 +183,9 @@ $(function(){ldelim}
</select> </select>
<sup>*</sup> <sup>*</sup>
</p> </p>
{/if}
{/foreach}
<p class="textarea"> <p class="textarea">
<label for="other">{l s='Additional information'}</label> <label for="other">{l s='Additional information'}</label>
<textarea id="other" name="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{else}{if isset($address->other)}{$address->other|escape:'htmlall':'UTF-8'}{/if}{/if}</textarea> <textarea id="other" name="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{else}{if isset($address->other)}{$address->other|escape:'htmlall':'UTF-8'}{/if}{/if}</textarea>
+12 -1
View File
@@ -35,9 +35,20 @@ function updateAddressesDisplay(first_view)
// update content of delivery address // update content of delivery address
updateAddressDisplay('delivery'); updateAddressDisplay('delivery');
var txtInvoiceTitle = "";
try{
var adrs_titles = getAddressesTitles();
txtInvoiceTitle = adrs_titles.invoice;
}
catch (e)
{
}
// update content of invoice address // update content of invoice address
//if addresses have to be equals... //if addresses have to be equals...
var txtInvoiceTitle = $('ul#address_invoice li.address_title').html();
if ($('input[type=checkbox]#addressesAreEquals:checked').length == 1) if ($('input[type=checkbox]#addressesAreEquals:checked').length == 1)
{ {
$('#address_invoice_form:visible').hide('fast'); $('#address_invoice_form:visible').hide('fast');
+11 -4
View File
@@ -44,6 +44,8 @@
,city: '{$address.city|addslashes}' ,city: '{$address.city|addslashes}'
,country: '{$address.country|addslashes}' ,country: '{$address.country|addslashes}'
,state: '{$address.state|default:''|addslashes}' ,state: '{$address.state|default:''|addslashes}'
,state_iso: '{$address.state_iso|default:''|addslashes}'
{rdelim}; {rdelim};
{/foreach} {/foreach}
@@ -66,14 +68,19 @@
] ]
{rdelim}; {rdelim};
function getAddressesTitles()
{ldelim}
return {ldelim}
'invoice': "{l s='Your billing address'}"
, 'delivery': "{l s='Your delivery address'}"
{rdelim};
{rdelim}
function buildAddressBlock(id_address, address_type, dest_comp) function buildAddressBlock(id_address, address_type, dest_comp)
{ldelim} {ldelim}
var adr_titles_vals = {ldelim} var adr_titles_vals = getAddressesTitles();
'invoice': "{l s='Your billing address'}"
, 'delivery': "{l s='Your delivery address'}"
{rdelim};
var li_content = addresses_values[id_address]; var li_content = addresses_values[id_address];
var fields_name = ["title"]; var fields_name = ["title"];
+3 -3
View File
@@ -36,10 +36,10 @@
<br /> <br />
<span id="store_hours">{l s='Hours:'}</span> <span id="store_hours">{l s='Hours:'}</span>
<table style="font-size: 9px;"> <table style="font-size: 9px;">
{foreach $days_datas as $one_day} {foreach from=$days_datas item=one_day}
<tr> <tr>
<td style="width: 70px;">{$one_day['day']}</td> <td style="width: 70px;">{$one_day.day}</td>
<td>{$one_day['hours']}</td> <td>{$one_day.hours}</td>
</tr> </tr>
{/foreach} {/foreach}
</table> </table>