PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Filter showing product variations incorrectly

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
12

Hello

I currently have some variable products, which have several attribute values (e.g Size: 80, 81, 82), but only some of these attributes are assigned to variations (e.g just sizes 80 an 81). Even though the variable product doesn't have variation 82 added to it, the filter counts and shows the variable product when I select size 82. I have dynamic recount and hide empty products"yes" and, in order to speed up the filtering"Cache dynamic recount number for each item in filter" enabled. The filter is showing only"in stock" products.

How to fix that and make the filter to just show variations, which have added to variable products?

Thanks

Hello

Paste your license key here - https://c2n.me/43SC6rb.png -> https://c2n.me/42HBIt7.png

which have several attribute values (e.g Size: 80, 81, 82), but only some of these attributes are assigned to variations (e.g just sizes 80 an 81). - And in the end, in fact, this product has these attributes and it does not matter if this attribute is used for variants.

Parent products are displayed on the result(shop/archive) page (individual variants are not displayed). And for these products you assigned attributes

Hello

Parent products are displayed on the result(shop/archive) page (individual variants are not displayed). And for these products you assigned attributes - since the filter shows"in stock"  products (in my store based on the stock information under variation, as I understand), I do not understand how the filter is correct when it displays products based on just attributes, which isn't used for variation (which in the end includes information about stock). Or am I missing something?

 

Hello

An  example   - https://c2n.me/4c2ZWDd.png - the product  has all these attributes.  And this product 'post_type' => 'product' is displayed on the store page .  And a search query in the database is done for 'post_type' => 'product'.

 The search query for this 'post_type' =>'product_variation' only works on the single page

Hello,

The filter shows products which have the related attributes, but at the moment only"in stock" products are shown. In this case, when it uses only values of the attributes, how it selects"in stock" items? And how is it the correct way to display these"in stock" products? (when it uses attributes for the base value, it cannot display"in stock" items)

Please  activate  this  extension - https://c2n.me/4c38kGk.png and  check  option - https://c2n.me/4c38kGk.png

In my first post I have mentioned, that"The filter is showing only"in stock" products.". The extension is already enabled, hence my question why the filter displays products which, in fact, are not in stock (based on the stock information of the variations).

I inserted the wrong second screenshot - https://c2n.me/4c39QqF.png

OK.  Drop  me exact  link to  the  issue/ Describe in more detail what I have to do to get this error  and  wp-admin  access https://c2n.me/43SC6rb.png ->https://c2n.me/42BAoj4.png

This option is also selected.

Wp-admin access granted.

Hello

I checked it. Everything works correctly as I described earlier

My  short  video - https://c2n.me/4c3Vk0r.mp4

you have not added this attribute as an variant, but in fact the product has this attribute

Hello,

To my opinion the filter's"in stock" feature is still not working properly. Let I explain.

The product indeed had attributes, out of which only one was not assigned as a variation of the product. It did not have neither price or stock information. But it was still displayed even when the filter was assigned to show only products which are in stock. Once the missing attribute was assigned as a variation and stock information (out of stock) was attached to the variation, the product was filtered out and not shown in the filtered product list.

Therefore, in stock feature should, as I understand, show only in stock products, not filter out products, which are not in stock. The"in stock" feature is not working properly, when it filters just based on attributes of a product and does not take into consideration that the attribute is not assigned as a variation and hence do not carry any stock information.

Hello

in stock feature should, as I understand, show only in stock products - Yes! Correct! I  your  case -  Lenne kombe SAHUN tumesinine  - this product "in stock" and   has  attributes 80 86 92 98  - and this product has its own ID 25199

There is a child product witn  ID 25200 (Lenne kombe SAHUN tumesinine Size 92)  - this product which has the attribute 92  and "in stock"

This is what a search query looks like:   Get  all  product  with size 92  AND  stock_status = instock.   Result:  Product  ID 25199

It is logical that the product has this attribute and is in stock and the filter cannot filter by non-existent variations.

Only in your logic, if there is no variation with this size, then it is not in stock. But according to the machine logic, if there is no such variation, then there is no data about this product, nothing is stored in the database and it is impossible to filter

Hello

There is one little mistake in the description: in my bug notice the child product with ID 25200 did not exist, therefore there was not this particular child product with the attribute 92 or stock information. You did add this child product in the video you sent.

As I understand, the search query"Get  all  product  with size 92  AND  stock_status = instock" takes only into account the parent product's stock information - the parent Lenne kombe SAHUN tumesinine is indeed in stock, since it has child product with attribute 98 (and not 92 as was shown in my bug notice), however, when I search size 92, it should not to my best knowledge take into account the parent product's stock information (which is in stock as long as its child product 92 in stock, but parent product is in stock as long as any of its child products is in stock).

 

 in my bug notice the child product with ID 25200 did not exist, - you added the product - https://c2n.me/4c5Shwc.png - I was wrong here - https://c2n.me/4c5Sp0C.pngI will try to explain again

takes only into account the parent product's stock information  - no! search takes into account also variable products.  But if there is no variation with such an attribute, then there is no any  data.

I will try to explain again:

Using this product"Lenne kombe SAHUN tumesinine" as an example. in the database it is stored like this:

