// fix on attribute positions in FO (Attribute constructor was incorrect)

This commit is contained in:
vChabot
2011-10-27 12:52:04 +00:00
parent 2b7340d9d9
commit d09855f02c
5 changed files with 70 additions and 5 deletions
+22
View File
@@ -107,6 +107,27 @@ class HelperOptionsCore extends Helper
}
}
// pre-assign vars to the tpl
if ($field['type'] == 'maintenance_ip')
{
$field['script_ip'] = '
<script type="text/javascript">
function addRemoteAddr()
{
var length = $(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\').length;
if (length > 0)
$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\') +\','.Tools::getRemoteAddr().'\');
else
$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',\''.Tools::getRemoteAddr().'\');
}
</script>';
$field['link_remove_ip'] = ' &nbsp<a href="#" class="button" onclick="addRemoteAddr(); return false;">'.$this->l('Add my IP').'</a>';
} else if ($field['type'] == 'price')
{
$field['currency_left'] = $this->context->currency->getSign('left');
$field['currency_right'] = $this->context->currency->getSign('right').' '.$this->l('(tax excl.)');
}
// Multishop default value
$field['multishop_default'] = (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible);
@@ -116,6 +137,7 @@ class HelperOptionsCore extends Helper
// Is at least one required field present?
if (isset($field['required']) && $field['required'])
$required_fields = true;
}
// Assign the modifications back to parent array
$option_list[$category] = $category_data;