Jump to content

Getting the Currency and Language for a Live Search


poplol
 Share

Recommended Posts

Hi I am currently developing a custom live search for my website


And I created some files in blocksearch folder in modules and got stuck with the problem when trying to retrieve the id_lang and id_currency so that i can filter my results and show different prices..

Can any one help me sort out which files I have to include in order to gain access to the cookie . Here is my code

Filename : search.php
Path : /modules/blocksearch/search.php

<?php

require('../../classes/Db.php');






if($_REQUEST['type'] == "results")
{

$name = stripslashes($_REQUEST['query']);



$result622 = Db::getInstance()->ExecuteS('SELECT * FROM `search_results_now` WHERE `id_lang` = 1 AND `keywords` LIKE \'%'.$name.'%\' ORDER by priority ASC LIMIT 10');




foreach ($result622 as $row)
{
if($row['priority'] == 3 || $row['priority'] == 2 )
{
  echo ''.$row['product_name'].' '.$_REQUEST['id_currency'].''.$row['price'].'';

}
else
{
   echo ''.$row['product_name'].'';


}  



}

}       


?>




This page is like has noting to do with presta. How can I make it a page that I can access every presta config / var ? like blocksearch.php for example ?

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More