Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ovo će utjecati na mailove, Order received (Thank you page) i My account - View order
- // Prvo ćemo "otkačiti" red UKUPNO
- function remove_total_from_order_totals_lines( $totals ) {
- unset($totals['order_total'] );
- return $totals;
- }
- add_filter( 'woocommerce_get_order_item_totals', 'remove_total_from_order_totals_lines', 100, 1 );
- //... zatim ćemo dodati novi red sa custom tekstom i formatiranom cijenom po želji
- function mx_woocommerce_get_order_item_totals( $total_rows, $order, $tax_display ) {
- // Get total for the new row
- $ukupno_za_platiti = $order->get_total();
- // Add custom row
- $total_rows['ukupno_za_platiti']['label'] = __( 'Ukupno za platiti:', 'woocommerce' );
- $total_rows['ukupno_za_platiti']['value'] = wc_price( $ukupno_za_platiti ).(' (uklj. PDV)');
- return $total_rows;
- }
- add_filter( 'woocommerce_get_order_item_totals', 'mx_woocommerce_get_order_item_totals', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement