Skip to content

Instantly share code, notes, and snippets.

Created October 18, 2015 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/35208ccccddb574da076 to your computer and use it in GitHub Desktop.
Save anonymous/35208ccccddb574da076 to your computer and use it in GitHub Desktop.
public function product_sold_by( $product_id ) {
remove_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 );
$shop_url = '';
$vendor_id = WCV_Vendors::get_vendor_from_product( $product_id );
$store_id = ( $vendor_id != 1 ) ? WCVendors_Pro_Vendor_Controller::get_vendor_store_id( $vendor_id ) : 0;
$sold_by = apply_filters( 'wcv_loop_sold_by',
array(
'product_id' => $product_id,
'vendor_id' => $vendor_id,
'shop_url' => ( $store_id != 0 ) ? get_the_permalink( $store_id ) : '',
'shop_name' => ( $vendor_id != 1 ) ? WCV_Vendors::get_vendor_sold_by( $vendor_id ) : get_bloginfo( 'name' ),
'title' => __( 'Sold by: ', $this->wcvendors_pro )
) );
include('partials/product/wcvendors-pro-sold-by.php');
} // product_sold_by()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment