Skip to content

Instantly share code, notes, and snippets.

View fervous's full-sized avatar

Anna fervous

View GitHub Profile
@fervous
fervous / functions.php
Created November 10, 2017 20:38
add message / text before product shipping add edit product form wc vendors pro
function custom_wcv_ship_mssg(){
echo 'Your message here...';
}
add_action('wcv_before_shipping_tab', 'custom_wcv_ship_mssg');
@fervous
fervous / functions.php
Created November 8, 2017 23:43
hide remove the maxiumum product shipping & free shipping product vendor settings wc vendors pro
add_filter( 'wcv_shipping_free_shipping_product', 'hide_wcv_shipping_free_shipping_product' );
function hide_wcv_shipping_free_shipping_product( $field ) {
$field['label'] = __( '' );
$field['description'] = __( '' );
$field['type'] = 'hidden';
$field['value'] = 'no';
$field['wrapper_start'] = __( '' );
$field['wrapper_end'] = __( '' );
return $field;
}
@fervous
fervous / functions.php
Last active January 31, 2018 16:10
add woocommerce gift wrap integration wc vendors pro
Gives vendors an option to allow gift wrapping. Requires https://wordpress.org/plugins/woocommerce-product-gift-wrap/
/* This code should be pasted in your child theme's funcitons.php file */
/* WC Vendors Pro - Gift Wrap Option */
add_action( 'wcv_after_product_details', 'wcv_custom_product_gift_wrapper_enable',10,2 );
function wcv_custom_product_gift_wrapper_enable () {
WCVendors_Pro_Form_Helper::input(
array(
'post_id' => $object_id,
@fervous
fervous / functions.php
Created October 26, 2017 01:49
hide / remove disable national checkbox store settings shipping pro dashboard for vendors wc vendors pro
add_filter( 'wcv_shipping_national_disable', 'change_wcv_shipping_national_disable' );
function change_wcv_shipping_national_disable( $field ) {
$field['label'] = __( '' );
$field['type'] = 'hidden';
$field['value'] = 'no';
$field['wrapper_start'] = __( '' );
$field['wrapper_end'] = __( '' );
return $field;
}
@fervous
fervous / functions.php
Created October 23, 2017 14:24
add two new links to the pro vendor dashboard wc vendors pro
/* WC Vendors Pro - Add a new link to the Pro Dashboard */
function new_dashboard_page( $pages ){
$pages[] = array( 'label' => 'Your Page Name Here', 'slug' => 'https://your-website-here.com/the-page-here/' );
return $pages;
}
add_filter( 'wcv_pro_dashboard_urls', 'new_dashboard_page' );
/* WC Vendors Pro - Add another new link to the Pro Dashboard */
function new_dashboard_page_two( $pages ){
$pages[] = array( 'label' => 'Your Other Page Name Here', 'slug' => 'https://your-website-here.com/the-other-page-here/' );
return $pages;
@fervous
fervous / functions.php
Created September 27, 2017 15:23
change apply to become a vendor checkbox text my-account page my account wc vendors
/* add this to your child theme functions.php */
add_filter ('wcvendors_vendor_registration_checkbox', 'custom_wcvendors_vendor_registration_checkbox');
function custom_wcvendors_vendor_registration_checkbox () {
$message = 'new apply text here';
return $message;
}
@fervous
fervous / functions.php
Last active September 25, 2017 04:01
WC Vendors Pro national quantity qty checked by default
/* Make National Qty Override Checked by Default */
add_filter( 'wcv_shipping_national_qty', 'change_wcv_shipping_national_qty' );
function change_wcv_shipping_national_qty() {
$field['label'] = __( '' );
$field['type'] = 'hidden';
$field['value'] = 'yes';
return $field;
}
add_filter( 'wcv_shipping_international_qty', 'change_wcv_shipping_international_qty' );
@fervous
fervous / functions.php
Created September 24, 2017 19:24 — forked from digitalchild/functions.php
Change Navigation tab order in WC Vendors Pro
<?php
// Add this to your themes functions.php to change the order, rearrage the lines. First line is first item, last is last etc.
add_filter( 'wcv_dashboard_pages_nav', 'change_nav_order');
function change_nav_order( $pages ){
$new_nav_order = array();
$new_nav_order['dashboard_home'] = $pages['dashboard_home'];
@fervous
fervous / functions.php
Created September 20, 2017 23:17
wc vendors pro bookings change default product type to bookable
/* WC Vendors Pro - changes default product type to Bookable (booking). For the child theme functions.php */
add_filter( 'wcv_default_product_type', 'wcv_default_product_type_bookable' );
function wcv_default_product_type_bookable($product_type) {
$product_type = 'booking';
return $product_type;
}
@fervous
fervous / functions.php
Created September 11, 2017 02:57
Rename change label for Charge only once shipping qty wc vendors pro
/* change qty shipping label on store settings shipping form */
add_filter( 'wcv_shipping_national_qty', 'change_wcv_shipping_national_qty' );
function change_wcv_shipping_national_qty($field) {
$field['label'] = __( 'your new message here..' );
if ( array_key_exists('label', $field ) ) $field[ 'label' ]= 'Charge single shipping rate for multiples of the exact same product';
return $field;
}