woocommerce create subscription for user using functions / hooks provided
private function createWooComSubscription($user_id, $product_name, $total, $payment_id) { $arr = explode(“-“, $product_name); $product_title = trim($arr[0]); $product_subscription = trim($arr[1]); $product = $this->getWooComProduct($product_title); if ($product == null) { $this->getController()->log(“Product not found ! woo com create subscription failed”); return; } $variation = $this->getWooComVariation($product, $product_subscription); if ($variation == null) { $this->getController()->log(“Variation not found ! woo com create subscription failed”); return; … Read more