Skip to content

Instantly share code, notes, and snippets.

View mircian's full-sized avatar
:shipit:

Mircea Sandu mircian

:shipit:
View GitHub Profile
<?php
add_filter('wcv_commission_rate', 'm_commission_update', 20, 5);
/**
* @param $commission
* @param $product_id
* @param $product_price
* @param $order WC_Order
* @param $qty
@mircian
mircian / wc_vendors_custom_commission.php
Created April 21, 2017 15:25
Add a special commission for a specific gateway
<?php
add_filter('wcv_commission_rate', 'm_commission_update', 20, 5);
/**
* @param $commission
* @param $product_id
* @param $product_price
* @param $order
* @param $qty
<?php
add_filter( 'posts_search', 'm_cars_search_vin' );
function m_cars_search_vin( $where ) {
global $pagenow, $wpdb, $wp;
// check if we are on the right page & performing a search & for the right post type
if ( 'edit.php' != $pagenow || ! is_search() || ! isset( $wp->query_vars['s'] ) || 'cars' != $wp->query_vars['post_type'] ) {
return $where;