I am trying to allow users to update line items of their subscriptions from their my account panel. I am able to get their subscription from subscription id and show them update form. Right now I show them with product items in their subscription that I got through
$subscription = wcs_get_subscription($_GET['subscription']);
$subscription_items = $subscription->get_items();
What I am trying to do is allow users to update quantities of their product. So If they update quantity I want to update the subscription's item quantity so that future orders are generated with updated quantity.
I saw there is update_product method in WC_Abstract_Order
class. I think this can be used but I am confused on this note in comments:
* Update a line item for the order.
*
* Note this does not update order totals.
Do I need to recalculate totals when I use this? Also I needed to remove line item when quantity was 0. Is that possible?
As I do not see a remove item method.
Thanks