search results to some page

tomtomtom

Avatar: tomtomtom

2012-07-18 11:05

Hi, I have one question about search results. I want to put search results to the page maybe under content of page. For example: I am on the page with some product and I want to show some other products based on key word (search word) under product on the page. Maybe like random category products but not random category products. For this time I have link to the search results like www.example.com/?search-results,17&sPhrase=someword. But I want to show results, not only link to results. Thank You for solution. I mean it is on /core and on /action client

» Quick.Cart v4.x

treewood (OpenSolution)

Avatar: treewood

2012-07-19 07:17

try to add in actions_client/products.php:
$sPhrase = 'someword';
$sProductsList = $oProduct->listProducts( 'pages_default.tpl', null, 10 );

before code:
$content .= $oTpl->tbHtml( $aData['sTemplate'], 'CONTAINER' );

after put variable $sProductsList in CONTAINER block in file templates/products_default.tpl

tomtomtom

Avatar: tomtomtom

2012-07-19 10:32

it is perfect! thank you.
now I must to set style and delete sorting panel, but I don'n know how. Maybe create a new pages_default without sorting panel and on code from you overwrite

tomtomtom

Avatar: tomtomtom

2012-07-19 10:48

?? after put this solution full description of product is missing. Why? on product_default is ok but doesn't show

tomtomtom

Avatar: tomtomtom

2012-07-19 10:58

on line
$sProductsList = $oProduct->listProducts( 'pages_default.tpl', null, 10 );

what is "null" ? maybe this is the reason of missing full description of product

Please help me if You can. This solution is perfect but with this problem.

Thank You

treewood (OpenSolution)

Avatar: treewood

2012-07-19 11:29

null - this parameter contain id of PAGE, not important here

after this:
$sProductsList = $oProduct->listProducts( 'pages_default.tpl', null, 10 );

put this:
$oTpl->unsetVariables( );

tomtomtom

Avatar: tomtomtom

2012-07-19 11:30

I will try it.
Thank You

tomtomtom

Avatar: tomtomtom

2012-07-20 07:20

nice, it is corect, thank You

reklam

Avatar: reklam

2012-07-25 07:58

may I ask an URL to check the final result?

tomtomtom

Avatar: tomtomtom

2012-07-27 13:32

Hi, I have 1 problem with this solution. It is perfect for use on products and on pages too. But if result contains more products and the page needs paging results to more pages so it is a problem. If I clicked on link to 2 page or next page, the result is error 404. (I mean it is because the link is to "page 2" on standard page with search results).
If You know how to edit this, please help me. Thank You very much

tomtomtom

Avatar: tomtomtom

2012-07-31 08:03

:-( url link of next page of results has a different succession of attributes:

normaly paging is ?nameofpage,175,2

paging in new search results according this new solution has ,2&sPhrase=searchword

Do You know how to fix it?
Thank You

galaxytablet

Avatar: galaxytablet

2012-08-24 11:50

I have sites developed in PHP, I have a problem with pagination, it is not showing all the page nos at first. here is my site
http://www.galaxytabletshop.com/

tomtomtom

Avatar: tomtomtom

2013-03-11 17:35

Hi Treewood, please, if you want, help me with problem with pagination, which I wrote above. On your solution (it is working correctly) I have problem only with pagination:
Hi, I have 1 problem with this solution. It is perfect for use on products and on pages too. But if result contains more products and the page needs paging results to more pages so it is a problem. If I clicked on link to 2 page or next page, the result is error 404. (I mean it is because the link is to "page 2" on standard page with search results).
url link of next page of results has a different succession of attributes:

normaly paging is ?nameofpage,175,2

paging in new search results according this new solution has ,2&sPhrase=searchword

Do You know how to fix it?
Thank You very much :-(

tomtomtom

Avatar: tomtomtom

2013-03-15 15:16

:-( I am willing to pay

Back to top
about us | contact