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
/* Credit to @criticalachievement */ | |
// Changes the default value for manage stock checkbox to checked | |
add_filter( 'wcv_product_manage_stock', 'change_default_manage_stock' ); | |
function change_default_manage_stock() { | |
$field['post_id'] = $post_id; | |
$field['id'] = '_manage_stock'; | |
$field['wrapper_class'] = 'show_if_simple show_if_variable'; |
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 | |
// Add this to your themes function.php change the values to suit where you want the link to go. | |
// slug needs to be a complete URL. | |
function custom_menu_link( $pages ) { | |
$pages[ 'custom_link' ] = array( | |
'slug' => 'http://yoursite.com/customlink/here', | |
'label' => __('Custom Link', '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
function store_bank_details( ){ | |
if ( class_exists( 'WCVendors_Pro' ) ){ | |
$key = '_wcv_custom_settings_bankname'; | |
$value = get_user_meta( get_current_user_id(), $key, true ); | |
// Bank Name | |
WCVendors_Pro_Form_Helper::input( array( | |
'id' => $key, | |
'label' => __( 'Bank Name', 'wcvendors-pro' ), | |
'placeholder' => __( 'First Bank', 'wcvendors-pro' ), | |
'desc_tip' => '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
<?php | |
// remove shipping column from orders table | |
add_filter( 'wcv_order_table_columns', 'remove_shipping' ); | |
function remove_shipping( $columns ){ | |
unset( $columns[ 'status' ] ); | |
return $columns; | |
} |
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 | |
// remove status from order table | |
add_filter( 'wcv_order_table_columns', 'remove_shipping' ); | |
function remove_shipping( $columns ){ | |
unset( $columns[ 'status' ] ); | |
return $columns; | |
} | |
// Disable mark recieved system completely |
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 | |
add_filter ('wcv_product_price', 'price_min_max'); | |
add_filter ('wcv_product_sale_price', 'price_min_max'); | |
function price_min_max ($args) { | |
$args ['custom_attributes'] = array ( | |
'data-parsley-range' => '[10, 100]' | |
); | |
return $args; | |
} |
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 | |
/** | |
* Vendor List Template | |
* | |
* This template can be overridden by copying it to yourtheme/wc-vendors/front/vendors-list.php | |
* | |
* @author Jamie Madden, WC Vendors | |
* @package WCVendors/Templates/ | |
* @version 2.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
add_action( 'woocommerce_register_form', 'load_js' ); | |
function load_js(){?> | |
<script type="text/javascript"> | |
jQuery('#apply_for_vendor').prop('checked', true); | |
</script> | |
<?php } |
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 | |
// Add 16% VAT to vendor commission | |
add_filter( 'wcv_commission_rate', 'my_wcv_commission_rate', 10, 5 ); | |
function my_wcv_commission_rate( $commission, $product_id, $product_price, $order, $qty ) { | |
$vat_fee = 0.16; | |
$marketplace_split = $product_price - $commission; | |
$vat = $marketplace_split * $vat_fee; | |
$commission -= $vat; |
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( 'wcv_format_store_address_args', 'my_wcv_format_store_address', 11, 2 ); | |
function my_wcv_format_store_address( $address_args, $vendor_id ) { | |
$address_args = array( | |
'country' => WC()->countries->countries[ get_user_meta( $vendor_id, '_wcv_store_country', true ) ], | |
'city' => get_user_meta( $vendor_id, '_wcv_store_city', true ), | |
); | |
return $address_args; | |
} |
OlderNewer