sonny90 Posted February 10, 2016 Share Posted February 10, 2016 Hello, i'am new to prestashop and have a problem since i'am trying to do something that seems simple but i have no clue how to do it. I need that the size of each product to be shown next to (or above, below it dont matter) its price on the product list. I thought of making it throught the product features, if that can works, however i might find a problem with that way since i have multiple sizes for each product like Italian size, French size, ..... My other idea is to add a textfield (like the one for product title) and then we just have to enter the desired text in it. Since i just need the text to be displayed, that seems to be the best alternative, but is it possibe? do you have better ideas? btw i'am using Leo Fashion Store. Thanks. Link to comment Share on other sites More sharing options...
NemoPS Posted February 10, 2016 Share Posted February 10, 2016 Ah, LeoTheme... good luck So you want to display the available attributes in the product list? It would be easier with features, since you can set it up manually for each product as string. Otherwise you need to fetch attributes in categorycontroller.php, then edit product-list.tpl (careful, leo uses sub templates) and just display the ones you need. It's going to be a pain with a Leo Theme anyway 1 Link to comment Share on other sites More sharing options...
sonny90 Posted February 10, 2016 Author Share Posted February 10, 2016 Thank you for your response, What i want to do is add a text between the products name and price you can see in image i attached. The text should display the size but as i said i have different sizes so it might be difficult wouldnt it be easier if i have the possibbility to just add a textfield there and enter it manually for each product? However i already have created size features as you said, i use them via the layered navigation block in order to filter products and it works well. Do you think i can use them as well to display the size in the place i want? Thanks again Link to comment Share on other sites More sharing options...
NemoPS Posted February 12, 2016 Share Posted February 12, 2016 You might want to try this thenhttp://nemops.com/features-to-product-list-prestashop-16/ Link to comment Share on other sites More sharing options...
sonny90 Posted February 15, 2016 Author Share Posted February 15, 2016 Thanks for your help However i still have problem, i dont find inn my product-list.tpl page <h5 itemprop="name"> {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if} <a class="product-name" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url" > {$product.name|truncate:45:'...'|escape:'html':'UTF-8'} </a> </h5> I tried to put the code anyway and it worked but when i made a search throught filters the texts went to some random places Link to comment Share on other sites More sharing options...
NemoPS Posted February 15, 2016 Share Posted February 15, 2016 Depending on what you use for filtering you might need a couple of other modifications (javascript maybe) Link to comment Share on other sites More sharing options...
sonny90 Posted February 15, 2016 Author Share Posted February 15, 2016 Thanks it worked! I just found that i was searching in the wrong file. Actually i was searching in product-list.tpl on leo_fashion_store folder when it was in fact the one on default_bootstrap folder. Now it works and everything is alright except for one last thing. Before the modifications when mouse hover the product image it switched to the second image of the product but now it is not working anymore do you know how can i fix this? Thanks Link to comment Share on other sites More sharing options...
NemoPS Posted February 17, 2016 Share Posted February 17, 2016 Really odd, if you use the leo theme, the product-list file should be from that theme too. It might be why it doesn't show anything on hover now, if you included the bootstrap one Link to comment Share on other sites More sharing options...
sonny90 Posted February 17, 2016 Author Share Posted February 17, 2016 (edited) Hello, thanks for your help, actually it worked i had to put the code {if isset($product.features)}<div class="features">{foreach from=$product.features item=feature name=pr_features}<div>{$feature.name}: {$feature.value}</div>{if $smarty.foreach.pr_features.iteration == 1}{break}{/if}{/foreach}</div>{/if} In theme>Leo_Fasion_Store>product_item.tpl rather than product_list.tpl I think this is due to Leo being a weird theme Anyway now it works fine Thanks alot for your help! Edited February 17, 2016 by sonny90 (see edit history) 1 Link to comment Share on other sites More sharing options...
Cacio Posted November 2, 2016 Share Posted November 2, 2016 Hi, It's possible to do the same but with attributes? Link to comment Share on other sites More sharing options...
NemoPS Posted November 4, 2016 Share Posted November 4, 2016 Not really, attributes are a lot more complex. Also, it depends on the way you set combinations up. You can achieve something similar if you have one single set, but not with many likeblue-xlred-xlred-lThat would need a totally different approach (and anyway the underlying code is more complex, not to say heavy to load for each page, each product) Link to comment Share on other sites More sharing options...
Cacio Posted November 4, 2016 Share Posted November 4, 2016 Thanks for reply. In my ecommerce, I have only one attribute "Kg", and I want to show only it's default value. 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