Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. function woo_add_cart_fee() {
  2.  
  3. global $woocommerce;
  4.  
  5. $admin_fees = get_option( 'admin_fees', 10 );
  6. $stamp_duty = get_option( 'stamp_duty', 10 );
  7. $refundable_deposit = get_option( 'refundable_deposit', 10 );
  8.  
  9. $woocommerce->cart->add_fee( __('Admin Fees', 'woocommerce'), $admin_fees );
  10. $woocommerce->cart->add_fee( __('Stamp Duty', 'woocommerce'), $stamp_duty );
  11. $woocommerce->cart->add_fee( __('Refundable Deposit', 'woocommerce'), $refundable_deposit );
  12.  
  13. }
  14.  
  15. add_action( 'woocommerce_cart_calculate_fees', 'woo_add_cart_fee' );
  16.  
  17. function woo_add_cart_fee() {
  18.  
  19. global $woocommerce;
  20.  
  21. $admin_fees = get_option( 'admin_fees', 10 );
  22. $stamp_duty = get_option( 'stamp_duty', 10 );
  23. $refundable_deposit = get_option( 'refundable_deposit', 10 );
  24.  
  25. $woocommerce->cart->add_fee( __('Admin Fees', 'woocommerce'), $admin_fees, TRUE, '');
  26. $woocommerce->cart->add_fee( __('Stamp Duty', 'woocommerce'), $stamp_duty, TRUE, '' );
  27. $woocommerce->cart->add_fee( __('Refundable Deposit', 'woocommerce'), $refundable_deposit, TRUE, '' );
  28.  
  29. }
  30.  
  31. add_action( 'woocommerce_cart_calculate_fees', 'woo_add_cart_fee' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement