Skip Navigation

[Resolved] Field 'views_woo_in_stock' seems to be legacy now – how can I make it work

This support ticket is created 3 years, 3 months ago. 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.

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)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 3 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2151631

Tell us what you are trying to do?
We are using the field 'views_woo_in_stock' in several if-statements to get the available products in our shop. Since the this function seems to be legacy, the products will stay online forever or until some of my colleages will change the custom filed manually.

Exampe:

[wpv-conditional if="( $(views_woo_in_stock) eq '1' )"]
 <div id="dinnereinzelergebnis" class="fusion-fullwidth fullwidth-box dinnersuchergebnis nonhundred-percent-fullwidth"  style='background-color: #242424;background-position: center center;background-repeat: no-repeat;padding-top:20px;padding-right:30px;padding-bottom:20px;padding-left:30px;z-index:1;'><div class="fusion-builder-row fusion-row "><div  class="fusion-layout-column fusion_builder_column fusion_builder_column_1_5  fusion-one-fifth fusion-column-first dinnerfilterdatumaussen 1_5"  style='margin-top:0px;margin-bottom:20px;width:20%;width:calc(20% - ( ( 4% + 4% + 4% + 4% ) * 0.2 ) );margin-right: 4%;'>
[/wpv-conditional]

The cron job does not work anymore. What is the right way to us the 'in_stock'-function?

URL: hidden link
hidden link

#2152621

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Yes - it should work as before - is it not working now? If yes:
Where you added the conditional statement, can you please share problem URL and admin access details.

*** 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.

#2152777

Minesh
Supporter

Languages: English (English )

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

I found that on the custom field group listing page the custom field group "WooCommerce Views filter fields" was not activated. I just activated it.
=> hidden link

Can you please confirm it works at your end as well.

#2152983

Thank you. But I still do not get, why this are now custom fields?!

What about the cron job, which will set '1' automatically if products are in stock?

I have to wait until monday. My colleague will test the functionality.

#2153473

Minesh
Supporter

Languages: English (English )

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

ok I got the news that with the new version of Toolset WooCommerce Blocks - the CRON job feature was removed and that is why you should not use the fields like "views_woo_in_stock" with your conditional statements.

You need to adjust the conditional statement and you should try to create a custom shortcode that should return the product stock status and based on the return value you display the output accordingly.