• 1.
    add_action( 'woocommerce_cart_calculate_fees_shopier', 'custom_handling_fee_shopier', 10, 1 );
  • 2.
    function custom_handling_fee_shopier ( $cart ) {
  • 3.
        if ( is_admin() && ! defined( 'DOING_AJAX' ) )
  • 4.
            return;
  • 5.
     
  • 6.
        if ( 'shopier' === WC()->session->get('chosen_payment_method') ) {
  • 7.
            $fee = 5;
  • 8.
            $cart->add_fee( 'Kapıda Ödeme Ekstra Ücret', $fee, true );
  • 9.
        }
  • 10.
    }
  • 11.
    add_action( 'wp_footer', 'custom_checkout_jqscript_shopier' );
  • 12.
    function custom_checkout_jqscript_shopier() {
  • 13.
        if ( is_checkout() && ! is_wc_endpoint_url() ) :
  • 14.
        ?>
  • 15.
        <script type="text/javascript">
  • 16.
        jQuery( function($){
  • 17.
            $('form.checkout').on('change', 'input[name="payment_method"]', function(){
  • 18.
                $(document.body).trigger('update_checkout');
  • 19.
            });
  • 20.
        });
  • 21.
        </script>
  • 22.
        <?php
  • 23.
        endif;
  • 24.
    }
add_action( 'woocommerce_cart_calculate_fees_shopier', 'custom_handling_fee_shopier', 10, 1 ); function custom_handling_fee_shopier ( $cart ) { if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; if ( 'shopier' === WC()->session->get('chosen_payment_method') ) { $fee = 5; $cart->add_fee( 'Kapıda Ödeme Ekstra Ücret', $fee, true ); } } add_action( 'wp_footer', 'custom_checkout_jqscript_shopier' ); function custom_checkout_jqscript_shopier() { if ( is_checkout() && ! is_wc_endpoint_url() ) : ?> <script type="text/javascript"> jQuery( function($){ $('form.checkout').on('change', 'input[name="payment_method"]', function(){ $(document.body).trigger('update_checkout'); }); }); </script> <?php endif; }

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter