Home › Forums › WC Vendors Free Support › Data of the vendor for the customer › Reply To: Data of the vendor for the customer
February 22, 2017 at 8:25 pm
#57224
Participant
No luck :/
I am attaching a picture of what the email that gets sent looks like. Here is my child themes functions.php file in entirety:
<?php
// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct script access denied.' );
}
if ( defined( 'RH_GRANDCHILD_DIR' ) ) {
include( RH_GRANDCHILD_DIR . 'rh-grandchild-func.php' );
}
add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
function enqueue_parent_theme_style() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
if (is_rtl()) {
wp_enqueue_style( 'parent-rtl', get_template_directory_uri().'/rtl.css' );
}
}
// Add specific CSS class by filter
add_filter('body_class','style_body_repick');
function style_body_repick($classes) {
$classes[] = 'no_bg_wrap';
return $classes;
}
//////////////////////////////////////////////////////////////////
// Translation
//////////////////////////////////////////////////////////////////
add_action('after_setup_theme', 'rehubchild_lang_setup');
function rehubchild_lang_setup(){
load_child_theme_textdomain('rehubchild', get_stylesheet_directory() . '/lang');
}
/* begin add Vendor contact information to order email - This will add the vendors email address, phone number and address after their Shop Name in WC Vendors customer email conformation */
remove_action( 'woocommerce_add_order_item_meta', array('WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 );
add_action( 'woocommerce_add_order_item_meta', 'custom_add_vendor_to_order_item_meta', 10, 2);
function custom_add_vendor_to_order_item_meta( $item_id, $cart_item) {
$vendor_store_postcode = get_user_meta($vendor_id, '_wcv_store_postcode', true);
$vendor_city = get_user_meta($vendor_id,'_wcv_store_city', true);
$vendor_state = get_user_meta($vendor_id, '_wcv_store_state', true);
$sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_sold_by( $vendor_id ) ): get_bloginfo( 'name' );
$sold_by_and_email = $sold_by . ':' . '<br> <b>E-Mail: </b>' . $vendor_email . '<br><b> Telephone #.:</b> ' . $vendor_phone . '<br> <b>Address: </b>' . $vendor_address1 . ', '.$vendor_store_postcode . ', ' . $vendor_city . ','. $vendor_state;
wc_add_order_item_meta( $item_id, apply_filters('wcvendors_sold_by_in_email', __('<b>Verkauft durch</b>', 'wcvendors')), $sold_by_and_email);
}
/* end add Vendor contact information to order email*/
?>