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
/* WC Vendors Pro - A quick action for showing a string of text on the | |
* my account page for a general terms and conditions for all users | |
* not just vendors. */ | |
add_action( 'woocommerce_register_form', 'wcvendors_extra_myaccount_text' ); | |
function wcvendors_extra_myaccount_text() { | |
echo '<strong>Important</strong> -- By registering to this site you agree to our <a href="/whatever/" target="top">General Terms and Conditions</a>.'; | |
} |
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
/* WC Vendors Pro - Custom Description Placeholder Text */ | |
function custom_wcv_product_description( $args ) { | |
$args = array( | |
'placeholder' => __( 'Placeholder Text Here', 'wcvendors-pro' ) | |
); | |
return $args; | |
} | |
add_filter( 'wcv_product_description', 'custom_wcv_product_description'); | |
/* WC Vendors Pro - Custom Title Placeholder Text */ |
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
// Put this in your themes function.php | |
function vendor_feedback_sidebar() { | |
if ( is_shop() ) { | |
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) ); | |
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop ); | |
if ( ! WCVendors_Pro::get_option( 'ratings_management_cap' ) ) echo WCVendors_Pro_Ratings_Controller::ratings_link( $vendor_id, true ); | |
} | |
} // vendor_feedback_sidebar() | |
// call this in your side bar |
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
<?php | |
/** | |
* Plugin Name: WC Vendors Pro Widgets | |
* Plugin URI: https://www.wcvendors.com | |
* Description: Does Widget Stuff | |
* Author: WC Vendors | |
* Author URI: https://www.wcvendors.com | |
* | |
* Version: 1.0.0 | |
* Requires at least: 4.0.0 |
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 ); |
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
/* https://www.wcvendors.com/help/reply/20920/ */ | |
function recent_products_test( ) { | |
$user_followings = bp_follow_get_following(); | |
foreach ($user_followings as $user_following ) { | |
$wcv_users[]= get_userdata( $user_following ); |
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
/* This code goes into one of the WC Vendors Templates. Which one? Depends where you want to show it on the dashboard. :) */ | |
/* Shows unread messages button */ | |
$unread = bp_get_total_unread_messages_count(); | |
$current_user = wp_get_current_user(); | |
if ( $unread > 0 ) { | |
echo '<a href="/members/' . $current_user->user_login . '/messages/">You have ' . $unread . ' Unread Private Messages</a>'; | |
} |
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
/* WC Vendors Pro - Notify Vendor when Product is Approved */ | |
add_action( 'pending_to_publish', 'wcv_notify_vendor_on_publish' ); | |
function wcv_notify_vendor_on_publish( $post_id ) { | |
global $post; | |
if ( $post->post_author != get_current_user_id() ) { | |
$author = new WP_User( $post->post_author ); | |
$email_data = array( | |
'to' => $author->user_email, | |
'subject' => sprintf( __( 'Your post on %1$s has been published!', 'email_author_on_publish' ), get_bloginfo('name') ), | |
'message' => sprintf( __( 'Your post "%1$s" on %2$s has been published: %3$s', 'email_author_on_publish' ), $post->post_title, get_bloginfo( 'name' ), get_permalink( $post->ID ) ), |
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
<?php | |
/** | |
* Example text input with validation | |
*/ | |
WCVendors_Pro_Form_Helper::input( | |
array( | |
'post_id' => $object_id, | |
'id' => '_wcv_custom_product_example_text_input', | |
'label' => __( 'Product Meta Text Input', 'wcvendors-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
---- The code below goes in your product-edit.php template as outline in the KnowledgeBase Article ---- | |
<?php | |
WCVendors_Pro_Form_Helper::textarea( array( | |
'post_id' => $object_id, | |
'id' => 'wcv_custom_product_ingredients', | |
'label' => __( 'Ingredients', 'wcvendors-pro' ), | |
'placeholder' => __( 'Ingredients', 'wcvendors-pro' ), | |
'desc_tip' => 'true', | |
'description' => __( 'The product ingredients', 'wcvendors-pro' ), | |
) ); |