Jump to content

[SOLVED] How do I display a product's description on the search results page


skinnybloke

Recommended Posts

search results template file is located in your theme directory : themes/YOUR_THEME/product-list.tpl

 

this is the same file which displays results in categories. just add somewhere {$product.description} or {$product.description_short} (depending on your needs) and you will see description

Link to comment
Share on other sites

  • 1 month later...

no, there is no module for that. because ... i think that solution for your question is a simple theme modification. nothing more.

but before i start my little investigation, we are talking here about AJAX SEARCH results or just about search results page?

Link to comment
Share on other sites

  • 5 months later...

As this is the first result for google search on "prestashop full description on search results" I give solution for that :)

 

Search result page uses /themes/your_theme/product-list.tpl so you need to edit this file and find this section:

<p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</a></p>

Simply change both description_short to description

 

Now edit /classes/Search.php and in function find (starting around line 180) search for query that starts with this (around line 310):

$sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, 
	pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`, (...)

and next to pl.`description_short`, add pl.`description`, . Now it should look like this:

$sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, 
	pl.`description_short`, pl.`description`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`, (...)

Similar changes should be made in function searchTag (starting around line 625) if you have Blocktags module enabled on your shop.

  • Like 2
Link to comment
Share on other sites

  • 2 years later...

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