Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › Product Vendors › Input type select for product name
- This topic has 11 replies, 3 voices, and was last updated 6 years, 12 months ago by WCFM Forum.
- AuthorPosts
- December 20, 2017 at 6:54 pm #17061charlie.bourguignatParticipant
Hi,
I want to edit the add product page for my vendors. In order to adapt it for my specific application.
I want to change the text input for “Product Name” into a select input with only the product names I choosed.Do you think this is possible ?
Thank you
- December 20, 2017 at 7:14 pm #17062SimhaGuest
Hi,
Thanks for get in touch with us.
Yeah, absolutely possible.
Kindly send us few of those names and we will send custom code for that. You just have to add that in your child theme’s functions.php
Please don’t edit any core files.
Thank You
- December 20, 2017 at 7:44 pm #17063charlie.bourguignatParticipant
Okay great !
So the names would be : “Coupe Homme” “Coupe femme” “Brushing” “Coupe enfant”
Thank you
- December 21, 2017 at 5:24 am #17070WCFM ForumMember
Hi,
Here is the code for you –
function wcfm_custom_product_title_type( $general_fields, $product_id, $product_type ) { $product_title_options = array( "" => "-- Choose Title --", "Coupe Homme" => "Coupe Homme", "Coupe femme" => "Coupe femme", "Brushing" => "Brushing", "Coupe enfant" => "Coupe enfant" ); if( isset( $general_fields['title'] ) ) { $general_fields['title']['type'] = 'select'; $general_fields['title']['class'] = 'wcfm-select wcfm_ele wcfm_product_title wcfm_full_ele simple variable external grouped booking'; $general_fields['title']['options'] = $product_title_options; } return $general_fields; } add_filter( 'wcfm_product_manage_fields_general', 'wcfm_custom_product_title_type', 50, 3 );
Just see, I have defined your product title names as an array “$product_title_options”, just add your other names there.
Please know me is this works for you or not!
Thank You
- December 21, 2017 at 10:02 am #17083charlie.bourguignatParticipant
Hi,
Yes this is working very well for me thank you very much !
Do you think we can extend this to have a complete template with more values linked to this choice for a few products ?
The idea is to prefill the add product page to give the vendor a better user experience.
Thank You WC Lovers !
- December 21, 2017 at 11:56 am #17086SimhaGuest
Hi,
Ahh .. that’s great to know that it works as per your requirement.
Do you think we can extend this to have a complete template with more values linked to this choice for a few products ?
– Can you please give us a bit more details on this? What actually your vision!
You already can add more such titles as We have defind a array for that.Just relax, any kind of customization possible to acieve.
Thank You
- December 21, 2017 at 5:53 pm #17094charlie.bourguignatParticipant
Hi,
Yes I understood that I can now add any product name I want in the array you created. Again thank you very much for that 🙂
I will try to explain what I have in mind for the add product page.
As vendors can now choose a name in a list, I wonder if we can do a bigger array with inputs like product name, price, category, duration (WC Appointments) for eg.The vendor could choose a product name and inputs like price, duration and category would be automatically prefilled with values.
For example : “Coupe Homme”(product name) – 15$ (price) – “Homme” (category) – 15min (duration with WC Appointments)
I hope you understand better what I’m trying to explain.
- December 22, 2017 at 6:08 pm #17113SimhaGuest
Hi,
I can’t say that is impossible but that will be a quite big customization.
Thank You
- December 24, 2017 at 6:18 pm #17170charlie.bourguignatParticipant
Hi,
Yes I understand.
- December 28, 2017 at 6:44 am #17289WCFM ForumMember
HI,
Do you want to go for this?
Just to mention, this will be part of paid customization. If you want to go for this, please know us.
Thank You
- December 28, 2017 at 11:03 am #17309charlie.bourguignatParticipant
Hi,
Okay thank you for this information I am not interrested for the moment, maybe in the future.
- December 29, 2017 at 5:29 am #17326WCFM ForumMember
OK, not an issue.
Feel free to reach us whenever you are interested in implementing this.Thank You
- AuthorPosts
- The topic ‘Input type select for product name’ is closed to new replies.