Untitled diff
3 removals
9 lines
3 additions
9 lines
add_action( 'woocommerce_cart_calculate_fees', 'wcpf_testing_fees', 15 );
add_action( 'woocommerce_cart_calculate_fees', 'wcpf_testing_fees', 15 );
function wcpf_testing_fees() {
function wcpf_testing_fees( $cart ) {
WC()->cart->add_fee( 'Custom Fee', '5' );
$cart->add_fee( 'Custom Fee', '5' );
foreach( WC()->cart->get_cart() as $cart_item => $values ) {
foreach( $cart->get_cart() as $cart_item => $values ) {
error_log('looping through for product ID #' . $values['product_id']);
error_log('looping through for product ID #' . $values['product_id']);
}
}
}
}