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_commission_rate', 'my_wcv_commission_rate', 10, 4 ); | |
function my_wcv_commission_rate( $commission, $product_id, $product_price, $order ) { | |
$terms = get_the_terms( $product_id, 'product_cat' ); | |
// Loop through the categories | |
// It will break on the first category assigned | |
foreach ( $terms as $term ) { |