Banner Logo

🎉 Eid 2024 Exclusive Deal! 🎁 Enjoy 23% Off on MultiVendorX Paid Plugins! 🎉

Enjoy 23% Off!

Coupon code:

EIDGIFT24

Remove Vendor Name

Remove Vendor Name from New Order email : #

add_filter( 'woocommerce_display_item_meta','wcmp_hide_sold_by_from_emails',10,3);
function wcmp_hide_sold_by_from_emails( $html, $item, $args ){
        $strings = array();
                $html    = '';
                $args    = wp_parse_args(
                        $args,
                        array(
                                'before'       => '<ul class=""wc-item-meta""><li>',
                                'after'        => '</li></ul>',
                                'separator'    => '</li><li>',
                                'echo'         => true,
                                'autop'        => false,
                                'label_before' => '<strong class=""wc-item-meta-label"">',
                                'label_after'  => ':</strong> ',
                        )
                );

                foreach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {
                        $value = $args['autop'] ? wp_kses_post( $meta->display_value ) : wp_kses_post( make_clickable( trim( $meta->display_value ) ) );
                        if( $meta->display_key != 'Sold By' )
                                $strings[] = $args['label_before'] . wp_kses_post( $meta->display_key ) . $args['label_after'] . $value;
                }
                if ( $strings ) {
                        $html = $args['before'] . implode( $args['separator'], $strings ) . $args['after'];
                }

    return $html;
}

Leave a Reply