Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Custom Output in Orders Section
- This topic has 3 replies, 2 voices, and was last updated 4 years, 11 months ago by WCFM Forum.
- AuthorPosts
- May 27, 2019 at 4:29 am #63919Jack CliffGuest
I want to know if the following is something I can do.
In the purchased section (renamed description in the below screenshot), I would like the product name to instead have custom information I pull from somewhere else.
So instead of 180xCertificates, it would say 180x(custom output here)
I have a custom field in all my products called “Item Title”. I need the product name to display what is entered there instead. I want to know if this sort of thing is possible with this plugin if I learned how to do it? Would I do it with Hooks and Filters?
- May 29, 2019 at 6:53 am #64215WCFM ForumKeymaster
Hi,
Off course possible.
You have to use this filter –
apply_filters( 'wcfm_order_item_name', $item->get_name(), $item )
If you know me that custom title meta name, then I will help you to write the whole code.
Well, this will work after WCFM next update.
Thank You
- May 31, 2019 at 1:06 am #65104Jack CliffGuest
Hi,
Thanks! The name of the field is aws_price_calc_43
Thank You so much
- May 31, 2019 at 9:35 pm #65315WCFM ForumKeymaster
Hi,
Here is your code for the purpose –
add_filter( 'wcfm_order_item_name', function( $item_name, $item ) { $product_id = $item->get_product_id(); $aws_price_calc_43 = get_post_meta( $product_id, 'aws_price_calc_43', true ); if( $aws_price_calc_43 ) $item_name = $aws_price_calc_43; return $item_name; }, 50, 2 );
Thank You
- AuthorPosts
- You must be logged in to reply to this topic.