How to Add Gallery Cover Navigation Ar...
Enhance your MyListing website design with the Gallery Cover Navigation Arrows code s...

WPCodeBox
1319
Enhance your WooCommerce store with this code snippet to easily add a surcharge percentage to all orders. This flexible WordPress solution allows you to apply a 5% surcharge to customer carts, with the ability to customize the percentage as needed, offering greater control over your e-commerce pricing.
/**
* Author: WP Turned UP
* Author URI: https://wpturnedup.com
*/
// ADD SURCHARGE % TO ALL WOOCOMMERCE ORDERS
add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' );
function woocommerce_custom_surcharge() {
global $woocommerce;
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$percentage = 0.05;
$surcharge = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total ) * $percentage;
$woocommerce->cart->add_fee( 'Surcharge', $surcharge, true, '' );
}





This is how you change the WordPress admin logo to your own custom logo.
