Closed stickypages closed 7 years ago
What Subscriptions plugin are you using? What types of products are in the cart, and is this happening on the first purchase of the subs product, or on subsequent renewals?
I'm using WooCommerce Subscriptions (by woo themes). I'm using a variable subscription, which is a renewal.
You can see it works for a 'product', but not the recurring totals.
Here is a screenshot
Right, it isn't currently set up to add fees onto recurring totals. Will only add fees to the order one time.
Adding support for recurring costs may require a bit of work.
Oh really eh. Thought I saw it was setup for some Subscription stuff in the code. Possible to get that implemented? I am desperate. I can't seem to quite grasp what is needed to do it myself yet. Still doing research...
I don't have time to implement this right now, but I can maybe help point you in the right direction.
For Subscriptions, a one-time fee is already supported with the "sign up fee" option. So you only need to handle the recurring fee part. In woocommerce-subscriptions/includes/class-wc-subscriptions-checkout.php, there is a woocommerce_add_order_fee_meta
hook that looks to be what you should use for this.
Great thanks, will look into this some more. It would be a great addition when you have time !
Oh hey, fixed this while fixing https://github.com/WPprodigy/woocommerce-product-fees/issues/23 :). Fees are now applied to recurring totals as well.
At first I thought about an extra setting on Subscription product to enable/disable this, but changed my mind. If somebody doesn't want recurring fees, they can just use the "sign up fee" option.
Awesome, thanks!
It looks like in the code that subscriptions will work, from what I can see. But I get ZERO fee added to the subscription total.
It is in the "meta" for the subscription. But I cannot see any fee applied to the actual total.
Any thoughts on this?