Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Site Search Plus


Jack_mcs

Recommended Posts

Hi Jack,

 

Thanks for pointing me to this add-on. Just a question before I start though. I have the Simple Search Box (http://addons.oscommerce.com/info/3329) add-on installed into my header and it reroutes the search.php via search2.php, do you know if this will cause problems trying to install your add-on?

 

Thanks.

 

Right I've had a go at mergin this, but came up with a conflict with More Pics (yet again!). It has given me this error:

 

1054 - Unknown column 'pov.products_options_values_name' in 'where clause'

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id left join products_images pi on p.products_id = pi.products_id and pi.category_page = '1' , products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((((pd.products_name like '%blue%' or p.products_model like '%blue%' or m.manufacturers_name like '%blue%' )) or ( pov.products_options_values_name like '%blue%' ) or pd.products_description like '%blue%') )

 

[TEP STOP]

 

I presume that this is caused by the advanced_search_result.php as when uploading the old file it is still fine, the others were simple changes also. Any ideas?

 

I think this might be the problematic lines:

 

// More Pics
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1'  ";

 

and

 

 /************** BEGIN SITESEARCH CHANGE ******************/ 
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_ATTRIBUTES . " pa on p.products_id = pa.products_id left join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on pa.options_values_id = pov.products_options_values_id ";
 /************** END SITESEARCH CHANGE ******************/

 

As it stands I have not made any changes to the advanced_search_result.php file. Once I clicked submit on the new site search page it takes me to the advance search page saying that not enough information has been inputted. I expect once I fix this file then that will be resolved?

Edited by Whiskers
Link to comment
Share on other sites

1054 - Unknown column 'pov.products_options_values_name' in 'where clause'

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id left join products_images pi on p.products_id = pi.products_id and pi.category_page = '1' , products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((((pd.products_name like '%blue%' or p.products_model like '%blue%' or m.manufacturers_name like '%blue%' )) or ( pov.products_options_values_name like '%blue%' ) or pd.products_description like '%blue%') )

The parenthesis (), seem to be wrong. You need to go over how you merged the changes to the advanced search code.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The parenthesis (), seem to be wrong. You need to go over how you merged the changes to the advanced search code.

 

I just used the code the Beyond Compare made in the merge section:

 

// More Pics
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1'  ";
 /************** END SITESEARCH CHANGE ******************/

Link to comment
Share on other sites

I just used the code the Beyond Compare made in the merge section:

 

// More Pics
 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_IMAGES . " pi on p.products_id = pi.products_id and pi.category_page = '1'  ";
 /************** END SITESEARCH CHANGE ******************/

 

Do you think there's a way I can remedy this?

Link to comment
Share on other sites

Yes, it is just a matter of merging the code correctly. I don't offer help with doing that, unless it is an obvious problem - sometimes, because there are just too many situations where that comes up.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Yes, it is just a matter of merging the code correctly. I don't offer help with doing that, unless it is an obvious problem - sometimes, because there are just too many situations where that comes up.

 

Ok no worries. I will try and get it sorted elsewhere. Cheers!

Link to comment
Share on other sites

  • 2 months later...

Hi Everyone,

 

I was trying to install this contribution following the instructions provided. After following all the steps I got 2 warnings and 1 fatal error and I could not access my shop. I retraced my steps and undid all the changes I had made. Now I am getting this error:

 

 

Fatal error: Call to a member function add_current_page() on a non-object in /home/secretsh/public_html/shop/includes/application_top.php on line 314

 

While making the changes to add the search box, I did nothing to application_top.php so I'm not sure where there's an error there. Anyway, my store is gone and I don't know why.

 

I would really appreciate some advice from anyone.

 

Thanks in advance to anyone who can offer help.

 

Tanja.

Link to comment
Share on other sites

Fatal error: Call to a member function add_current_page() on a non-object in /home/secretsh/public_html/shop/includes/application_top.php on line 314

See this.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks for the prompt response, Jack.

 

After about 6 hours the shop reappeared without me doing anything. So the store is working as before but I still don't have your search box!

 

Step 5 of your instructions say:

 

In the includes/modules/product_listing.php file,

 

FIND (around line 148)

 

$list_box_contents[0][] = array('params' => 'class="productListing-data"',

'text' => TEXT_NO_PRODUCTS);

 

ADD ABOVE

 

/************** BEGIN SITESEARCH CHANGE ******************/

if (tep_not_null($keyword))

{

$list_box_contents[0][] = array('params' => 'class="productListing-data"',

'form' => tep_draw_form('product_notify', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'post'),

'align' => 'left',

'text' =>

'<table border="0"><tr><td class="productListing-data" colspan="2">' . TEXT_NO_PRODUCTS_KEYWORD . '</td></tr>' .

'<tr><td height="5"></td></tr><tr><td width="25%" class="productListing-data">' . TEXT_PRODUCT_NAME . '</td><td>' . tep_draw_input_field('keywords', '', 'size="40" maxlength="255" ') . '</td></tr>' .

 

'<tr><td height="5"></td></tr><tr><td class="productListing-data">' . TEXT_CUSTOMER_EMAIL . '</td><td>' . tep_draw_input_field('cust_email', '', 'size="40" maxlength="100"', false) . '</td></tr>' .

 

'<tr><td height="5"></td></tr><tr><td class="productListing-data" valign="top">' . TEXT_COMMENTS . '</td><td>' . tep_draw_textarea_field('comments', 'soft', 10, 4, '', '', false) . '</td></tr>' .

 

'<tr><td height="5"></td></tr><tr><td colspan="2" align="center" class="productListing-data"><INPUT type="submit" name="request_submit" value="Submit"></a></td></tr>' .

'</table>');

}

else

/************** BEGIN SITESEARCH CHANGE ******************/

 

However, the code in my includes/modules/product_listing.php is:

 

if (($rows/2) == floor($rows/2)) {

$list_box_contents[] = array('params' => 'class="productListing-even"');

} else {

$list_box_contents[] = array('params' => 'class="productListing-odd"');

}

 

I'm not sure where to add your code since my code is different. I installed it in my 'test' store and it functions flawlessly.

 

Tanja.

Edited by TanjaPetro
Link to comment
Share on other sites

That part of the code is for displaying a form if no products are found by the search so somewhere in that file should be TEXT_NO_PRODUCTS. You will need to add the code in around that. If your product listing file doesn't contain TEXT_NO_PRODUCTS, then it has been edited and I've no way of telling where the code should be added.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

That part of the code is for displaying a form if no products are found by the search so somewhere in that file should be TEXT_NO_PRODUCTS. You will need to add the code in around that. If your product listing file doesn't contain TEXT_NO_PRODUCTS, then it has been edited and I've no way of telling where the code should be added.

 

I found TEXT_NO_PRODUCTS like this:

 

<table cellpadding="0" cellspacing="0" class="product">

<tr><td class="padd_22"><?php echo TEXT_NO_PRODUCTS ?></td></tr>

</table>

 

Should I insert your code above this and cross my fingers?

Link to comment
Share on other sites

I found TEXT_NO_PRODUCTS like this:

 

<table cellpadding="0" cellspacing="0" class="product">

<tr><td class="padd_22"><?php echo TEXT_NO_PRODUCTS ?></td></tr>

</table>

 

Should I insert your code above this and cross my fingers?

It looks like you are using a template that has changed how that code works. It can be made to work but is not a simple insert and isn't something that I offer support for due to the large number of variations.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It looks like you are using a template that has changed how that code works. It can be made to work but is not a simple insert and isn't something that I offer support for due to the large number of variations.

 

Thanks a lot for all your help.

Link to comment
Share on other sites

  • 2 months later...

I have a question Jack, there is any way that the query search in product description only because We use a share serve and when many people search at the same time the queries consume a lot of server sources. Please let me know

Link to comment
Share on other sites

I have a question Jack, there is any way that the query search in product description only because We use a share serve and when many people search at the same time the queries consume a lot of server sources. Please let me know

I wonder if I modify.

/************** BEGIN SITESEARCH CHANGE ******************/

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_ATTRIBUTES . " pa on p.products_id = pa.products_id left join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on pa.options_values_id = pov.products_options_values_id ";

/************** END SITESEARCH CHANGE ******************/

for

/************** BEGIN SITESEARCH CHANGE ******************/

$from_str = "from " . TABLE_PRODUCTS .

/************** END SITESEARCH CHANGE ******************/

will be able to achive what I am looking for.

 

 

I also wonder what the effects will be on the search result if I modify the codes.

Thanks

Link to comment
Share on other sites

I have a question Jack, there is any way that the query search in product description only because We use a share serve and when many people search at the same time the queries consume a lot of server sources. Please let me know

In includes/boxes/search.php, find this line

                               'text' => '<table border="0" width="100%" cellspacing="0" cellpadding="1"><tr><td class="infoBoxContents" valign="top" colspan="3">' . BOX_ADVSEARCH_KW . '</td></tr><tr><td class="infoBoxContents" valign="top" colspan="3">' . tep_draw_hidden_field('search_in_description','1') . tep_draw_hidden_field('inc_subcat','1') . tep_draw_input_field('keywords', '', 'size="15" maxlength="30" style="width: ' . (BOX_WIDTH) . 'px" onFocus="form.keywords.value=\'\'"') . '</td></tr>' .

and change it to

                               'text' => '<table border="0" width="100%" cellspacing="0" cellpadding="1"><tr><td class="infoBoxContents" valign="top" colspan="3">' . BOX_ADVSEARCH_KW . '</td></tr><tr><td class="infoBoxContents" valign="top" colspan="3">' . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="15" maxlength="30" style="width: ' . (BOX_WIDTH) . 'px" onFocus="form.keywords.value=\'\'"') . '</td></tr>' .

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Jack, this is my search.php. I can not find whta you ask me to search.

 

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_SEARCH);

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),

'align' => 'center',

'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

 

new infoBox($info_box_contents);

?>

Link to comment
Share on other sites

This is the support thread for the SiteSearch Plus contribution and that is how I responded. You don't have the contribution installed, or it is not installed correctly, so you need to post your question in the general forum or install it correctly.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 months later...

I see my posted ended up on the General Add-Ons Support. I'm reposting in this thread:

 

I'm really liking this contribution. It's so much more robust and useful than the standard osC search.

 

In my database I have a column for products_info in the products_description table. I think this was added as part of another contribution.

 

I need to include that column in the Site Search results.

 

How would I modify Site Search to include the products_info in the search results?

 

I've looked through the code, and tried a few tweaks on my own without success.

 

Any help would be appreciated!

Link to comment
Share on other sites

  • 3 months later...

Hi

 

I thought I had installed to Jack's specs.....having saved a backup....BUT, seems file modification is excempt from the backup, just saves data, orders, customer details etc, so whenI tried to roll back, it did not work.

 

I now have this

Link to comment
Share on other sites

Gosh, just posted itself..so to conclude...

 

anyway

 

All a search returns now, is an blank page with :

 

"No input file specified."

 

I went through the install again and same result, so would be grateful of an idea of where to start looking for conflict, missing line, missing php file...anything to be going on would be appreciated.

 

Many Thanks

 

Martyn

Link to comment
Share on other sites

Gosh, just posted itself..so to conclude...

 

anyway

 

All a search returns now, is an blank page with :

 

"No input file specified."

 

I went through the install again and same result, so would be grateful of an idea of where to start looking for conflict, missing line, missing php file...anything to be going on would be appreciated.

That's not a message coming from this contribution. It looks more like a php error saying some file is missing. You're host may have error reporting turned off so you may want to ask them what the real error is.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The Golden Rule is.........Don't Panic........

 

The upshot was all about looking too close and missing the big picture.

 

It all came down to neglecting to put advanced_search_result.php at the top of the tree.

 

No surprise that there was nothing to find when the essential reference was missing !!

 

Many thanks for your speedy reply, as ever.

 

This contrib opens up such a wealth of opportunity for customers to really dig around and actually find items that are often described in great detail, but whose title does not include the search term they use, I cannot thank you enough.

 

Kind Regards

 

Martyn

Link to comment
Share on other sites

  • 6 months later...

i added this to my site but if i do a search then scroll down the products to the back button i get this error

1054 - Unknown column 'pv.products_options_values_id' in 'on clause'

 

select pv.products_options_values_id as id, pv.products_options_values_name as text from products_options_values pv, products_options po join products_options_values_to_products_options popv on (pv.products_options_values_id = popv.products_options_values_id) where popv.products_options_id = po.products_options_id and popv.products_options_id =2 and po.language_id =1 group by pv.products_options_values_id, products_options_values_name

 

[TEP STOP]

 

also the search doesnt seem to find the right products all the time

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...