I am using Ubercart 2 and I want to add a line item, which should add the total cost of all items instead of sell price. I tried to take the code from generic line item hook and used this to callback:
for each($op->products as item) {
$cost += $item->cost;
}
I want this line item to appear in the AJAX cart, which I am using now. It should appear in the user panel before checkout and it should also shown in the user and store admin order emails. It is not working as of now. Is the code I am adding correct or I have done any misplacement?