On the order recieved page, that shows after checkout, there is a “Sold By” label along with the vendors name.
I would like to add the vendors address and phone number.
I believe I have the correct page to modify “class-vendor-cart.php” shown below.
Can anyone tell me what code to add to this page to make it possible?
The closest I found to this issue by searching is someone wanting to add the same information to the email invoice. That solution is here (scroll down) :ml/wp-content/plugins/wc-vendors/classes/front/orders/class-orders.php
I did take some oof that code and paste it on “class-vendor-cart.php” with no luck.
Can someone tell me what code to add to the code below so the vendors address and phone number would show under there vendor name? thanks
`<?php
/**
*
*
* @author Matt Gates <http://mgates.me>
* @package
*/
class WCV_Vendor_Cart
{
/**
*
*/
function __construct()
{
if ( WC_Vendors::$pv_options->get_option( ‘sold_by’ ) ) {
add_filter( ‘woocommerce_get_item_data’, array( ‘WCV_Vendor_Cart’, ‘sold_by’ ), 10, 2 );
add_action( ‘woocommerce_product_meta_start’, array( ‘WCV_Vendor_Cart’, ‘sold_by_meta’ ), 10, 2 );
}
}
/**
* Sold by in cart item
*
* @param unknown $values
* @param unknown $cart_item
*
* @return unknown
*/
public static function sold_by( $values, $cart_item )
{
$vendor_id = $cart_item[ ‘data’ ]->post->post_author;
$sold_by_label = WC_Vendors::$pv_options->get_option( ‘sold_by_label’ );
$sold_by = WCV_Vendors::is_vendor( $vendor_id )
? sprintf( ‘%s ‘, WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
: get_bloginfo( ‘name’ );
$values[ ] = array(
‘name’ => apply_filters(‘wcvendors_cart_sold_by’, $sold_by_label, $cart_item[ ‘data’ ]->post->ID, $cart_item[ ‘data’ ]->post->post_author ),
‘display’ => $sold_by,
);
return $values;
}
/**
* Single product meta
*/
public static function sold_by_meta()
{
$vendor_id = get_the_author_meta( ‘ID’ );
$sold_by_label = WC_Vendors::$pv_options->get_option( ‘sold_by_label’ );
$sold_by = WCV_Vendors::is_vendor( $vendor_id )
? sprintf( ‘%s‘, WCV_Vendors::get_vendor_shop_page( $vendor_id ), WCV_Vendors::get_vendor_sold_by( $vendor_id ) )
: get_bloginfo( ‘name’ );
echo apply_filters(‘wcvendors_cart_sold_by_meta’, $sold_by_label, get_the_ID(), $vendor_id ) .’ ‘. $sold_by . ‘<br/>’;
}
}