Skip Navigation

[Résolu] Views Filter by _stock doest not work properly

This support ticket is created Il y a 3 années et 6 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Marqué : ,

This topic contains 9 réponses, has 2 voix.

Last updated by Minesh Il y a 3 années et 6 mois.

Assisted by: Minesh.

Auteur
Publications
#1767917

Pat

Hello,

I have a site with Toolset +WC and have created 2 Views
1. To list all products with _stock <= 0
2. To list all products with _stock >0

The issue I'm facing here is that if I change manually the stock inside a product and move it from 0 to 3 for example, then the Views are not taking this into consideration.

Some additional info :
- In the filter, I'm using field _stock, is a string (but I have also tried with numerical) + the condition
- I have checked in the database that the _stock field was really changing
- This seems to happend under certain conditions (from time to time, moving a stock to 0 is working!

Regards
Pat

#1768069

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL where you added the view and access details. Please also share a product sample link where you added the stock.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1768109

Pat

Hi Minesh,

Sorry but I'm not able to share url info on this.
First, could you confirm that I need to use the "string" (and not the numerical) in the filter for a custom field?
What I have seen on this is that from time to time, the issue is appearing. So, not sure this is dependent on the Views or on the product configuraiton. I have tried to see if any differences between products that are not moving when stock is 0, but nothing has come to my attention !
Let me know if I can give you additional info.
Regards
Pat

#1768121

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - you should always use numeric as the stock value will be numeric.

I will require access details to your current site or you can setup a test site where I can see the issue and share the access details.

#1771695

Pat
toolset-filter.jpg

Hi Minesh,

I have place the filter field as numerical and this is not changing the issue.
Just a point that I can relate : when the filter result is not good in the frontend, if I resave the Views in the backend, then the result became good.
Don't know if there is something special in the save process?
Here is my Views loop :

<wpv-loop>[wpv-item index=1]{"value":"[wpv-post-id]","label":"[wpv-post-title]-[wpv-post-field name="views_woo_price"]€ - [wpv-post-field name='_stock']"}[wpv-item index=other],{"value":"[wpv-post-id]","label":"[wpv-post-title]-[wpv-post-field name="views_woo_price"]€ - [wpv-post-field name='_stock']"}
		</wpv-loop>

And you can find a sceenshot of the different filter setup attached.

Regards
Pat

#1772017

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

What you mean by result is not good.

Can you please share problem URL as well as access details and also share information about what is your expected result.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1772143

Pat

Hi Minesh,

Thanks for your feedback.
Unfortunately, I'm not able to give you access. Is there something I can do in order to better understant the issue?

By result is not good, I mean that some products are listed in the Views but have stock = 0. So they should not be listed with this Views !!! As soon as I record the Views again, the result is different and those products with stock =0 do not appear no more?

Regards
Pat

#1773195

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is strange.

Is it possible for you to send me duplicator copy of your install? If yes:

Can you please send me duplicator copy of your install:
=> https://toolset.com/faq/provide-supporters-copy-site/

#1773545

Pat

Hi Minesh,

Thanks for your answer.
That sounds difficult as this is a very huge site and Duplicator will not manage all files.
In the meantime, I am looking for a workaround by using a hook (wpv_filter_query) in order to see if I'm getting the same issue.
I will keep you informed of the result as soon as this will be done.

In parallel, if I can give you specific info that could helps you to move forward, let me know.

Regards
Pat

#1775667

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - please try and let me know if you will require further assistance.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.