</li> <?php } ?> </ul> <ul style="float: left;"> <li> <label class="med" for="plan-product_id"><?php _e('Product', 'cart66'); ?> :</label> <select style="width: 375px;" name="plan[product_id]" id="plan-product_id"> <option value="">Select a Membership or Subscription Product</option> <?php $membership_products = Cart66Product::getMembershipProducts(); $subscription_products = Cart66Product::getSubscriptionProducts(" WHERE spreedly_subscription_id=NULL OR spreedly_subscription_id=0"); $products_than_need_an_account = array_merge($membership_products, $subscription_products); if (!empty($products_than_need_an_account)) { foreach ($products_than_need_an_account as $member_product) { ?> <option value="<?php echo $member_product->id; ?> "><?php echo $member_product->name; ?> (<?php echo $member_product->feature_level; ?> )</option>
public function drawFeatureLevelMetaBox($post) { if (CART66_PRO) { $plans = array(); $featureLevels = array(); $data = array(); // Load feature levels defined in Spreedly if available if (class_exists('SpreedlySubscription')) { $sub = new SpreedlySubscription(); $subs = $sub->getSubscriptions(); foreach ($subs as $s) { // $plans[] = array('feature_level' => (string)$s->featureLevel, 'name' => (string)$s->name); $plans[(string) $s->name] = (string) $s->featureLevel; $featureLevels[] = (string) $s->featureLevel; } } // Load feature levels defined in PayPal subscriptions $sub = new Cart66PayPalSubscription(); $subs = $sub->getSubscriptionPlans(); foreach ($subs as $s) { $plans[$s->name] = $s->featureLevel; $featureLevels[] = $s->featureLevel; } // Load feature levels defined in Membership products foreach (Cart66Product::getMembershipProducts() as $membership) { $plans[$membership->name] = $membership->featureLevel; $featureLevels[] = $membership->featureLevel; } // Put unique feature levels in alphabetical order if (count($featureLevels)) { $featureLevels = array_unique($featureLevels); sort($featureLevels); $savedPlanCsv = get_post_meta($post->ID, '_cart66_subscription', true); $savedFeatureLevels = empty($savedPlanCsv) ? array() : explode(',', $savedPlanCsv); Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Cart66 Saved Plans: {$savedPlanCsv} -- " . print_r($savedFeatureLevels, true)); $data = array('featureLevels' => $featureLevels, 'plans' => $plans, 'saved_feature_levels' => $savedFeatureLevels); } $box = Cart66Common::getView('pro/views/feature-level-meta-box.php', $data); echo $box; } }