当前位置: 首页>>代码示例>>PHP>>正文


PHP WC_Subscriptions_Manager::get_available_time_periods方法代码示例

本文整理汇总了PHP中WC_Subscriptions_Manager::get_available_time_periods方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Subscriptions_Manager::get_available_time_periods方法的具体用法?PHP WC_Subscriptions_Manager::get_available_time_periods怎么用?PHP WC_Subscriptions_Manager::get_available_time_periods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WC_Subscriptions_Manager的用法示例。


在下文中一共展示了WC_Subscriptions_Manager::get_available_time_periods方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _e

?>
">

		<label for="variable_subscription_period[<?php 
echo $loop;
?>
]" class="wcs_hidden_label"><?php 
_e('Subscription Trial Period', 'woocommerce-subscriptions');
?>
</label>
		<select name="variable_subscription_trial_period[<?php 
echo $loop;
?>
]" class="wc_input_subscription_trial_period">
		<?php 
foreach (WC_Subscriptions_Manager::get_available_time_periods() as $key => $value) {
    ?>
			<option value="<?php 
    echo esc_attr($key);
    ?>
" <?php 
    selected($key, $chosen_trial_period);
    ?>
><?php 
    echo esc_html($value);
    ?>
</option>
		<?php 
}
?>
		</select>
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:html-variation-price.php

示例2: get_trial_period_validation_message

 /**
  * Returns either a string or array of strings describing the allowable trial period range
  * for a subscription.
  *
  * @since 1.0
  */
 public static function get_trial_period_validation_message($form = 'combined')
 {
     $subscription_ranges = WC_Subscriptions_Manager::get_subscription_ranges();
     if ('combined' == $form) {
         $error_message = sprintf(__('The trial period can not exceed: %1s, %2s, %3s or %4s.', WC_Subscriptions::$text_domain), array_pop($subscription_ranges['day']), array_pop($subscription_ranges['week']), array_pop($subscription_ranges['month']), array_pop($subscription_ranges['year']));
     } else {
         foreach (WC_Subscriptions_Manager::get_available_time_periods() as $period => $string) {
             $error_message[$period] = sprintf(__('The trial period can not exceed %1s.', WC_Subscriptions::$text_domain), array_pop($subscription_ranges[$period]));
         }
     }
     return apply_filters('woocommerce_subscriptions_trial_period_validation_message', $error_message);
 }
开发者ID:bulats,项目名称:chef,代码行数:18,代码来源:class-wc-subscriptions-admin.php

示例3: woocommerce_wp_text_input

woocommerce_wp_text_input(array('id' => 'variable_subscription_price[' . $loop . ']', 'class' => 'wc_input_subscription_price', 'wrapper_class' => '_subscription_price_field', 'label' => sprintf(__('Subscription Price (%s)', 'woocommerce-subscriptions'), get_woocommerce_currency_symbol()), 'placeholder' => __('e.g. 5.90', 'woocommerce-subscriptions'), 'value' => get_post_meta($variation->ID, '_subscription_price', true), 'type' => 'number', 'custom_attributes' => array('step' => 'any', 'min' => '0')));
// Subscription Period Interval
woocommerce_wp_select(array('id' => 'variable_subscription_period_interval[' . $loop . ']', 'class' => 'wc_input_subscription_period_interval', 'wrapper_class' => '_subscription_period_interval_field', 'label' => __('Subscription Periods', 'woocommerce-subscriptions'), 'options' => WC_Subscriptions_Manager::get_subscription_period_interval_strings(), 'value' => get_post_meta($variation->ID, '_subscription_period_interval', true)));
// Billing Period
woocommerce_wp_select(array('id' => 'variable_subscription_period[' . $loop . ']', 'class' => 'wc_input_subscription_period', 'wrapper_class' => '_subscription_period_field', 'label' => __('Billing Period', 'woocommerce-subscriptions'), 'value' => $subscription_period, 'description' => __('for', 'woocommerce-subscriptions'), 'options' => WC_Subscriptions_Manager::get_subscription_period_strings()));
// Subscription Length
woocommerce_wp_select(array('id' => 'variable_subscription_length[' . $loop . ']', 'class' => 'wc_input_subscription_length', 'wrapper_class' => '_subscription_length_field', 'label' => __('Subscription Length', 'woocommerce-subscriptions'), 'options' => WC_Subscriptions_Manager::get_subscription_ranges($subscription_period), 'value' => get_post_meta($variation->ID, '_subscription_length', true)));
?>
	</td>
</tr>
<tr class="variable_subscription_trial show_if_variable-subscription variable_subscription_trial_sign_up">
	<td class="sign-up-fee-cell show_if_variable-subscription">
<?php 
// Sign-up Fee
woocommerce_wp_text_input(array('id' => 'variable_subscription_sign_up_fee[' . $loop . ']', 'class' => 'wc_input_subscription_intial_price', 'wrapper_class' => '_subscription_sign_up_fee_field', 'label' => sprintf(__('Sign-up Fee (%s)', 'woocommerce-subscriptions'), get_woocommerce_currency_symbol()), 'placeholder' => __('e.g. 9.90', 'woocommerce-subscriptions'), 'value' => get_post_meta($variation->ID, '_subscription_sign_up_fee', true), 'type' => 'number', 'custom_attributes' => array('step' => 'any', 'min' => '0')));
?>
	</td>
	<td colspan="1" class="show_if_variable-subscription">
		<label><?php 
_e('Free Trial', 'woocommerce-subscriptions');
?>
</label>
<?php 
// Trial Length
woocommerce_wp_text_input(array('id' => 'variable_subscription_trial_length[' . $loop . ']', 'class' => 'wc_input_subscription_trial_length', 'wrapper_class' => '_subscription_trial_length_field', 'label' => __('Free Trial', 'woocommerce-subscriptions'), 'placeholder' => __('e.g. 3', 'woocommerce-subscriptions'), 'value' => get_post_meta($variation->ID, '_subscription_trial_length', true)));
// Trial Period
woocommerce_wp_select(array('id' => 'variable_subscription_trial_period[' . $loop . ']', 'class' => 'wc_input_subscription_trial_period', 'wrapper_class' => '_subscription_trial_period_field', 'label' => __('Subscription Trial Period', 'woocommerce-subscriptions'), 'options' => WC_Subscriptions_Manager::get_available_time_periods(), 'description' => sprintf(__('An optional period of time to wait before charging the first recurring payment. Any sign up fee will still be charged at the outset of the subscription. %s', 'woocommerce-subscriptions'), self::get_trial_period_validation_message()), 'desc_tip' => true, 'value' => WC_Subscriptions_Product::get_trial_period($variation->ID)));
?>
	</td>
</tr>
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:30,代码来源:html-variation-price.php


注:本文中的WC_Subscriptions_Manager::get_available_time_periods方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。