- Posts: 45
- Thank you received: 0
Don't show out of stock products - search plugin
15 years 1 month ago #24120
by Karloz
Don't show out of stock products - search plugin was created by Karloz
Pls how to ?
Found the plugin @ plugins/search/hikashop_products.php
Thank you very much,
Karloz
Found the plugin @ plugins/search/hikashop_products.php
Thank you very much,
Karloz
Please Log in or Create an account to join the conversation.
15 years 1 month ago #24143
by nicolas
Replied by nicolas on topic Re: Don't show out of stock products - search plugin
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.
This attachment is hidden for guests.
Please update the plugin with this package and deactivate the new "out of stock products" option and it will work like you want.
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
15 years 1 month ago #24162
by Karloz
Replied by Karloz on topic Re: Don't show out of stock products - search plugin
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:
? ?
In database plugin config is correctly "out_of_stock_display=0"
found this, but i don't know php:
Code:
$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.
15 years 1 month ago #24164
by nicolas
Replied by nicolas on topic Re: Don't show out of stock products - search plugin
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');
$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.
15 years 1 month ago - 15 years 1 month ago #24166
by Karloz
Replied by Karloz on topic Re: Don't show out of stock products - search plugin
didnt work, so i tried to hardcoded in the original plugin like:
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
Code:
$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: 15 years 1 month ago by Karloz.
Please Log in or Create an account to join the conversation.
15 years 1 month ago #24167
by nicolas
Replied by nicolas on topic Re: Don't show out of stock products - search plugin
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;
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.
15 years 1 month ago #24168
by Karloz
Replied by Karloz on topic Re: Don't show out of stock products - search plugin
Yep joomfish is used ... still doesn't work o_O
Please Log in or Create an account to join the conversation.
15 years 1 month ago #24169
by Karloz
Replied by Karloz on topic Re: Don't show out of stock products - search plugin
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 :[
i tried the remove all overrides, the search still didnt work properly then :[
Please Log in or Create an account to join the conversation.
15 years 1 month ago #24170
by nicolas
Replied by nicolas on topic Re: Don't show out of stock products - search plugin
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 ) . '))';
$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.
15 years 1 month ago #24171
by Karloz
Replied by Karloz on topic Re: Don't show out of stock products - search plugin
joomla 1.5.23
Please Log in or Create an account to join the conversation.
15 years 1 month ago #24174
by Karloz
Replied by Karloz on topic Re: Don't show out of stock products - search plugin
works !
thank you very much !
here are all the mods together
This attachment is hidden for guests.
here are all the mods together
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
Time to create page: 0.221 seconds