Change Plan

0){ $currentPrice = $recurringDiscount; } } //$product = new WC_Product($subscription['product_id']); //$currentPrice = $product->get_price(); } } if (isset($currentPrice) && $currentPrice > 0.01){ $args = array( 'post_type' => 'product', 'posts_per_page' => -1, 'post_status' => 'publish', 'product_cat' => $_GET['action'], 'orderby' => 'price' ); $posts = query_posts( $args ); $productIds = array(); foreach($posts as $product){ $pricePerMonth = (float)get_post_meta($product->ID, 'price', true); $skip = false; if ($action === 'downgrade'){ if ($pricePerMonth < $currentPrice){ $productIds[] = $product->ID; break; } } else{ if ($pricePerMonth > $currentPrice) $productIds[] = $product->ID; } } if (count($productIds) > 0){ echo do_shortcode('[products ids="'.implode(',',$productIds).'"]'); } } } else{ ?>

Downgrading or upgrading your plan is not available at the moment.