Jump to content

Add Size Next To Price Of Products In Products List


Recommended Posts

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. :P   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

Ah, LeoTheme... good luck :D

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

  • Like 1
Link to comment
Share on other sites

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 :)

 

post-1193167-0-30070500-1455097952_thumb.png

 

 

 

Link to comment
Share on other sites

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

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  :D

Link to comment
Share on other sites

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 :D
 
Anyway now it works fine :)
 
Thanks alot for your help!
Edited by sonny90 (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 8 months later...

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 like
blue-xl
red-xl
red-l

That 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...