Close

Filter by In Stock Attribute Combinations Only

jaxuk
10 years ago
#4044 Quote
Avatar
  • 9
Hi,

I have just noticed that the Attributes filter does not take into account whether an attribute combination is in stock or not.

This is not how I would expect the filters to behave, I would only want to see products which are in stock - otherwise it's a bit pointless.

Is there any plans to implement this?

Thanks
Boyko
10 years ago
#4048 Quote
Avatar
  • 1570
jaxuk wrote:
Hi,

I have just noticed that the Attributes filter does not take into account whether an attribute combination is in stock or not.

This is not how I would expect the filters to behave, I would only want to see products which are in stock - otherwise it's a bit pointless.

Is there any plans to implement this?

Thanks


Hi jaxuk,

Please vote for this idea in our UserVoice portal.

Thanks
Regards,
Nop-Templates.com Team
sunnyw
10 years ago
#4453 Quote
Avatar
  • 7
Are there any work arounds for this issue? Where did the plugin controller get the products from? I put my own customizations in my project so ProductVariantAttributeCombination have a StockQuantity of 0 will not show in the category page, but the filters seems generated from a different result set.

The incorrect behaviour being not only the no stock products will show after a search, but the SpecificationAttribute filter is also generated from all products (stock / no stock) instead of stock products only (What I provided in the category page result set)
Boyko
10 years ago
#4460 Quote
Avatar
  • 1570
sunnyw wrote:
Are there any work arounds for this issue? Where did the plugin controller get the products from? I put my own customizations in my project so ProductVariantAttributeCombination have a StockQuantity of 0 will not show in the category page, but the filters seems generated from a different result set.

The incorrect behaviour being not only the no stock products will show after a search, but the SpecificationAttribute filter is also generated from all products (stock / no stock) instead of stock products only (What I provided in the category page result set)


HI sunnyw,

Unfortunately there is no workaround for this. It is not that trivial to be done and will require a lot of changes in the plugin controllers and services. Also such change could greatly harm the performance of the filters. There are some changes to the stock availability coming in nopCommerce 3.3, which might make things simpler and if so then we can go and implement this and add a setting in the plugin's administration to enable this feature. For now please vote for it in our UserVoice portal, so that we know there are a lot of interest in it.

Best Regards,
Nop-Templates.com Team
Regards,
Nop-Templates.com Team
sunnyw
10 years ago
#4467 Quote
Avatar
  • 7
Thanks BOYKO for your reply.

For those who are having the same issues and require a work around / temp solution.

The work around we found is to use a sproc to run regularly that will update any products with zero stock to Published = 0. This is now correctly shown in the category result page.

I noticed this plugin will create a sproc ProductLoadAllPagegNopAjaxFilters, The proper solution would be take in extra parameter ShowNoStock and taking the products out from the result set, but I don't have the source code for it, so I moved on.
Boyko
10 years ago
#4468 Quote
Avatar
  • 1570
Hi sunnyw,

Nice solution!

Thanks
Regards,
Nop-Templates.com Team
jaxuk
10 years ago
#4481 Quote
Avatar
  • 9
A work around I've put in place for was to modify the updateInventory method to remove any attributesValues and attributeCombinations which have zero stock.

This works for me because the only attibute we use is "size" for clothing.

Also in the same method, if there is no longer any product attributes and the product is set to manage inventory by attributes then the product is unpublished.