Exemplo n.º 1
0
            ?>
						<?php 
            get_template_part('html_includes/shop/discount-item', array('discount' => $discount, 'cart_item' => $cart_item));
            ?>
					<?php 
        }
        ?>
				<?php 
    }
    ?>

				<?php 
    if (cart_has_renewal_discount()) {
        ?>
					<?php 
        $percentage = cart_get_renewal_discount();
        ?>
					<?php 
        get_template_part('html_includes/shop/checkout-renewal', array('percentage' => $percentage, 'cart_item' => $cart_item));
        ?>
				<?php 
    }
    ?>
			<?php 
}
?>
		</ul>
	</div>

	<?php 
$discounts = get_global_discounts();
/**
 * Returns whether or not the given download is a renewal
 *
 * @return bool
 */
function cart_has_renewal_discount()
{
    if (!edd_sl_renewals_allowed()) {
        return false;
    }
    if (!EDD()->session->get('edd_is_renewal')) {
        return false;
    }
    $renewal_discount = cart_get_renewal_discount();
    return !empty($renewal_discount);
}