Created
January 28, 2016 16:09
-
-
Save bentasm1/5eb268a240ee0d18a59f to your computer and use it in GitHub Desktop.
Customizing [wcv_vendorslist] for WC Vendors Pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* These functions will provide the WC Vendors Pro fields on your /themes/yourtheme/wc-vendors/front/vendor-list.php template - Thanks @jarvo! */ | |
<?php | |
$all_meta_for_user = get_user_meta( $vendor_id ); | |
#print_r( $all_meta_for_user ); | |
$shop_name = get_user_meta( $vendor_id, 'pv_shop_name', true ); | |
echo 'Shop Name: '.$shop_name.'<br/>'; | |
$shop_description = get_user_meta( $vendor_id, 'pv_shop_description', true ); | |
echo 'Shop Desription: '.$shop_description.'<br/>'; | |
$seller_info = get_user_meta( $vendor_id, 'pv_seller_info', true ); | |
echo 'Seller Info: '.$seller_info.'<br/>'; | |
echo '<hr/>'; | |
$twitter_username = get_user_meta( $vendor_id, '_wcv_twitter_username', true ); | |
echo 'Twitter Username: '.$twitter_username.'<br/>'; | |
$instagram_username = get_user_meta( $vendor_id, '_wcv_instagram_username', true ); | |
echo 'Instagram Username: '.$instagram_username.'<br/>'; | |
$facebook_url = get_user_meta( $vendor_id, '_wcv_facebook_url', true ); | |
echo 'Facebook URL: '.$facebook_url.'<br/>'; | |
$linkedin_url = get_user_meta( $vendor_id, '_wcv_linkedin_url', true ); | |
echo 'LinkedIn URL: '.$linkedin_url.'<br/>'; | |
$youtube_url = get_user_meta( $vendor_id, '_wcv_youtube_url', true ); | |
echo 'YouTube URL: '.$youtube_url.'<br/>'; | |
$pinterest_url = get_user_meta( $vendor_id, '_wcv_pinterest_url', true ); | |
echo 'Pinterest URL: '.$pinterest_url.'<br/>'; | |
$google_plus_url = get_user_meta( $vendor_id, '_wcv_googleplus_url', true ); | |
echo 'Google+ URL: '.$google_plus_url.'<br/>'; | |
echo '<hr/>'; | |
?> | |
<?php | |
$icon_id = get_user_meta( $vendor_id, '_wcv_store_icon_id', true ); | |
$store_icon = wp_get_attachment_image_src( $icon_id ); | |
if ( $store_icon ) : ?> | |
<img src="<?php echo $store_icon[0]; ?>" width="<?php echo $store_icon[1]; ?>" height="<?php echo $store_icon[2]; ?>" /> | |
<?php endif; ?> | |
<?php | |
$banner_id = get_user_meta( $vendor_id, '_wcv_store_banner_id', true ); | |
$store_banner = wp_get_attachment_image_src( $banner_id ); | |
if ( $store_banner ) : ?> | |
<img src="<?php echo $store_banner[0]; ?>" width="<?php echo $store_banner[1]; ?>" height="<?php echo $store_banner[2]; ?>" /> | |
<?php endif; ?> | |
<?php | |
$size = "large"; // (thumbnail, medium, large, full or custom size) | |
$image = wp_get_attachment_image_src( $attachment_id, $size ); | |
// url = $image[0]; | |
// width = $image[1]; | |
// height = $image[2]; | |
$banner_id = get_user_meta( $vendor_id, '_wcv_store_banner_id', true ); | |
$store_banner = wp_get_attachment_image_src( $banner_id, $size ); | |
if ( $store_banner ) : ?> | |
<img src="<?php echo $store_banner[0]; ?>" /> | |
<?php endif; ?> | |
$address_1 = get_user_meta( $vendor_id, '_wcv_store_address1', true ); | |
echo 'Address: '.$address_1.'<br/>'; | |
$city = get_user_meta( $vendor_id, '_wcv_store_city', true ); | |
echo 'City: '.$city.'<br/>'; | |
$state = get_user_meta( $vendor_id, '_wcv_store_state', true ); | |
echo 'State: '.$state.'<br/>'; | |
$country = get_user_meta( $vendor_id, '_wcv_store_country', true ); | |
echo 'Country: '.$country.'<br/>'; | |
$postcode = get_user_meta( $vendor_id, '_wcv_store_postcode', true ); | |
echo 'Postcode: '.$postcode.'<br/>'; | |
$phone = get_user_meta( $vendor_id, '_wcv_store_phone', true ); | |
echo 'Phone: '.$phone.'<br/>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment