This file contains hidden or 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( 'woocommerce_before_cart', 'move_proceed_button' ); | |
function move_proceed_button( $checkout ) { | |
echo '<a href="' . esc_url( WC()->cart->get_checkout_url() ) . '" class="checkout-button button alt wc-forward" >' . __( 'Proceed to Checkout', 'woocommerce' ) . '</a>'; | |
} |
This file contains hidden or 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 | |
// The following functions will allow a vendor to edit and delete their media alt text and descriptions. | |
// HOWEVER this requires post editing permissions so would also allow them to edit ALL posts and comments on | |
// your site if they know how to do it. | |
// WC Vendors will not support this code and is provided for educational purposes only. | |
// THIS IS DANGEROUS TO DO -- USE AT YOUR OWN RISK -- YOU HAVE BEEN WARNED! | |
// Update vendor role to support media handling | |
function update_vendor_role( ){ |
This file contains hidden or 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 hidden or 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
To require, or not to require, that is the question...... In the future, we'll make these into checkboxes to require/not require, | |
but for now you use filters. Add this code to your themes functions.php file. Here's the process: | |
1.) Find the filter for the field you want to adjust the requirements. This file is in /plugins/wc-vendors-pro/public/forms/class-wcvendors-pro-product-form.php | |
2.) Create a filter for each field you'd like to make required (or not required). The code below will make the description required: | |
/* WC Vendors Pro - Make Description Required */ | |
function wcv_product_description_required( $args ) { | |
$args[ 'custom_attributes' ] = array( |
This file contains hidden or 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 hidden or 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 - Add a custom link to your Pro Dashboard navigation bar */ | |
add_filter( 'wcv_pro_dashboard_urls', 'custom_menu_link' ); | |
function custom_menu_link( $pages ) { | |
$pages[ 'custom_link' ] = array( | |
'slug' => 'http://yoursite.com/customlink/here', // Change this to whatever you like, it must be a full URL | |
'label' => __('My Custom Link', 'wcvendors-pro' ), | |
'actions' => array() | |
); | |
return $pages; | |
} |
This file contains hidden or 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
/** | |
* Change text string for Jetpack Protect Bot Challenge Text | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function digisavvy_change_humanity_string( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Prove your humanity:' : | |
$translated_text = __( 'Prove you\'re not a bot', 'jetpack' ); | |
break; |
This file contains hidden or 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
// Place this in your themes functions.php | |
// This will put the menu item in your primary menu. Change the theme location if you want to change which menu this goes in. | |
// Use the Free code for WC Vendors Free, use the Pro code for WC Vendors Pro | |
/* BEGIN WC Vendors Free */ | |
add_filter( 'wp_nav_menu_items', 'wcv_vendors_menu', 10, 2 ); | |
function wcv_vendors_menu ( $items, $args ) { | |
if ($args->theme_location == 'primary') { | |
$vendors = get_users( array( 'role' => 'vendor' ) ); | |
$items .= '<li><a href="#">Vendors</a>'; |
This file contains hidden or 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 adds a custom field to the Dashboard > Settings page for your vendors to | |
provide you extra bits of info you may need from them. Duplicate for each custom field you need, | |
renaming the meta keys and functions each time so they are not duplicated. | |
Part #1 - Theme functions.php file: | |
/* WC Vendors Pro - My Custom Field */ | |
function store_bank_details( ){ | |
if ( class_exists( 'WCVendors_Pro' ) ){ | |
$key = '_wcv_custom_settings_bankname'; |
This file contains hidden or 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 | |
// Put this in your themes functions.php | |
// Remove all existing actions and filters | |
remove_action( 'woocommerce_after_shop_loop_item', array( 'WCV_Vendor_Shop', 'template_loop_sold_by'), 9, 2); | |
remove_filter( 'woocommerce_get_item_data', array( 'WCV_Vendor_Cart', 'sold_by' ), 10, 2 ); | |
remove_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 ); | |
remove_filter( 'woocommerce_order_product_title', array( 'WCV_Emails', 'show_vendor_in_email' ), 10, 2 ); | |
remove_action( 'woocommerce_add_order_item_meta', array( 'WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 ); | |
remove_action( 'woocommerce_after_shop_loop_item', array( $wcvendors_pro->wcvendors_pro_store_controller, 'loop_sold_by' ), 8 ); |