admin管理员组

文章数量:1134574

We are operating a shopping mall as dollsoom, and currently using a plug-in to apply an additional fee of 1.5% when using PayPal for payments in our shopping mall.

It works the orders with lump sum payments, but when choosing PayPal for the layaway payment, it is not applied the additional fee. (Actually we have our own layaway payment program, and it has a different payment page than lump sum orders.)

We think the plugin works on the checkout page, but not works on the Order Pay page.

So the question is, we need a plug-in works not only lump sum payments but also layaway payments when using PayPal.

Does anyone have any information about such a plugin? We would like to know how can we apply the additional fee when using PayPal even after choosing the layaway payment.

The screenshots below are a for reference that made for testing. After adding to the cart for a lump sum payment, PayPal payment can be selected as shown in the first shot (Before placing order).

And the second and third shots is when paying in layaway payment for an order (After placing order).

◎ Our website’s URL :

  1. gem.dollsoom/en/

  2. neo.dollsoom/en/

  3. id.dollsoom/en/

Thank you for your time and have a nice day.

We are operating a shopping mall as dollsoom.com, and currently using a plug-in to apply an additional fee of 1.5% when using PayPal for payments in our shopping mall.

It works the orders with lump sum payments, but when choosing PayPal for the layaway payment, it is not applied the additional fee. (Actually we have our own layaway payment program, and it has a different payment page than lump sum orders.)

We think the plugin works on the checkout page, but not works on the Order Pay page.

So the question is, we need a plug-in works not only lump sum payments but also layaway payments when using PayPal.

Does anyone have any information about such a plugin? We would like to know how can we apply the additional fee when using PayPal even after choosing the layaway payment.

The screenshots below are a for reference that made for testing. After adding to the cart for a lump sum payment, PayPal payment can be selected as shown in the first shot (Before placing order).

And the second and third shots is when paying in layaway payment for an order (After placing order).

◎ Our website’s URL :

  1. gem.dollsoom.com/en/

  2. neo.dollsoom.com/en/

  3. id.dollsoom.com/en/

Thank you for your time and have a nice day.

Share Improve this question asked Aug 7, 2023 at 6:51 SOOMSOOM 11 bronze badge 11
  • I'd guess the plugin isn't per-page but rather applying the fee based on payment type rules of what you've got in the basket, and somehow it's not matching PayPal layaway? I think your best bet is to talk to the people who make that plugin and ask for help, or debug it yourself to work out what's going on. – Rup Commented Aug 7, 2023 at 9:15
  • Or try somewhere more WooCommerce specific like developer.woocommerce.com : this sounds like it's a fiddly WooCommerce-specific detail they'll be better able to help with. – Rup Commented Aug 7, 2023 at 9:17
  • Assuming I suppose that layaways are built in, or is that something you've also added with a plugin? You might need to talk to whoever wrote that too. – Rup Commented Aug 7, 2023 at 9:19
  • We're using a plugin named 'Payment Method Checkout Fee'. With that, it is possible to add a fee to a lump sum payment, but it does not apply to a layaway payment. We've asked this issue on the WooCommerce forum and also asked the plugin developer, but we have not been received any reply, so we'd like to know if there is any way to solve this issue. – SOOM Commented Aug 8, 2023 at 8:28
  • Here's how I'd go about debugging this. If you still want to chase the plugin authors for help there's an email address on their homepage you could try. – Rup Commented Aug 9, 2023 at 7:46
 |  Show 6 more comments

1 Answer 1

Reset to default 0

You're using the Payment Method Checkout Fee plugin. This looks like it's relatively simple, just a woocommerce_cart_calculate_fees hook and some code to configure it.

https://plugins.svn.wordpress.org/payment-method-checkout-fee-for-woocommerce/trunk/checkoutfee.php

You didn't say what you're using to implement layaways but since this doesn't work I'm guessing it's treated as a separate payment gateway internally, i.e. when you have a layaway you no longer get chosen_payment_method = paypal. You'll need to

  1. work out what the PayPal-with-layaway gateway is called. You can do this by e.g. adding an error_log() to checkoutfee.php:
    // Check if WooCommerce is enabled before executing the function
    function pmcf_payment_method_checkout_fee() {
        if (class_exists('WooCommerce')) {
            $payment_method = WC()->session->get('chosen_payment_method');
            error_log( '$payment_method = "' . $payment_method . '"' );
    
    then set up a layaway basket on your site and check your server error log (or PHP error log if different, or WordPress debug log) for the payment method.
  1. add this as a new gateway to both places where the plugin calls get_available_payment_gateways(). e.g. if you got $payment_method = "paypal-with-layaway" in your logs from step 1 you'd want
    $gateways = WC()->payment_gateways->get_available_payment_gateways();
    $gateways[] = 'paypal-with-layaway';
    
    in the plugin's checkoutfee.php and admin/main.php.
  2. remove the error log in step 1.

本文标签: pluginsHow to apply an additional fee for the layaway payment