Don't show out of stock products - search plugin

  • Posts: 45
  • Thank you received: 0
13 years 3 months ago #24120

Pls how to ?

Found the plugin @ plugins/search/hikashop_products.php

Thank you very much,
Karloz

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #24143

There is no option for that.
Please update the plugin with this package and deactivate the new "out of stock products" option and it will work like you want.

File Attachment:

File Name: hikashop_products.zip
File Size:3 KB

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 0
13 years 3 months ago #24162

Updated, configured but out of stock products are still in search results.
In database plugin config is correctly "out_of_stock_display=0"

found this, but i don't know php:

$out_of_stock = $this->params->get('out_of_stock_display','1');
		if(!$out_of_stock){
			$filters[]='a.product_quantity!=0';
		}

? ?

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #24164

Then let's try that:
$out_of_stock = (int)$this->params->get('out_of_stock_display','1');

instead of:
$out_of_stock = $this->params->get('out_of_stock_display','1');

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 0
13 years 3 months ago #24166

didnt work, so i tried to hardcoded in the original plugin like:

$filters = array('a.product_published=1','a.product_type=\'main\'','a.product_quantity!=0');

but didnt work as well, then tried to unpublish some products and search with the original plugin, the unpublished products shown up, so there must be something wrong with the filters in general

Last edit: 13 years 3 months ago by Karloz.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #24167

Mmmm. It's working fine on our end. Maybe it comes from joomfish. Do you use joomfish ?

If so, could you try to replace the line:
$query = ' SELECT DISTINCT '.$select.' FROM '.hikashop_table('jf_content',false) . ' AS b LEFT JOIN '.hikashop_table('product').' AS a ON b.reference_id=a.product_id WHERE '.implode(' AND ',$filters2).' ORDER BY '.$order;

by:
$filters2[]=implode(' AND ',$filters);
$query = ' SELECT DISTINCT '.$select.' FROM '.hikashop_table('jf_content',false) . ' AS b LEFT JOIN '.hikashop_table('product').' AS a ON b.reference_id=a.product_id WHERE '.implode(' AND ',$filters2).' ORDER BY '.$order;

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 0
13 years 3 months ago #24168

Yep joomfish is used ... still doesn't work o_O

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 0
13 years 3 months ago #24169

On the site is used yootheme warp template framework (don't know what it exactly is)
i tried the remove all overrides, the search still didnt work properly then :[

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 3 months ago #24170

There seems to be another problem when there are several fields selected for the search. Try to also replace the line:
$filters[] = '(' . implode( ') OR (', $wordFilters ) . ')';

to:
$filters[] = '((' . implode( ') OR (', $wordFilters ) . '))';

and the line:
$filters2[] = '(' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wordFilters2 ) . ')';
to:
$filters2[] = '((' . implode( ($phrase == 'all' ? ') AND (' : ') OR ('), $wordFilters2 ) . '))';

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 0
13 years 3 months ago #24171

joomla 1.5.23

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 0
13 years 3 months ago #24174

works ! B) thank you very much !

here are all the mods together

File Attachment:

File Name: hikashop_p...0823.zip
File Size:4 KB

Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum