最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to toggle between two custom fields in WordPress woocommerce 'WC Product Field Group' plugin?

programmeradmin0浏览0评论

I have a full suit tailoring WordPress website and it using woocommerce plugin. I need 2 custom field groups to show in single-product page.

  1. Custom Measurements (Precise) In this method the client has to measure and enter every single data like height weight etc.

  2. Standard Sizes (Quick) This is world standard sizes. Small, Medium,Large,etc.

I've created 2 custom field groups and they are visible only with 'Product Category name'

I need to toggle between these 2 field groups when a client selects their interested measuring method 1 or 2.

I don't have good knowledge in PHP so if its possible I prefer some easy method to do that.

I have a full suit tailoring WordPress website and it using woocommerce plugin. I need 2 custom field groups to show in single-product page.

  1. Custom Measurements (Precise) In this method the client has to measure and enter every single data like height weight etc.

  2. Standard Sizes (Quick) This is world standard sizes. Small, Medium,Large,etc.

I've created 2 custom field groups and they are visible only with 'Product Category name'

I need to toggle between these 2 field groups when a client selects their interested measuring method 1 or 2.

I don't have good knowledge in PHP so if its possible I prefer some easy method to do that.

Share Improve this question asked Sep 18, 2019 at 7:53 Gimhana JayasekaraGimhana Jayasekara 112 bronze badges 2
  • Hi Gimhana Jayasekara, welcome to WordPress Development. As a rule, the community considers questions about third-party plugins off-topic so you might notice some down-votes. Nevertheless, I hope someone can give you a good answer. You can find out what questions are a good fit here. – Matthew Brown aka Lord Matt Commented Sep 18, 2019 at 13:39
  • @MatthewBrownakaLordMatt Thank you so much for not removing my post. I've found a solution and put it here. Hope that may help someone. I didn't have anyone to ask. I searched for 2 days and then I decide to ask here. – Gimhana Jayasekara Commented Sep 19, 2019 at 10:58
Add a comment  | 

1 Answer 1

Reset to default 0

I've found a way to do that. Its all in WC Fields Factory plugin. Not a single line of PHP coding is required. I'll put full guideline to follow.

  1. Install the plugin

  2. Activate the plugin

  3. Go to Fields Factory tab in left sidebar of WordPress dashboard.

  4. Add new WC field group

  5. Add all the input element types you need (Labels, Selects, texts, etc)

  6. Add the Conditions rule set to show the input fields

  7. Save changes and update
  8. then go to the top element you added.
  9. Select the field rules tab
  10. Give the show hide rules according to the selection

  11. And you are good to go. Hope this helps anyone who struggled like me.

发布评论

评论列表(0)

  1. 暂无评论