Skip Navigation

[Resolved] Changing text in custom search dropdown (replacing 0 and 1 for stock status)

This thread is resolved. Here is a description of the problem and solution.

Problem:
Changing text in custom search dropdown (replacing 0 and 1 for stock status)

Solution:
Toolset views allow you the way so that you can choose to use Custom Labels and Values for Select Inputs.

you can find proposed solution, in this case, with the following reply.
https://toolset.com/forums/topic/changing-text-in-custom-search-dropdown-replacing-0-and-1-for-stock-status/#post-1096141

Relevant Documentation:

This support ticket is created 6 years, 5 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 3 voices.

Last updated by mattheww-11 6 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1095183

Hi,

I have a filter in my custom search for WooCommerce Stock status. I would like the dropdown menu to show "Available" and "Sold" rather than "0" and "1"

I resolved this issue on my product view pages with the code below in a DIVI text module, but I can't seem to change the dropdowns using that code in Toolset > Edit View > Search and Pagination

{!{wpv-conditional if="( $(views_woo_in_stock) eq '1' )"}!}Available{!{/wpv-conditional}!}
{!{wpv-conditional if="( $(views_woo_in_stock) eq '0' )"}!}Sold{!{/wpv-conditional}!}

thanks!

#1095756
Bildschirmfoto 2018-08-30 um 17.28.32.png

When inserting the Filter, you can choose to use Custom Labels and Values for Select Inputs.
ScreenShot is attached.

There, you could set such a custom label, and make sure to match the existing values.

#1096141

Thanks, that works. Except now my default label isn't displaying. How do I make that visible too?

#1096155

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - you should add your default label as a new option as you set your custom options and set it as default (first option).

#1096672

thanks