diff --git a/admin-dev/themes/default/template/controllers/attribute_generator/content.tpl b/admin-dev/themes/default/template/controllers/attribute_generator/content.tpl index 056e9b712..a5dd0d77e 100644 --- a/admin-dev/themes/default/template/controllers/attribute_generator/content.tpl +++ b/admin-dev/themes/default/template/controllers/attribute_generator/content.tpl @@ -53,69 +53,76 @@ {if $generate}
{l s='%d product(s) successfully created.' sprintf=$combinations_size}
{/if}
-
- {l s='Attributes generator'} -
- + {foreach $attribute_groups as $k => $attribute_group} + {if isset($attribute_js[$attribute_group['id_attribute_group']])} + + {foreach $attribute_js[$attribute_group['id_attribute_group']] as $k => $v} + + {/foreach} + + {/if} + {/foreach} + +
+
+ + +
+ +
+
{l s='The Combinations Generator is a tool that allows you to easily create a series of combinations by selecting the related attributes. For example, if you\'re selling t-shirts in three different sizes and two different colors, the generator will create six combinations for you.'}
+ +

{l s='You\'re currently generating combinations for the following product:'} {$product_name|escape:'htmlall':'UTF-8'}

+ +

{l s='Step 1: On the left side, select the attributes you want to use (Hold down the "Ctrl" key on your keyboard and validate by clicking on "Add")'}

+ +
{foreach $attribute_groups as $k => $attribute_group} {if isset($attribute_js[$attribute_group['id_attribute_group']])} - - {foreach $attribute_js[$attribute_group['id_attribute_group']] as $k => $v} - + + + + + + + + + + + + {if isset($attributes[$attribute_group['id_attribute_group']])} + {foreach $attributes[$attribute_group['id_attribute_group']] AS $k => $attribute} + {/foreach} - + {/if} {/if} {/foreach} - -
-

- - -

+
+

{l s='Select a default quantity, and reference, for each combination the generator will create for this product.'}

+ + + + + + + + + + + +
{l s='Default Quantity:'}
{l s='Default Reference:'}
+

{l s='Please click on "Generate these Combinations"'}

+

-
-
{l s='The Combinations Generator is a tool that allows you to easily create a series of combinations by selecting the related attributes. For example, if you\'re selling t-shirts in three different sizes and two different colors, the generator will create six combinations for you.'}
-

{l s='You\'re currently generating combinations for the following product:'} {$product_name|escape:'htmlall':'UTF-8'}

-

{l s='Step 1: On the left side, select the attributes you want to use (Hold down the "Ctrl" key on your keyboard and validate by clicking on "Add")'}

-
- {foreach $attribute_groups as $k => $attribute_group} - {if isset($attribute_js[$attribute_group['id_attribute_group']])} - - - - - - - - - - - - {if isset($attributes[$attribute_group['id_attribute_group']])} - {foreach $attributes[$attribute_group['id_attribute_group']] AS $k => $attribute} - - {/foreach} - {/if} - {/if} - {/foreach} -
-

{l s='Select a default quantity, and reference, for each combination the generator will create for this product.'}

- - - - - - - - - -
{l s='Default Quantity:'}
{l s='Default Reference:'}
-

{l s='Please click on "Generate these Combinations"'}

-

-
\ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/list/list_header.tpl b/admin-dev/themes/default/template/helpers/list/list_header.tpl index 675ea9d83..be39232aa 100644 --- a/admin-dev/themes/default/template/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_header.tpl @@ -177,7 +177,7 @@ if (submited) return false; submited = true; - + //add hidden input to emulate submit button click when posting the form -> field name posted btn_submit.before(''); @@ -207,7 +207,7 @@ console.log('ok'); openModulesList(); }); - + function openModulesList() { $('#modules_list_container').modal('show'); @@ -246,7 +246,7 @@ {/if}
- {foreach $fields_display AS $key => $params} -
+ @@ -281,7 +281,7 @@ {else} {$params.title} {/if} - + {if (!isset($params.orderby) || $params.orderby) && !$simple_header} diff --git a/admin-dev/themes/default/template/layout-ajax.tpl b/admin-dev/themes/default/template/layout-ajax.tpl index 7915effdb..65484cfd1 100644 --- a/admin-dev/themes/default/template/layout-ajax.tpl +++ b/admin-dev/themes/default/template/layout-ajax.tpl @@ -47,11 +47,11 @@ {else} {l s='%d errors' sprintf=$errors|count}
-
    +
      {foreach $errors AS $error}
    • {$error}
    • {/foreach} -
+ {/if} {/if} diff --git a/controllers/admin/AdminAttributeGeneratorController.php b/controllers/admin/AdminAttributeGeneratorController.php index 1d6cd1368..9002d65d5 100644 --- a/controllers/admin/AdminAttributeGeneratorController.php +++ b/controllers/admin/AdminAttributeGeneratorController.php @@ -33,10 +33,11 @@ class AdminAttributeGeneratorControllerCore extends AdminController public function __construct() { + $this->bootstrap = true; $this->table = 'product_attribute'; $this->className = 'Product'; $this->multishop_context_group = false; - + parent::__construct(); } @@ -117,10 +118,10 @@ class AdminAttributeGeneratorControllerCore extends AdminController foreach ($attributes as $attribute) StockAvailable::removeProductFromStockAvailable($this->product->id, $attribute['id_product_attribute'], Context::getContext()->shop); } - + $this->product->deleteProductAttributes(); $this->product->generateMultipleCombinations($values, $this->combinations); - + // @since 1.5.0 if ($this->product->depends_on_stock == 0) { diff --git a/controllers/admin/AdminTrackingController.php b/controllers/admin/AdminTrackingController.php index ac2384930..b0bcd8ffb 100644 --- a/controllers/admin/AdminTrackingController.php +++ b/controllers/admin/AdminTrackingController.php @@ -28,7 +28,7 @@ class AdminTrackingControllerCore extends AdminController { public $bootstrap = true ; protected $_helper_list; - + public function postprocess() { if (Tools::getValue('id_product') && Tools::isSubmit('statusproduct')) @@ -57,10 +57,10 @@ class AdminTrackingControllerCore extends AdminController Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_category='.(int)$id_category.'&viewcategory'); $this->_helper_list = new HelperList(); - + if (!Configuration::get('PS_STOCK_MANAGEMENT')) $this->warnings[] = $this->l('List of products without available quantities for sale are not displayed because stock management is disabled.'); - + $methods = get_class_methods($this); $tpl_vars['arrayList'] = array(); foreach ($methods as $method_name) @@ -106,7 +106,7 @@ class AdminTrackingControllerCore extends AdminController 'active' => array('title' => $this->l('Status'), 'type' => 'bool', 'active' => 'status') )); $this->clearFilters(); - + $this->_join = Shop::addSqlAssociation('category', 'a'); $this->_filter = ' AND a.`id_category` NOT IN ( SELECT DISTINCT(cp.id_category) @@ -121,7 +121,7 @@ class AdminTrackingControllerCore extends AdminController { if (!Configuration::get('PS_STOCK_MANAGEMENT')) return; - + $this->table = 'product'; $this->list_id = 'no_stock_products_attributes'; $this->lang = true; @@ -142,9 +142,9 @@ class AdminTrackingControllerCore extends AdminController 'name' => array('title' => $this->l('Name'), 'filter_key' => 'b!name'), 'active' => array('title' => $this->l('Status'), 'type' => 'bool', 'active' => 'status') ); - + $this->clearFilters(); - + $this->_join = Shop::addSqlAssociation('product', 'a'); $this->_filter = 'AND a.id_product IN ( SELECT p.id_product @@ -161,10 +161,10 @@ class AdminTrackingControllerCore extends AdminController } public function getCustomListProductsNoStock() - { + { if (!Configuration::get('PS_STOCK_MANAGEMENT')) return; - + $this->table = 'product'; $this->list_id = 'no_stock_products'; $this->className = 'Product'; @@ -186,7 +186,7 @@ class AdminTrackingControllerCore extends AdminController 'active' => array('title' => $this->l('Status'), 'type' => 'bool', 'active' => 'status') ); $this->clearFilters(); - + $this->_join = Shop::addSqlAssociation('product', 'a'); $this->_filter = 'AND a.id_product IN ( SELECT p.id_product @@ -227,46 +227,46 @@ class AdminTrackingControllerCore extends AdminController ); $this->clearFilters(); - + $this->_join = Shop::addSqlAssociation('product', 'a'); $this->toolbar_title = $this->l('List of disabled products:'); return $this->renderList(); } - - + + public function renderList() { $this->processFilter(); return parent::renderList(); } - + public function displayEnableLink($token, $id, $value, $active, $id_category = null, $id_product = null) { $this->_helper_list->currentIndex = $this->_list_index; $this->_helper_list->identifier = $this->identifier; $this->_helper_list->table = $this->table; - + return $this->_helper_list->displayEnableLink($this->_list_token, $id, $value, $active, $id_category, $id_product); } - + public function displayDeleteLink($token = null, $id, $name = null) { $this->_helper_list->currentIndex = $this->_list_index; $this->_helper_list->identifier = $this->identifier; $this->_helper_list->table = $this->table; - + return $this->_helper_list->displayDeleteLink($this->_list_token, $id, $name); } - + public function displayEditLink($token = null, $id, $name = null) { $this->_helper_list->currentIndex = $this->_list_index; $this->_helper_list->identifier = $this->identifier; $this->_helper_list->table = $this->table; - + return $this->_helper_list->displayEditLink($this->_list_token, $id, $name); } - + protected function clearFilters() { if (Tools::isSubmit('submitResetempty_categories')) @@ -279,7 +279,7 @@ class AdminTrackingControllerCore extends AdminController $this->processResetFilters('no_stock_products'); if (Tools::isSubmit('submitResetdisabled_products')) - $this->processResetFilters('disabled_products'); + $this->processResetFilters('disabled_products'); } public function clearListOptions()