#25199 Lenne kombe SAHUN tumesinine  Size:80 86 92 98    Stock status:  in stock

#25200 Lenne kombe SAHUN tumesinine  Size:98    Stock status:  in stock

Search  query : "Get  all  product  with size 98"  Result: #25199, #25200   OR   Search  query : "Get  all  product  with size 98  AND  instock" - Result: #25199, #25200  Everything is correct!

Now:  Search  query : "Get  all  product  with size 92"  Result: #25199    OR  Search  query : "Get  all  product  with size 92  AND  instock" - Result: #25199  Everything is correct ( https://share.pluginus.net/image/i20210520132515.png )!

Now let's add another variant:

#25201 Lenne kombe SAHUN tumesinine  Size:92    Stock status:  out of stock

Search  query : "Get  all  product  with size 92"  Result: #25199, #25201  OR  Search  query : "Get  all  product  with size 92  AND  instock"  -  Result: #25199  BUT but there is information in the database "Get  all  product  with size 92  AND  out of stock" Result: #25201   So  exclude  parent  products  of #25201

 

 

 

 

Hello,

Thank you for clarifying.

You said, that"search takes into account also variable products.  But if there is no variation with such an attribute, then there is no any  data."  But the filter shows items, which does not have any data.

Parent has attributes 80 86 92 98.

This parent has one variation: 98, which has been indicated as"in stock".

When I filter based on size 92, it still shows the product even though it does not have such variation and therefore corresponding stock data. The parent product does not hold any stock data either, so how is it correct to say that it filters correctly? As I understand, the filter at the moment takes the stock data based on the fact that one variation is in stock and since the parent holds requested size as an attribute (not variation), is still shows that.

Yes, I can go through all my 2 000 items at the store and verify that all attributes of parent products are assigned as variations, and make sure that these variations are marked"not in stock", but still, the filter is filtering based on irrelevant data or should at least show information based on the stock data of the variation.

Hello

Please read the previous message. I really don't know how else to explain it

 But if there is no variation with such an attribute, then there is no any  data. - Correct!

But the filter shows items, which does not have any data. - Whay??? Please  read  this - https://share.pluginus.net/image/i20210528125638.png In fact - you have a product with attribute 92 and in stock

The parent product does not hold any stock data either - The parent product has the status:  in stock/  out of stock/ backorder

 

Hello

No, you do not pay enough attention to my explanations. When I posted my issue, there was no child product/variation with attribute 92 and its stock data.

But the filter shows items, which does not have any data. - Whay??? Please read this - https://share.pluginus.net/image/i20210528125638.png In fact - you have a product with attribute 92 and in stock  - No, when I posted my initial issue, there was no such child product/variation with size 92. The product #25199 with size 92 was created by you in an attempt to cover the issue. In my initial post, there was just attribute (attributes 80, 86, 92, 98) of the parent product, but not such (size 92) child products (only with size 98), but the filter in the end displayed this particular product when I filtered by size 92 (or any of the sizes which were not assigned to any variation, eg 80, 86) - there was no stock data associated with size 92 (or 80 and 86) neither was there variation/child product with size 92.

I have several such parent products, which have several attributes, but only some of these attributes have assigned to variations. Will you go over these parent products as well in order to make sure that all these attributes have assigned to a variation product and stock data updated thereof to"out of stock" - the method you used in order to hide the size 92 item.

 

The parent product does not hold any stock data either - The parent product has the status: in stock/ out of stock/ backorder

Hello

I have carefully studied your descriptions, and my explanations are 100% correct

 - No, when I posted my initial issue, there was no such child product/variation with size 92. - Please read my messages carefully, this is very important.  The parent product has  size 92- https://share.pluginus.net/image/i20210602134337.png - And it doesn't matter if there is such a variation! this is how it is stored in your database  AND  this  parent  product  in  stock .  And any search for such parameters - https://c2n.me/4cfdH8c.png Because in fact, thr product with all this data(size 92  in stock) exists/  But  there is no variation  with  size 92 + stock status

You should understand the structure of products in woocommerce

In your case, a variable product is two products:

#25199 Lenne kombe SAHUN tumesinine  Size:80 86 92 98    Stock status:  in stock PARENT

#25200 Lenne kombe SAHUN tumesinine  Size:98    Stock status:  in stock VARIANT

Very important: only the parent product is displayed on the shop/category page.

So  search  by   Size  92  + In stock -  Shows the PARENT product, because there is no reason to hide it  and  the product has all search attributes.  There is no variation that would indicate that this product cannot be displayed

Hello

So, as I understand, the parent is displayed as long as it has requested attribute (for example in current case 80, 86 or 92), which might not be assigned to its variation (for example 80, 86 and 92) and at least one of its variation is in stock (in current case size 98).

The filter is using parent product attribute data to filter the products, correct me if I'm wrong. How this can be correct?

 

Hello

You are partly right.

as I wrote before, the  shop or category page only displays parent products. Database query is made only for parent products.  And it doesn't depend on my plugin.

But my plugin plugin (if you set the desired settings) checks the variations. If there is no such variation  with  size 92   AND  parent  product  has size 92 + instock - there is no reason to hide the parent product

12