Post by derwydd » Sat Oct 06, 2007 5:57 am

I edited some files. I am in the search controller, searching product. There is a drop down option box on the right. Everytime I choose any page, say page 3; it sends me to the shopping cart's home. The only things I touched was product and search .php and .tpl.

Please help I am cluess on this one...

Thanks
Jason

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Sat Oct 06, 2007 5:59 am

OH, if you want to check it out:

http://208.190.126.85:5656


Thx
Jason

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by carlo » Sat Oct 06, 2007 6:52 pm

Hi mate,

You might need to post here what part you've actually changed on those files so people can see what the code is doing.
If it's a database call or something within the PHP then you can't see it in the compiled page source.

Good luck mate

Newbie

Posts

Joined
Sat Sep 22, 2007 7:30 am
Location - UK

Post by derwydd » Mon Oct 08, 2007 9:57 pm

search.tpl
###############################################







  " method="post" enctype="multipart/form-data">

   

   

     

       
         
           
       
          ">
          ALL
          3M
          ADALET
          ANDERSON
          APP
          ARL
          ARROW HEAD
          ATL
          BLACKBURN
          BRIDGEPORT
          BRYANT
          BURNDY
          BUSSMAN
          CADWELD
          CONDUIT
          CRS-H
          EDW
          EFCOR
          FED-SIG
          FRZ
          GE
          HOFFMAN
          HUBBELL
          IDEAL
          KILLARK
          LEVITON
          L-FSE
          MIDWEST
          NSI
          OZG
          P&S
          RACO
          T&B
          WOODHEAD

        Select a Manufacturer

           
             
           

           
             

              " /> Enter a Part #

             

              " onclick="this.value = ''" /-->

             

         

         

           

             

             

             

             

             

         

       

     

     

       

         
Click on the Image to go to Plus Mark Description! Click on the Part# to Select this Product!
            " />

         

       

     

   

 

 

 

 

   

   

      " method="post" enctype="multipart/form-data">

       

         

         

          " SELECTED>

         

          ">

         

         

       

     

   

 

 

 
  ">" title="" alt="" />
 
 
    ">


   
Qty:
   
   
    " title="" alt="" />
   
   
   
   
   

 

 

   
   
   
   
     
       

       
       
     
   




 

 

 

 


Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Mon Oct 08, 2007 9:58 pm

search.php
#######################################

locator->get('config');
$currency =& $this->locator->get('currency');
$customer =& $this->locator->get('customer');
$database =& $this->locator->get('database');
$language =& $this->locator->get('language');
$image    =& $this->locator->get('image');
$module  =& $this->locator->get('module');
$response =& $this->locator->get('response');
$session  =& $this->locator->get('session');
$tax      =& $this->locator->get('tax');
$template =& $this->locator->get('template');
$url      =& $this->locator->get('url');
        $searchable = $session->get('search.description');
if ($searchable == "all "){
          $searchable = "";
        }
        if ($searchable != "all"){
          $searchable = $searchable . " " . $session->get('search.search');
        }
        //print $searchable;
      // print $session->get('search.description');
        //print $mfg;
    $language->load('controller/search.php');

$template->set('title', $language->get('heading_title'));
   
    $view = $this->locator->create('template');

    $view->set('heading_title', $language->get('heading_title'));
 
    $view->set('text_critea', $language->get('text_critea'));
    $view->set('text_search', $language->get('text_search'));
$view->set('text_keywords', $language->get('text_keywords'));
$view->set('text_error', $language->get('text_error'));

$view->set('entry_search', $language->get('entry_search'));
    $view->set('entry_description', $language->get('entry_description'));
    $view->set('entry_page', $language->get('entry_page'));
 
    $view->set('button_search', $language->get('button_search'));
   
    $view->set('action', $url->href('search', 'page'));
 
$view->set('search', $session->get('search.search'));
                $view->set('mfg', $session->get('search.mfg'));
$view->set('description', $session->get('search.description'));

if ($session->get('search.search')) {
      if (!$session->get('search.description')) {
        $sql = "select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where pd.language_id = '?' and pd.name like '$searchable' and p.date_available get('search.search');
                                //$searchable = $session->get('search.search');
$results = $database->getRows($database->splitQuery($database->parse($sql, $language->getId(), '%' . $searchable . '%'), $session->get('search.page'), $config->get('config_max_rows')));
                                //print "I am here1";
      } else {
        $sql = "select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where pd.language_id = '?' and pd.name like '?' or pd.description like '$searchable' and p.date_available getRows($database->splitQuery($database->parse($sql, $language->getId(), '%' . $searchable . '%', '%' . $searchable . '%'), $session->get('search.page'), $config->get('config_max_rows')));
      }

if ($results) {
$view->set('text_results', $language->get('text_results', $database->getFrom(), $database->getTo(), $database->getTotal()));
       
        $product_data = array();

        foreach ($results as $result) {
          $product_data[] = array(
            'name'  => $result['name'],
            'href'  => $url->href('product', FALSE, array('product_id' => $result['product_id'])),
            'thumb' => $image->resize($result['filename'], $config->get('config_image_width'), $config->get('config_image_height')),
            'price' => $currency->format($tax->calculate($result['price'], $result['tax_class_id'])),
                                'quantity' => (int)$result['quantity']
          );
        }

      $view->set('products', $product_data);

      $view->set('page', $session->get('search.page'));
 
        $page_data = array();

        for ($i = 1; $i getPages(); $i++) {
          $page_data[] = array(
            'text'  => $language->get('text_pages', $i, $database->getPages()),
            'value' => $i
          );
        }
 
        $view->set('pages', $page_data);
}
}
 
$template->set('content', $view->fetch('content/search.tpl'));

$template->set($module->fetch());

    $response->set($template->fetch('layout.tpl'));
  }


function page() {
$request  =& $this->locator->get('request');
$response =& $this->locator->get('response');
$session  =& $this->locator->get('session');
$url      =& $this->locator->get('url');

if ($request->has('search', 'post')) {
$session->set('search.search', $request->get('search', 'post'));
  }
 
if ($request->has('description', 'post')) {
$session->set('search.description', $request->get('description', 'post'));
  } else {
$session->delete('search.description');
}
 
      if (($request->has('page', 'post')) || ($request->has('search', 'post'))) {
        $session->set('search.page', $request->get('page', 'post'));
      }

$response->redirect($url->ssl('search'));
}
}
?>

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Mon Oct 08, 2007 10:01 pm

everything works but when you select a new page it sends you back to the search module empty. I bet this has to do with something is not being carried over from my adjustments.

Check it out

http://208.190.126.85:5656


Please HELP ME

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Tue Oct 09, 2007 10:47 pm

HELP PLEASE

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am

Post by derwydd » Wed Oct 10, 2007 5:26 am

FORGET IT ...

I went ahead and fixed it. The way I hacked the search it interfered with the paging.

I went all the way down on search.php to the page() function and took out a line.

//$session->delete('search.description');

I need the description. This simple fix took 3 days.

Oh well

THX

Active Member

Posts

Joined
Wed Aug 29, 2007 12:13 am
Who is online

Users browsing this forum: No registered users and 6 guests