// added tab SEO in AdminProductsController

This commit is contained in:
lLefevre
2011-12-14 15:57:29 +00:00
parent 2f31ebce41
commit 1aa8b239bd
4 changed files with 19 additions and 67 deletions
+17 -6
View File
@@ -39,6 +39,7 @@ class AdminProductsControllerCore extends AdminController
protected $available_tabs = array(
'Informations',
'Prices',
'Seo',
'Associations',
'Images',
'Shipping',
@@ -57,6 +58,7 @@ class AdminProductsControllerCore extends AdminController
protected $tabs_preloaded = array(
'Informations' => true,
'Prices' => true,
'Seo' => true,
'Associations' => true,
'Images' => false,
'Shipping' => true,
@@ -111,11 +113,6 @@ class AdminProductsControllerCore extends AdminController
'align' => 'center',
'width' => 80
),
/*'name_category' => array(
'title' => $this->l('Category'),
'width' => 100,
'filter_key' => 'cl!name'
),*/
'name_category' => array(
'title' => $this->l('Category'),
'width' => 230,
@@ -161,6 +158,7 @@ class AdminProductsControllerCore extends AdminController
$this->available_tabs_lang = array (
'Informations' => $this->l('Informations'),
'Prices' => $this->l('Prices'),
'Seo' => $this->l('SEO'),
'Images' => $this->l('Images'),
'Associations' => $this->l('Associations'),
'Shipping' => $this->l('Shipping'),
@@ -2521,6 +2519,20 @@ class AdminProductsControllerCore extends AdminController
$this->tpl_form_vars['custom_form'] = $this->context->smarty->createTemplate($this->tpl_form, $data)->fetch();
}
public function initFormSeo($product, $languages, $default_language)
{
$data = $this->context->smarty->createData();
$data->assign(array(
'product' => $product,
'languages' => $languages,
'default_language' => $default_language,
'ps_ssl_enabled' => Configuration::get('PS_SSL_ENABLED')
));
$this->tpl_form_vars['custom_form'] = $this->context->smarty->createTemplate($this->tpl_form, $data)->fetch();
}
private function _getFinalPrice($specific_price, $productPrice, $taxRate)
{
$price = Tools::ps_round((float)($specific_price['price']) ? $specific_price['price'] : $productPrice, 2);
@@ -2939,7 +2951,6 @@ class AdminProductsControllerCore extends AdminController
foreach ($images as $k => $image)
$images[$k]['src'] = $this->context->link->getImageLink($product->link_rewrite[$this->context->language->id], $product->id.'-'.$image['id_image'], 'small');
$data->assign('ps_ssl_enabled', Configuration::get('PS_SSL_ENABLED'));
$data->assign('images', $images);
$data->assign('imagesTypes', ImageType::getImagesTypes('products'));