/** * Upgrade license modal */ function affwp_upgrade_license_modal() { $professional_add_ons = affwp_get_pro_add_on_count(); ?> <div id="upgrade" class="popup entry-content mfp-with-anim mfp-hide"> <h1>Upgrade your license</h1> <p>Pro add-ons are only available to <strong>Professional</strong> or <strong>Ultimate</strong> license-holders.</p> <p>Once you upgrade your license you'll have access to all <?php echo $professional_add_ons; ?> pro add-ons (including this one), as well as any pro add-ons we build in the future.</p> <div class="affwp-licenses"> <?php $licenses = affwp_get_users_licenses(); $license_heading = count($licenses) > 1 ? 'Your Licenses' : 'Your license'; ?> <h2><?php echo $license_heading; ?> </h2> <?php // a customer can happily have more than 1 license of any type if ($licenses) { ?> <?php foreach ($licenses as $id => $license) { if ($license['limit'] == 0) { $license['limit'] = 'Unlimited'; } else { $license['limit'] = $license['limit']; } $license_limit_text = $license['limit'] > 1 || $license['limit'] == 'Unlimited' ? ' sites' : ' site'; ?> <div class="affwp-license"> <p><strong><?php echo edd_get_price_option_name(affwp_get_affiliatewp_id(), $license['price_id']); ?> </strong> (<?php echo $license['limit'] . $license_limit_text; ?> ) - <?php echo $license['license']; ?> </p> <?php if (affwp_has_license_expired($license['license'])) { $renewal_link = edd_get_checkout_uri(array('edd_license_key' => $license['license'], 'download_id' => affwp_get_affiliatewp_id())); ?> <p class="license-expired"><a href="<?php echo esc_url($renewal_link); ?> ">Your license has expired. Renew your license now and save 40% →</a></p> <?php } ?> <?php if ($license['price_id'] != 3) { // only provide upgrade if not ultimate ?> <ul> <?php if ($license['price_id'] == 0) { // personal ?> <li><a title="Upgrade to Ultimate license" href="<?php echo affwp_get_license_upgrade_url('ultimate', $id); ?> ">Upgrade to Ultimate license (unlimited sites)</a></li> <li><a title="Upgrade to Professional license" href="<?php echo affwp_get_license_upgrade_url('professional', $id); ?> ">Upgrade to Professional license (unlimited sites)</a></li> <li><a title="Upgrade to Plus license" href="<?php echo affwp_get_license_upgrade_url('plus', $id); ?> ">Upgrade to Plus license (3 sites)</a></li> <?php } ?> <?php if ($license['price_id'] == 1) { // plus ?> <li><a title="Upgrade to Ultimate license" href="<?php echo affwp_get_license_upgrade_url('ultimate', $id); ?> ">Upgrade to Ultimate license (unlimited sites)</a></li> <li><a title="Upgrade to Professional license" href="<?php echo affwp_get_license_upgrade_url('professional', $id); ?> ">Upgrade to Professional license (unlimited sites)</a></li> <?php } ?> <?php if ($license['price_id'] == 2) { // professional ?> <li><a title="Upgrade to Ultimate license" href="<?php echo affwp_get_license_upgrade_url('ultimate', $id); ?> ">Upgrade to Ultimate license (unlimited sites)</a></li> <?php } ?> </ul> <?php } ?> </div> <?php } ?> <?php } else { ?> <p>You do not have a license yet. <a href="<?php echo site_url('pricing'); ?> ">View pricing →</a></p> <?php } ?> </div> <h2>The Ultimate licence</h2> <ul> <li>Access all <?php echo $professional_add_ons; ?> pro add-ons, including any built in the future</li> <li>Use AffiliateWP on as many sites as you'd like</li> <li>Receive unlimited updates and support — you'll never have to renew your license</li> </ul> <h2>The Professional licence</h2> <ul> <li>Access all <?php echo $professional_add_ons; ?> pro add-ons, including any built in the future</li> <li>Use AffiliateWP on as many sites as you'd like</li> <li>1 year of updates and support</li> </ul> </div> <?php }
<?php /** * Template Name: Pricing * */ get_header(); $professional_add_ons = affwp_get_pro_add_on_count(); $official_free_add_ons = affwp_get_add_on_count('official-free'); $third_party_add_ons = affwp_get_add_on_count('3rd-party'); ?> <?php affwp_page_header('30 Day Money Back Guarantee', '<h2>We stand behind our product 100% - <a href="#refund-policy" class="popup-content" data-effect="mfp-move-from-bottom">see our refund policy</a></h2>'); ?> <div class="primary content-area"> <div class="wrapper"> <?php // Start the Loop. while (have_posts()) { the_post(); // Include the page content template. get_template_part('content', 'page'); } ?> <?php affwp_pricing_options(); ?>
/** * Pricing options */ function affwp_pricing_options() { $professional_add_ons = affwp_get_pro_add_on_count(); $download_url = edd_get_checkout_uri() . '?edd_action=add_to_cart&download_id=' . affwp_get_affiliatewp_id(); ?> <section class="section pricing columns columns-3 grid"> <div class="wrapper pricing-options"> <div class="ultimate box pricing best-value"> <h2>Ultimate</h2> <ul class="list"> <li class="price"><span><sup>$</sup>449</span></li> <li class="highlight"><strong><a href="#modal-pro-add-ons" class="popup-content" data-effect="mfp-move-from-bottom"><?php echo $professional_add_ons; ?> pro add-ons</a></strong></li> <li><span class="highlight">Unlimited</span> updates</li> <li><span class="highlight">Unlimited</span> support</li> <li><span class="highlight">Unlimited</span> site licenses</li> </ul> <div class="option_a"> <a title="Purchase" class="button" href="<?php echo $download_url; ?> &edd_options[price_id]=3">Purchase</a> </div> </div> <div class="professional box pricing highlight"> <svg width="165px" height="33px"> <use xlink:href="<?php echo get_stylesheet_directory_uri() . '/images/svg-defs.svg#icon-recommended'; ?> "></use> </svg> <h2>Professional</h2> <ul class="list"> <li class="price"><span><sup>$</sup>199</span></li> <li class="highlight"><strong><a href="#modal-pro-add-ons" class="popup-content" data-effect="mfp-move-from-bottom"><?php echo $professional_add_ons; ?> pro add-ons</a></strong></li> <li>1 year of updates *</li> <li>1 year of support *</li> <li><span class="highlight">Unlimited</span> site licenses</li> </ul> <div class="option_a"> <a title="Purchase" class="button" href="<?php echo $download_url; ?> &edd_options[price_id]=2">Purchase</a> </div> </div> <div class="plus box pricing"> <div class="flex-wrapper"> <h2>Plus</h2> <ul class="list"> <li class="price"><span><sup>$</sup>99</span></li> <li>1 year of updates *</li> <li>1 year of support *</li> <li>3 site licenses</li> </ul> </div> <div class="option_a"> <a title="Purchase" class="button" href="<?php echo $download_url; ?> &edd_options[price_id]=1">Purchase</a> </div> </div> <div class="personal box pricing"> <div class="flex-wrapper"> <h2>Personal</h2> <ul class="list"> <li class="price"><span><sup>$</sup>49</span></li> <li>1 year of updates *</li> <li>1 year of support *</li> <li>1 site license</li> </ul> </div> <div class="option_a"> <a title="Purchase" class="button" href="<?php echo $download_url; ?> &edd_options[price_id]=0">Purchase</a> </div> </div> </div> </section> <?php }