diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php
index 5ddfc11c9..9e0d5f808 100644
--- a/admin-dev/tabs/AdminProducts.php
+++ b/admin-dev/tabs/AdminProducts.php
@@ -2843,14 +2843,7 @@ class AdminProducts extends AdminTab
}
});
});
-
-
- | '.$this->l('Pre-tax wholesale price:').' |
-
- '.($currency->format % 2 != 0 ? $currency->sign.' ' : '').''.($currency->format % 2 == 0 ? ' '.$currency->sign : '').'
- '.$this->l('The wholesale price at which you bought this product').'
- |
-
';
+ ';
echo '
| '.$this->l('Pre-tax retail price:').' |
@@ -3666,11 +3659,11 @@ class AdminProducts extends AdminTab
{
// Get all id_product_atribute
- $attributes = $obj->getAttributeCombinaisons($this->context->language->id);
+ $attributes = $obj->getAttributesResume($this->context->language->id);
if (empty($attributes))
$attributes[] = array(
'id_product_attribute' => 0,
- 'attribute_name' => ''
+ 'attribute_designation' => ''
);
// Get physical quantities & available quantities
@@ -3687,7 +3680,7 @@ class AdminProducts extends AdminTab
$availableQuantity[$attribute['id_product_attribute']] = StockAvailable::getStockAvailableForProduct((int)$obj->id, $attribute['id_product_attribute']);
// Get all product designation
- $productDesignation[$attribute['id_product_attribute']] = $obj->name[$this->context->language->id].' '.$attribute['attribute_name'];
+ $productDesignation[$attribute['id_product_attribute']] = rtrim($obj->name[$this->context->language->id].' - '.$attribute['attribute_designation'], ' - ');
}
$return = '
@@ -4202,56 +4195,37 @@ class AdminProducts extends AdminTab
';
if (Configuration::get('PS_USE_ECOTAX'))
echo'
-
- | '.$this->l('Eco-tax:').' |
- '.($currency->format % 2 != 0 ? $currency->sign.' ' : '').''.($currency->format % 2 == 0 ? ' '.$currency->sign : '').' ('.$this->l('overrides Eco-tax on Information tab').') |
-
';
+
+ | '.$this->l('Eco-tax:').' |
+ '.($currency->format % 2 != 0 ? $currency->sign.' ' : '').''.($currency->format % 2 == 0 ? ' '.$currency->sign : '').' ('.$this->l('overrides Eco-tax on Information tab').') |
+
';
echo'
-
- | '.$this->l('Initial stock:').' |
- |
-
-
-
- | '.$this->l('Stock movement:').' |
-
-
-
-
-
- '.$this->l('Choose the reason and enter the quantity that you want to increase or decrease in your stock').'
- |
-
-
- | '.$this->l('Minimum quantity:').' |
-
-
- '.$this->l('The minimum quantity to buy this product (set to 1 to disable this feature)').'
- |
-
-
- | '.$this->l('Quantity in stock:').' |
- |
-
-
- | '.$this->l('Available date:').' |
-
- '.$this->l('The available date when this product is out of stock').'
- |
-
';
- // date picker include
- includeDatepicker('available_date');
+
+
+ | '.$this->l('Minimum quantity:').' |
+
+
+ '.$this->l('The minimum quantity to buy this product (set to 1 to disable this feature)').'
+ |
+
+
+ | '.$this->l('Quantity in stock:').' |
+ |
+
+
+ | '.$this->l('Available date:').' |
+
+ '.$this->l('The available date when this product is out of stock').'
+ |
+
';
+ // date picker include
+ includeDatepicker('available_date');
echo '
-
|
-
- | '.$this->l('Image:').' |
-
+ |
|
+
+ | '.$this->l('Image:').' |
+
';
$i = 0;
$imageType = ImageType::getByNameNType('small', 'products');
diff --git a/classes/Product.php b/classes/Product.php
index b57b1e3f9..11f63885c 100644
--- a/classes/Product.php
+++ b/classes/Product.php
@@ -1298,6 +1298,29 @@ class ProductCore extends ObjectModel
return ($result);
}
+ /**
+ * Get all available product attributes resume
+ *
+ * @param integer $id_lang Language id
+ * @return array Product attributes combinaisons
+ */
+ public function getAttributesResume($id_lang, $attribute_value_separator = ' - ', $attribute_separator = ', ')
+ {
+ if (!Combination::isFeatureActive())
+ return array();
+ $sql = 'SELECT pa.*, GROUP_CONCAT(agl.`name`, \''.pSQL($attribute_value_separator).'\', al.`name` SEPARATOR \''.pSQL($attribute_separator).'\') as attribute_designation, stock.quantity
+ FROM `'._DB_PREFIX_.'product_attribute` pa
+ LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON pac.`id_product_attribute` = pa.`id_product_attribute`
+ LEFT JOIN `'._DB_PREFIX_.'attribute` a ON a.`id_attribute` = pac.`id_attribute`
+ LEFT JOIN `'._DB_PREFIX_.'attribute_group` ag ON ag.`id_attribute_group` = a.`id_attribute_group`
+ LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
+ LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')
+ '.Product::sqlStock('pa', 'pa').'
+ WHERE pa.`id_product` = '.(int)$this->id.'
+ GROUP BY pa.`id_product_attribute`';
+ return Db::getInstance()->executeS($sql);
+ }
+
/**
* Get all available product attributes combinaisons
*
|