I add a fee via php in review-order.php:
<?php
global $woocommerce;
$total = number_format($woocommerce->cart->total, 2, '.', ' ');
$total = (float) number_format($total, 2, '.', ' ') + (float) number_format($vvk, 2, '.', ' ');
$total = number_format($total, 2, ',', ' ');
?>
<tr class="order-total">
<th><?php _e( 'Total', 'woocommerce' ); ?></th>
<td data-title="<?php _e( 'Total', 'woocommerce' ); ?>">
<?php echo "<strong><span class="amount">â¬".$total."</span></strong>"; ?>
</td>
</tr>
Now i need to update the total price before payment.
Any ideas? Thanks.
I am not sure I would do things that way – the next update will probably blow away your changes. Perhaps instead, add your fee using the fees API and add the code to your functions.php or relevant code file.
In the example below, a 1% surcharge is added (you could easily modify this to suit your needs):
https://docs.woothemes.com/document/add-a-surcharge-to-cart-and-checkout-uses-fees-api/