I'd like to integrate user configurable line item adding to recurring orders. I can successfully prevent unwanted line items from being repeated onto orders, however I'm having some trouble coming up with a suitable method for saving the correct fee total (order total minus non-repeated line items) because those items are added by modules individually. Really, the only thing I can think of is saving the fee with no line items at all.
In any case, I've attached a patch for uc_recurring_order that allows line items to be selected and kept off recurring orders.
| Comment | File | Size | Author |
|---|---|---|---|
| nonrecurring_lineitems.patch | 2.88 KB | dabblela |
Comments
Comment #1
Mac Clemmens commentedFor me, it was a lot easier to use CIM (instead of ARB) and just associate a recurring fee as a feature with the relevant product or subscription. I'm not sure if this is your use case, but for subscriptions, this worked great for us.
Comment #2
dabblela commentedComment #3
klavs commentedCIm ? ARB? a small link would be very much appreciated - thank you.
Comment #4
Mac Clemmens commentedfrom http://bparanj.blogspot.com/2008/04/authorizenet-cim-and-arb.html
I personally recommend CIM because it gives you a lot more flexibility.
Comment #5
dabblela commentedI have need for this on a project and would like to get it in if you're insterested in it, univate. I can re-roll this against current dev if need be.
Comment #6
univate commentedThe problem I see is this patch does not address the real issue here.
In looking at the code we have the following which is not correct:
We should create the order and then get ubercart to add line items, so a line items get added for shipping if the order contains shippable products or adds tax if tax is required on the order.
Comment #7
dabblela commentedWell, that would be ideal, but I think that's a different module than uc_recurring_order since that's how UcRO has worked since the beginning. With the complexity of shipping, I don't know that such a thing is possible without coding an entirely separate shipping system.
Comment #8
univate commentedNot sure I follow? This modules purpose is to duplicate an order with the same products on some regular interval. So shouldn't things like shipping and taxes be calculated at the time of the order (which is different to the time the user checked out). What if someone moves address, the shipping and/or taxes could be different on the recurring orders.
I know that this module currently just duplicate everything (which is the easy option), but I don't think that is the most flexible approach and we shouldn't treat these orders any different to other orders in ubercart. We should allow ubercart to get a chance to update these orders in the same way it does with orders that go through the checkout system. That just means that any modules that add line items - shipping/taxes/discounts can all operate on recurring orders in the same way they can operate on normal orders.
Comment #9
dabblela commentedIdeally, absolutely line items would be duplicated; I am pessimistic this is possible as far as shipping goes.
That said, since it's not ideal, I'd just suggest that what's in there now function as best as possible, but I would also understand marking "won't fix."
Comment #10
mattcasey commentedI would like to add line items. Will this patch work for that? My use case is a delivery service in which some clients request additional products with their service after they've subscribed. Right now, I'm not sure how to alter the new recurring fee, except by changing the fee itself using Authorize.net CIM.Just an answer to myself: I figured out I can add products in hook_uc_recurring_renewal_pending()