public function addColorsToProductList(&$products)
 {
     if (!is_array($products) || !count($products) || !file_exists(_PS_THEME_DIR_ . 'product-list-colors.tpl')) {
         return;
     }
     $products_need_cache = array();
     foreach ($products as &$product) {
         if (!$this->isCached(_PS_THEME_DIR_ . 'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) {
             $products_need_cache[] = (int) $product['id_product'];
         }
     }
     unset($product);
     $colors = false;
     if (count($products_need_cache)) {
         $colors = Product::getAttributesColorList($products_need_cache);
     }
     Tools::enableCache();
     foreach ($products as &$product) {
         $tpl = $this->context->smarty->createTemplate(_PS_THEME_DIR_ . 'product-list-colors.tpl');
         if (isset($colors[$product['id_product']])) {
             $tpl->assign(array('id_product' => $product['id_product'], 'colors_list' => $colors[$product['id_product']], 'link' => Context::getContext()->link, 'img_col_dir' => _THEME_COL_DIR_, 'col_img_dir' => _PS_COL_IMG_DIR_));
         }
         if (!in_array($product['id_product'], $products_need_cache) || isset($colors[$product['id_product']])) {
             $product['color_list'] = $tpl->fetch(_PS_THEME_DIR_ . 'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']));
         } else {
             $product['color_list'] = '';
         }
     }
     Tools::restoreCacheSettings();
 }
 /**
  * @param \Product $product
  *
  * @return string
  * @author Panagiotis Vagenas <*****@*****.**>
  * @since 150213
  */
 protected function getProductColors(\Product &$product)
 {
     $colorList = \Product::getAttributesColorList(array($product->id));
     if (!$colorList || empty($colorList) || !isset($colorList[$product->id]) || empty($colorList[$product->id])) {
         return '';
     }
     $colors = array();
     foreach ($colorList[$product->id] as $k => $color) {
         if ((int) $product->isColorUnavailable($color['id_attribute'], \Context::getContext()->shop->id) === $color['id_product_attribute'] && !$this->backOrdersAllowed($product)) {
             continue;
         }
         array_push($colors, $color['name']);
     }
     return implode(', ', $colors);
 }