Change behaviour on the instock filter

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
7 years 2 months ago #260500

Hi!
Is it possible to make filter "instock" to apply on quantity -1 and 0 ? Now its working for 0 only.

Thanks!

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 2 months ago #260501

Hi,

Please provide basic details of your current configuration ; starting with the HikaShop version number you're using and details about your product page overrides.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
7 years 2 months ago #260695

Your version is 2.6.0
Joomla 3.6.4

I have some overides, like
filter.php
listing_price.php
show_default.php

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 1 month ago #260699

Hi,

Please note that you're using an old version of HikaShop (September 2015)
Your issue has been fixed in recent packages.
www.hikashop.com/support/documentation/5...ashop-changelog.html

Here a thread talking about it :
www.hikashop.com/forum/product-category-...duct-micro-data.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
7 years 1 month ago #260802

Hi!
I installed the lastest version. It didn t change anysting with thw instock filter. Maybe you didnt understand the issue. In stock works only with quantity 0 . I needed it to work also for -1 (unlimited quantity.

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 1 month ago #260819

Hi,

I'm afraid that does not make any sense.

Here the code in HikaShop 3 :

<meta itemprop="availability" content="http://schema.org/<?php echo ($this->row->product_quantity != 0) ? 'InStock' : 'OutOfstock' ;?>" />
And it makes perfect sense !

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
7 years 1 month ago #260897

Jerome, I just tell you something I need.
What do you mean by "it doesn t make any sense" ?
You re not helping me, you re judging me .

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

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
7 years 1 month ago #260898

where is the code you sent me?
<meta itemprop="availability" content=" schema.org/ <?php echo ($this->row->product_quantity != 0) ? 'InStock' : 'OutOfstock' ;?>" />

Last edit: 7 years 1 month ago by verzevoul.

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
7 years 1 month ago #260904

Hi,

The content you're looking for is in the product page (show_default, show_tabular, show_reverse).
As I mentioned in the the forum thread I gave you before :
www.hikashop.com/forum/product-category-...as-stock.html#253948

And in very old version of HIkaShop, the micro data was split in a lot of view, as you can see in that post :
www.hikashop.com/forum/product-category-...uct-view.html#246902

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
7 years 1 month ago #261120

It doens t change a thing.
Sorry but I believe its not the case.
I need my filter module to work
"Hi!
Is it possible to make filter "instock" to apply on quantity -1 and 0 ? Now its working for 0 only.

Thanks!"

I tried the file and checked the overrides too. Should this file be in filters somewhere, or in a plugin?

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

  • Posts: 4486
  • Thank you received: 609
  • MODERATOR
7 years 1 month ago #261160

Hello,

You have to know that in his normal and default behavior the stock filter with "in stock" will take ALL product quantity (>0) AND unlimited (-1)
That's a logical way to proceed because unlimited, means available.

And so, your question isn't logical,:

"I needed it to work also for -1 (unlimited quantity)."

because by default must be the default way to proceed, and so idea judgement isn't the point...

But maybe there is for some reason a bug ?...
I note that you have some override on your filter view, can you try to remove (after save it on your side) this override?
If after this, your filter behavior is corrected, that's mean that your override make something wrong.

This point isn't easy to understand:

"Is it possible to make filter "instock" to apply on quantity -1 and 0"

So you mean in stock => 0 stock ?...
Well, maybe tour have a precise purpose or context but just this is difficult to understand.

Awaiting news from you.

Regards

Last edit: 7 years 1 month ago by Philip.

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

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
7 years 1 month ago #261169

Yes. 0 quantity for means not available.
But -1 which means unlimited, for me in my shop, I want it to mean "not available" when the user uses the instock filter.
Its a matter of time.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
7 years 1 month ago #261242

Hi,

Then it's not a bug but some custom coding you want.
You'll have to change the line:

$filters[]=' b.product_quantity!=0 ';
to something like that:
$filters[]=' b.product_quantity>0 ';
in the file administrator/components/com_hikashop/classes/filter.php

The following user(s) said Thank You: verzevoul

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

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
7 years 1 month ago #261285

Thank you Nikolas!

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

  • Posts: 1025
  • Thank you received: 11
  • Hikashop Business
6 years 11 months ago #266296

Can I create an orerride? Because when I update I loose my customs.
Its on the administrator/..

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
6 years 11 months ago #266311

Hi,

Sure. You can copy the file to templates/YOUR_TEMPLATE/html/com_hikashop/administrator/classes/filter.override.php and rename the class hikashopFilterClass to hikashopFilterClassOverride in it and the system should automatically use your file and class instead of HikaShop's core one.

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

Time to create page: 0.080 seconds
Powered by Kunena Forum