Skip Navigation

[Resolved] Show only parent woocommerce category in post form

This support ticket is created 5 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Shane 5 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#1527005

Hello,
I've created a post form for adding products following this guidance https://toolset.com/learn/create-an-ecommerce-wordpress-site/#step-11

The form displays all product categories as a dropdown and I would like to shown only the parent, user would choose it, then I would drill down and show the sub category, and so on.

Current list of categories shown e.g.
Accessories
- Bags
- Jewelry
-- Rings
Clothes
- Underwear
-- Bra's
- Skirts
- Tshirts
Shoes

What I would like to shown on the dropdown
Accessories
Clothes
Shoes

2nd step, eg. user clicked on Accessories, it would show
- Bags
- Jewelry

3rd step, user clicked on Jewelry
-- Rings

Where can I change this drop-down behavior?

#1527329

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Goncala,

Unfortunately this isn't possible to do without the use of custom coding.

Since this is a single taxonomy then all the terms will be displayed for you to choose from.

Thanks,
Shane

#1527415

Hi Shane,

What about these solutions proposed here?
https://toolset.com/forums/topic/showing-taxonomy-terms-only-once-a-drill-down-set-of-pages/
https://toolset.com/forums/topic/add-toolset-view-to-toolset-form/

Is that something that I could adapt for my situation?
I just want some workaround since I expect to have around 200 categories and it's unacceptable from a User perspective...

#1527477

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Goncalo,

The solution here
https://toolset.com/forums/topic/showing-taxonomy-terms-only-once-a-drill-down-set-of-pages/

This is for a view and not for the form.

Secondly this solution here
https://toolset.com/forums/topic/add-toolset-view-to-toolset-form/

Won't work either because your dropdowns are going to be dependent. You won't be able to have a dependent taxonomy in this fashion.

It is possible if you use a combination of custom fields so when the user select value in Custom Field A only the custom field B will display.

This will require some amount of setup in Types with the use of the conditional statement for the fields.

Thanks,
Shane