/**
  * Returns a URL including required parameters for an authenticated user to renew a subscription by product ID.
  *
  * Deprecated because the use of a $subscription_key is deprecated.
  *
  * @param string $subscription_key A subscription key of the form created by @see WC_Subscriptions_Manager::get_subscription_key()
  * @since 1.2
  * @deprecated 2.0
  */
 public static function get_users_renewal_link_for_product($product_id)
 {
     _deprecated_function(__METHOD__, '2.0', 'wcs_get_users_resubscribe_link_for_product( $subscription )');
     return wcs_get_users_resubscribe_link_for_product($product_id);
 }
示例#2
0
	<link itemprop="availability" href="http://schema.org/InStock">

	<?php 
    do_action('woocommerce_before_add_to_cart_form');
    ?>

	<?php 
    if (!$product->is_purchasable() && 0 != $user_id && 'no' != $product->limit_subscriptions && ('active' == $product->limit_subscriptions && wcs_user_has_subscription($user_id, $product->id, 'on-hold') || ($user_has_subscription = wcs_user_has_subscription($user_id, $product->id, $product->limit_subscriptions)))) {
        ?>
		<?php 
        if ('any' == $product->limit_subscriptions && $user_has_subscription && !wcs_user_has_subscription($user_id, $product->id, 'active') && !wcs_user_has_subscription($user_id, $product->id, 'on-hold')) {
            // customer has an inactive subscription, maybe offer the renewal button
            ?>
			<?php 
            $resubscribe_link = wcs_get_users_resubscribe_link_for_product($product->id);
            ?>
			<?php 
            if (!empty($resubscribe_link)) {
                ?>
				<a href="<?php 
                echo esc_url($resubscribe_link);
                ?>
" class="button product-resubscribe-link"><?php 
                esc_html_e('Resubscribe', 'woocommerce-subscriptions');
                ?>
</a>
			<?php 
            }
            ?>
		<?php