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_cart_totals_before_order_total', 'wcv_display_shipping_policy'); | |
add_action('woocommerce_review_order_before_shipping', 'wcv_display_shipping_policy'); | |
function wcv_display_shipping_policy() { | |
$product = gastronomy_get_productID_from_cart(); | |
$vendor_id = get_post_field( 'post_author', $product); | |
$vendor_meta = array_map( function( $a ){ return $a[0]; }, get_user_meta( $vendor_id ) ); | |
$vendor_shipping = array_key_exists('_wcv_shipping', $vendor_meta ) ? unserialize( $vendor_meta['_wcv_shipping'] ) : self::get_shipping_defaults(); |
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_product_tabs', function( $tabs ) { | |
if( isset( $tabs['policies'] ) ) { | |
$tabs['policies']['title'] = 'New title'; | |
} | |
return $tabs; | |
}, 30 ); |
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 default_no_quantities( $individually, $product ){ | |
$individually = true; | |
return $individually; | |
} | |
add_filter( 'woocommerce_is_sold_individually', 'default_no_quantities', 10, 2 ); |
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_sold_by_link', 'vendor_shop_url_update', 11, 2 ); | |
function vendor_shop_url_update( $sold_by, $vendor_id ) { | |
// Recreate the link and anchor text. | |
if ( WCV_Vendors::is_vendor( $vendor_id ) ) { | |
$class = isset( $css_class ) ? 'class="' . $css_class . '"' : ''; | |
$sold_by_label = WCV_Vendors::get_vendor_sold_by( $vendor_id ); | |
// Change the link here. | |
$shop_page_url = WCV_Vendors::get_vendor_shop_page( $vendor_id ); | |
$sold_by = sprintf( '<a href="%s" %s>%s</a>', $shop_page_url, $class, $sold_by_label ); | |
} |
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_product_sold_individually', 'change_default_sold_individually' ); | |
function change_default_sold_individually() { | |
$field['post_id'] = $post_id; | |
$field['id'] = '_sold_individually'; | |
$field['wrapper_class'] = 'show_if_simple show_if_variable'; | |
$field['label'] = __( 'Sold Individually', 'wcvendors-pro' ); | |
$field['desc_tip'] = 'true'; | |
$field['description'] = __( 'Enable this to only allow one of this item to be bought in a single order', 'wcvendors-pro' ); | |
$field['type'] = 'checkbox'; |
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
/******Store Header data******/ | |
/*Remove description*/ | |
.wcv-store-header.header-modern .desc { | |
display: none; | |
} | |
/*Remove Address/other blocks*/ | |
.phone{ | |
display: none; |
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_pro_dashboard_urls', 'change_slugs' ); | |
function change_slugs($args) { | |
$args['product']['slug'] = 'add-custom-slug'; | |
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
add_filter( 'wcv_product_shipping_fee_national_qty', 'change_default_product_shipping_fee_national_qty' ); | |
function change_default_product_shipping_fee_national_qty() { | |
$field['id'] = '_shipping_fee_national_qty'; | |
$field['label'] = __( 'Charge once per product for national shipping, even if more than one is purchased.', 'wcvendors-pro' ); | |
$field['type'] = 'checkbox'; | |
$field['value'] = 'yes'; | |
$field['class'] = 'wcv-disable-national-input'; // This checks the checkbox | |
return $field; |
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 | |
/** | |
* The Template for displaying the modern store header | |
* | |
* Override this template by copying it to yourtheme/wc-vendors/store | |
* | |
* @package WCVendors_Pro | |
* @version 1.6.2 | |
*/ |
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_product_policy_tab_content_args', 'change_policy_order'); | |
function change_policy_order($post){ | |
$new_policies = array(); | |
$new_policies['shipping'] = $post['shipping']; | |
$new_policies['return'] = $post['return']; | |
$new_policies['terms'] = $post['terms']; | |
$new_policies['privacy'] = $post['privacy']; |
OlderNewer