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 - Looks at the cart and, if something in the cart is sold by a vendor who hasn’t saved | |
* his PayPal account address in his Dashboard>Settings>Payment area, then the PayPal AP gateway included | |
* with WC Vendors is removed from the list of available gateways at checkout. | |
* Props to @dvrcthewrld for the code | |
*/ | |
function ps_filter_gateways($gateways) { | |
if ( is_checkout_pay_page() ) { | |
global $wp; | |
if ( isset( $wp->query_vars['order-pay'] ) ) { |
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 - Remove shipping panel from single product page */ | |
remove_action( 'woocommerce_product_tabs', array( $wcvendors_pro->wcvendors_pro_shipping_controller, 'shipping_panel_tab'), 11, 2 ); | |
remove_action( 'woocommerce_product_meta_start', array( $wcvendors_pro->wcvendors_pro_vendor_controller, 'product_ships_from'), 9 ); |
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 some new page links to the Pro Dashboard */ | |
function new_dashboard_pages( $pages ){ | |
$pages[] = array( 'label' => 'New Link', 'slug' => 'http://mysomelink.com' ); // Add stuff here | |
return $pages; | |
} | |
add_filter( 'wcv_pro_dashboard_urls', 'new_dashboard_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
<?php | |
add_action( 'wcv_save_product_meta', 'wcv_custom_stock_opts' ); | |
function wcv_custom_stock_opts( $post_id ) { | |
update_post_meta( $post_id, '_manage_stock', 'yes' ); | |
update_post_meta( $post_id, '_backorders', 'no' ); | |
wc_update_product_stock( $post_id, wc_stock_amount( 1 ) ); | |
} |
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 -- Require a minimum, and a maximum price for vendors when adding/editing a product */ | |
add_filter( 'wcv_product_price', 'price_min_max' ); | |
function price_min_max( $args ){ | |
$args[ 'custom_attributes' ] = array( | |
'data-rules' => 'decimal|range[1,20]', | |
'data-error' => __( 'Price should be a number and between $1 and $20', 'wcvendors-pro' ) | |
); | |
return $args; | |
} |
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 | |
// This code goes in your theme's functions.php | |
function form_caracteristica( $object_id ) { | |
WCVendors_Pro_Form_helper::select( array( | |
'post_id' => $object_id, | |
'id' => 'wcv_custom_product_caracteristicas', | |
'class' => 'select2', | |
'label' => __('Caracteristicas', 'wcvendors-pro'), | |
'show_option_none' => __('Select a caracteristicas', '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
<?php | |
// Add this to your themes function.php | |
add_filter( 'woocommerce_cart_item_name', 'wcv_shipping_cart_item', 1, 3 ); | |
function wcv_shipping_cart_item( $title = null, $cart_item = null, $cart_item_key = null ) { | |
$settings = get_option( 'woocommerce_wcv_pro_vendor_shipping_settings' ); | |
$customer_address = array( 'country' => WC()->customer->get_shipping_country(), 'state' => WC()->customer->get_shipping_state() ); | |
$package = array( 'destination' => $customer_address ); |
OlderNewer