WooCommerce desetinná místa

 avatar
unknown
php
4 years ago
612 B
59
Indexable
// Odstranní desetiná místa s nulovou
add_filter( 'woocommerce_price_trim_zeros', '__return_true' );


// Dojde k zaokhrouhlení částky v případě použití kuponu s procentuální částkou
add_filter( 'woocommerce_coupon_get_discount_amount', 'filter_woocommerce_coupon_get_discount_amount', 10, 5 );
function filter_woocommerce_coupon_get_discount_amount( $discount, $discounting_amount, $cart_item, $single, $instance ) {
    // Round the discount for all other coupon types than 'fixed_cart'
    if( ! $instance->is_type('fixed_cart') )
        $discount = ceil( $discount );

    return $discount;
}
Editor is loading...