Git Product home page Git Product logo

woocommerce-payforpayment's Introduction

WooCommerce Pay for Payment

plugin version

About

Add individual charges for each payment method as a flat rate and/or as a percentage of the cart total. The plugin first calculates the percentage rate and then adds the fixed rate on top. Coupons are not supported. (Sorry guys. I tried, but no way.)

You will find a stable version in WordPress plugin directory.

Previous versions have been created by Jörn Lund, who abandoned this project due to a pile of other projects in 2016. See the previous GitHub for details. The new version is maintained by Karolína Vyskočilová since 2017.

Features

  • 100% compatible with WPML (use WPML String translate module)
  • Fixed charge and/or a percentage of cart total
  • Possibility to disable for free/zero shipping
  • Translation ready
  • German, Spanish (muchas graçias!), Turkish (çok teşekkürler!), Czech (díky), Italian (grazie) and Dutch localization (bedankt)

Unreleased updates

  • none

Plugin API

Filter woocommerce_pay4pay_{$current_gateway_id}_amount:

Applied to the payment gateway fee before it is added to woocomerce' cart.

Example:

function my_pay4pay_amount( $amount , $calculation_base , $current_payment_gateway , $taxable , $include_taxes , $tax_class ) {
	if ( my_customer_complained_too_much() )
		return $amount * 10;
	else
		return $amount;
}
$current_gateway_id = 'cod';
add_filter( "woocommerce_pay4pay_{$current_gateway_id}_amount", 'my_pay4pay_amount' , 10 , 6 );
Filter woocommerce_pay4pay_apply:

Handle if a payment fee is applied.

Example:

function my_pay4pay_handle_christmas( $do_apply , $amount , $cart_subtotal , $current_payment_gateway ) {
	if ( today_is_christmas() )
		return false;
	else
		return $do_apply;
}
add_filter( "woocommerce_pay4pay_apply", 'my_pay4pay_handle_christmas' , 10 , 4 );
Filter woocommerce_pay4pay_applyfor_{$current_gateway_id}:

Handle if a payment fee on a specific payment method should be applied.

Example:

function my_pay4pay_apply( $do_apply , $amount , $cart_subtotal , $current_payment_gateway ) {
	if ( my_customer_is_a_nice_guy() )
		return false;
	else
		return $do_apply;
}
$current_gateway_id = 'cod';
add_filter( "woocommerce_pay4pay_applyfor_{$current_gateway_id}", 'my_pay4pay_apply' , 10 , 4 );

Compatibility

  • Tested up to WP 4.6.4 / WC 3.1.1
  • Requires at least WooCommerce 2.6, fully supports 3.0+
  • Not compatible with PayPal policy. Details: PayPal User Agreement, > "4.6 No Surcharges". You have been warned.

woocommerce-payforpayment's People

Contributors

bekatoros avatar diggy avatar gabrielperezs avatar mcguffin avatar mrjive avatar oerdnj avatar putcrun avatar vyskoczilova avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.