clampdown Posted December 15, 2014 Share Posted December 15, 2014 Hello,I'd like to add the attributes title below the texture / colour fields on the frontend - please see image for more information.If anyone could help that would be great - thanks Link to comment Share on other sites More sharing options...
tuk66 Posted December 15, 2014 Share Posted December 15, 2014 Try to find that in $attributesCombinations array and show it in product.tpl. Link to comment Share on other sites More sharing options...
mipapage Posted December 15, 2014 Share Posted December 15, 2014 I've done the following to get attributes into the product-list.tpl, if it helps. I can't recall where I learned this, and it may be copy and pasted from somewhere ;-) This goes in override->controllers->front <?php class CategoryController extends CategoryControllerCore { public function initContent() { parent::initContent(); if($this->cat_products) { foreach ($this->cat_products as $key => $product) { $attributes_combinations = Product::getAttributesInformationsByProduct($product['id_product']); if(is_array($attributes_combinations) && isset($attributes_combinations[0]['group']) && $attributes_combinations[0]['group'] == 'Pack de ') { $this->cat_products[$key]['packcount'] = $attributes_combinations[0]['attribute']; } else $this->cat_products[$key]['packcount'] = false; } } $this->context->smarty->assign('products', $this->cat_products); } } Link to comment Share on other sites More sharing options...
antoniobaby78 Posted May 20, 2017 Share Posted May 20, 2017 Hello, I also try the same thing, does anyone have a solution? Link to comment Share on other sites More sharing options...
Alexandre Carette Posted May 20, 2017 Share Posted May 20, 2017 (edited) Hello, In product.tpl add line 362 {$group_attribute|escape:'html':'UTF-8'} <a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}"{if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background:{$colors.$id_attribute.value|escape:'html':'UTF-8'};"{/if} title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}"> {if $img_color_exists} <img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="20" height="20" /> {/if} <!-- Add name attribute --> {$group_attribute|escape:'html':'UTF-8'} </a> Edited May 20, 2017 by Alexandre Carette (see edit history) Link to comment Share on other sites More sharing options...
antoniobaby78 Posted May 20, 2017 Share Posted May 20, 2017 (edited) Grazie mille, ha funzionato grande! Solo una cosa: Potete dirmi come spostare il titolo? Ora è al di sopra l'icona del colore Guarda l'immagine Edited May 20, 2017 by antoniobaby78 (see edit history) Link to comment Share on other sites More sharing options...
antoniobaby78 Posted May 20, 2017 Share Posted May 20, 2017 Solved <span style="position:absolute; top:5px; left:37px">{$group_attribute|escape:'html':'UTF-8'}</span> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now