Hello,

I've run across an issue where the shipping cost of the original order is being charged to the automatically created orders of an autoship. The shipping does not show up as a line item in the new order, but it is charged.

For example, I have a product set up at $35 + $5 shipping w/ a recurring fee of $35. When the fee is processed, a new order is created that shows a total of $35. However, in the Payment box in the balance field, it shows a payment of -$5. Looking at the admin comments, I find the following -- "Credit card charged: $40".

Any idea why this might be happening?

Thanks for the help.

Comments

univate’s picture

Title: Shipping on automatically created new order » Not showing shipping line item in recurring order

Well that is the idea of uc_recurring 2.0, recurring fees are treated the same as any other order. If you have a product that is shippable then I would assume you would charge shipping on every order of the product, e.g shipping out a magazine subscription.

If you have a product combined with say a online subscription, then I would argue these are two separate products and should be treated as such (with say something like product kit if you wanted them ordered together).

jacerider’s picture

Makes sense. But shouldn't shipping show up on the order? As it stands right now, the order total and the actual amount charged is different. If shipping is still be applied it should probably show up as a line item?

Oh, and my situation is one where I offer free shipping on all recurring orders after the first shipment.

univate’s picture

Correct, i have already changed the title of this issue to reflect the actual bug you have found.

I would still argue that your specific issue is that you need a more complex shipping calculation function, that sets shipping to $0 on renewals not a more complex recurring billing function... I know this doesn't fix things for you, but I am looking at this from the point of view, how do we make recurring billing work consistently, so if we want to treat recurring fees as new orders, maybe the solution is we have an option choose whether to trade recurring fees as new orders or just payments? but if it is a new order then it should act the same as every other order.

One thing I am interested in finding out is are you able to check in the "Store Administration" -> "Orders" -> "Recurring fees" and tell me if the amount is being saved as $35 or $40?

jacerider’s picture

Thanks for the great support on this univate. :) I really appreciate it.

Anyways, the new recurring fee is created at $35. The cycle will continue -- recurring fee of $35, actual charged amount $40.

jacerider’s picture

Oh, and for anyone who only wants to charge shipping on the first order, the following function will remove shipping line items from the newly created order which will effectively provide the means for charging shipping on only the first order.

function mymodule_recurring_renew($order, $fee){
	foreach($order->line_items as $key => $item){
		if($item['type'] == 'shipping'){
			unset($order->line_items[$key]);
		}
	}
	$order->order_total = uc_order_get_total($order);
}

univate -- if I find out why line items aren't getting added to the new order even though they are being charged, I will be sure to post back.

univate’s picture