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
/* Remove certain boxes from add item for sellers */ | |
function is_not_admin(){ | |
global $current_user; | |
get_currentuserinfo(); | |
if ($current_user->user_level < 7) { | |
return true; | |
} | |
else{ | |
return false; | |
} |
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 will allow your customers to send your vendors private messages from the single product view. It will not reveal their email. It is free and requires no purchase. | |
It requires BuddyPress with the component "Private Messaging" to be enabled in order to work. You dont need any of the other components enabled, just this one. And this component comes with BuddyPress for free, as well. | |
----- | |
*Note* I'm an amateur. I'm not a coding pro. This code was hacked and put together from a dozen different websites offering snippets that eventually brought me the solution. If it doesnt work for you, I really probably have no idea why. As of writing, this works with mgates Product Vendor 1.5.0.2, WooCommerce 2.1.5, and WordPress 3.8.1. | |
There are 2 files to edit. Your themes functions.php (first). Next, is creating a file called bp-custom.php in your plugins directory (NOT THE BUDDYPRESS DIRECTORY, IN THE PLUGIN DIRECTORY WHICH LOOKS OUT OF PLACE BUT THATS HOW BUDDYPRESS WORKS ./wp-content/plugins/bp-custom.p |
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
add_action('wcvendors_settings_after_paypal', 'pv_add_custom_merchant_id_field'); | |
function pv_add_custom_merchant_id_field() { | |
?> | |
<div class="pv_merchant_id_container"> | |
<p><b><?php _e( 'Merchant ID', 'wc_product_vendor' ); ?></b><br/> | |
<?php _e( 'Your Checkout.fi merchant ID.', 'wc_product_vendor' ); ?><br/> | |
<input type="text" name="pv_merchant_id" id="pv_merchant_id" placeholder="1234" value="<?php echo get_user_meta( get_current_user_id(), 'pv_merchant_id', true ); ?>" /> | |
</p> | |
</div> |
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 | |
/** | |
* Single Product Price, including microdata for SEO | |
* | |
* @author WooThemes | |
* @package WooCommerce/Templates | |
* @version 1.6.4 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
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 | |
/* This goes somewhere in your archive-product.php template. This will check if the URL they are on is a vendor store, | |
* and if it is, do something, if it isn't, do something else. Writhing the somethings is up to you. :) | |
*/ | |
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) ); | |
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop ); | |
if ( $vendor_id ) { | |
// Do something | |
} elseif { |
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
add_filter('woocommerce_login_redirect', 'login_redirect', 10, 2); | |
function login_redirect( $redirect_to, $user ) { | |
if ( WCV_Vendors::is_vendor( $user->id ) ) { | |
$redirect_to = '/seller_dashboard'; | |
return $redirect_to; | |
} else { | |
$redirect_to = 'my-account'; | |
return $redirect_to; | |
} |
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 IS FOR WC VENDORS FREE ONLY. See KnowledgeBase @ wcvendors.com for Pro instructions. | |
// CHANGE /members/ to your BuddyPress Members Permalink. (/members/ is the BuddyPress Default) | |
// CHANGE /vendors/ to your WC Vendors Store Permalink (/vendors/ is the WC Vendors Default) | |
add_action('bp_member_header_actions', 'wcv_bp_member_header_actions'); | |
function wcv_bp_member_header_actions() { | |
$wcv_profile_id = bp_displayed_user_id(); | |
$wcv_profile_info = get_userdata( bp_displayed_user_id() ); | |
$wcv_profile_role = implode( $wcv_profile_info->roles ); |
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
/* Adds Stories & Blogs links to profile pages */ | |
function authorposts_onprofile() { | |
global $bp; | |
?> | |
<li id="activity-reshares"><a href="<?php echo home_url(). '/author/' . bp_get_displayed_user_username(). '/'; ?>" title="<?php bp_displayed_user_fullname(); ?>'s Stories and Blogs">Stories & Blogs</a></li> | |
<?php | |
} | |
add_action('bp_member_options_nav', 'authorposts_onprofile'); |
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
/* BEGIN REGISTRATION FIELDS */ | |
function cs_wc_extra_register_fields() { | |
?> | |
<p class="form-row form-row-first"> | |
<label for="reg_billing_first_name"><?php _e( 'First Name', 'textdomain' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" /> | |
</p> | |
<p class="form-row form-row-last"> | |
<label for="reg_billing_last_name"><?php _e( 'Last Name', 'textdomain' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="billing_last_name" id="reg_billing_last_name" value="<?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?>" /> |
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
// ---- SHOW ALL VENDORS--WITH LIMIT ---- // | |
add_action('woo_vendor_list_shortcode', 'WCV_Vendors'); | |
if (class_exists('WCV_Vendors')) { | |
function pv_vendors( $atts ){ | |
//BASIC CODE FOR SETTING SHORTCODE ATTRIBUTES/PARAMETERS--default at 100 gets overwritten | |
extract( shortcode_atts( array( | |
'limit' => '100', | |
), $atts ) ); | |
OlderNewer