本文整理汇总了PHP中WC_Subscriptions_Manager::get_subscription_period_interval_strings方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Subscriptions_Manager::get_subscription_period_interval_strings方法的具体用法?PHP WC_Subscriptions_Manager::get_subscription_period_interval_strings怎么用?PHP WC_Subscriptions_Manager::get_subscription_period_interval_strings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Subscriptions_Manager
的用法示例。
在下文中一共展示了WC_Subscriptions_Manager::get_subscription_period_interval_strings方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: subscription_pricing_fields
/**
* Output the subscription specific pricing fields on the "Edit Product" admin page.
*
* @since 1.0
*/
public static function subscription_pricing_fields()
{
global $post;
// Set month as the default billing period
if (!($subscription_period = get_post_meta($post->ID, '_subscription_period', true))) {
$subscription_period = 'month';
}
echo '<div class="options_group show_if_subscription subscription_pricing">';
// Subscription Price
woocommerce_wp_text_input(array('id' => '_subscription_price', 'class' => 'wc_input_subscription_price', 'label' => sprintf(__('Subscription Price (%s)', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol()), 'placeholder' => __('e.g. 5.90', WC_Subscriptions::$text_domain)));
// Subscription Period Interval
woocommerce_wp_select(array('id' => '_subscription_period_interval', 'class' => 'wc_input_subscription_period_interval', 'label' => __('Subscription Periods', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_subscription_period_interval_strings()));
// Billing Period
woocommerce_wp_select(array('id' => '_subscription_period', 'class' => 'wc_input_subscription_period', 'label' => __('Billing Period', WC_Subscriptions::$text_domain), 'value' => $subscription_period, 'description' => __('for', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_subscription_period_strings()));
// Subscription Length
woocommerce_wp_select(array('id' => '_subscription_length', 'class' => 'wc_input_subscription_length', 'label' => __('Subscription Length', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_subscription_ranges($subscription_period), 'description' => sprintf(__('with a %s', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol())));
// Sign-up Fee
woocommerce_wp_text_input(array('id' => '_subscription_sign_up_fee', 'class' => 'wc_input_subscription_intial_price', 'label' => sprintf(__('Sign-up Fee (%s)', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol()), 'placeholder' => __('e.g. 9.90', WC_Subscriptions::$text_domain), 'description' => __('sign-up fee', WC_Subscriptions::$text_domain)));
// Trial Length
woocommerce_wp_text_input(array('id' => '_subscription_trial_length', 'class' => 'wc_input_subscription_trial_length', 'label' => __('Free Trial', WC_Subscriptions::$text_domain)));
// Trial Period
woocommerce_wp_select(array('id' => '_subscription_trial_period', 'class' => 'wc_input_subscription_trial_period', 'label' => __('Subscription Trial Period', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_available_time_periods(), 'description' => sprintf(__('Include 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', WC_Subscriptions::$text_domain), self::get_trial_period_validation_message()), 'desc_tip' => true, 'value' => WC_Subscriptions_Product::get_trial_period($post->ID)));
do_action('woocommerce_subscriptions_product_options_pricing');
echo '</div>';
echo '<div class="show_if_subscription clear"></div>';
}
示例2: subscription_pricing_fields
/**
* Output the subscription specific pricing fields on the "Edit Product" admin page.
*
* @since 1.0
*/
public static function subscription_pricing_fields()
{
global $post;
// Set month as the default billing period
if (!($subscription_period = get_post_meta($post->ID, '_subscription_period', true))) {
$subscription_period = 'month';
}
echo '<div class="options_group show_if_subscription subscription_pricing">';
// Subscription Price
woocommerce_wp_text_input(array('id' => '_subscription_price', 'class' => 'wc_input_subscription_price', 'label' => sprintf(__('Subscription Price (%s)', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol()), 'placeholder' => __('e.g. 5.90', WC_Subscriptions::$text_domain)));
// Subscription Period Interval
woocommerce_wp_select(array('id' => '_subscription_period_interval', 'class' => 'wc_input_subscription_period_interval', 'label' => __('Subscription Periods', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_subscription_period_interval_strings()));
// Billing Period
woocommerce_wp_select(array('id' => '_subscription_period', 'class' => 'wc_input_subscription_period', 'label' => __('Billing Period', WC_Subscriptions::$text_domain), 'value' => $subscription_period, 'description' => __('for', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_subscription_period_strings()));
// Subscription Length
woocommerce_wp_select(array('id' => '_subscription_length', 'class' => 'wc_input_subscription_length', 'label' => __('Subscription Length', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_subscription_ranges($subscription_period), 'description' => sprintf(__('with a %s', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol())));
// Sign-up Fee
woocommerce_wp_text_input(array('id' => '_subscription_sign_up_fee', 'class' => 'wc_input_subscription_intial_price', 'label' => sprintf(__('Sign-up Fee (%s)', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol()), 'placeholder' => __('e.g. 9.90', WC_Subscriptions::$text_domain), 'description' => __('sign-up fee and', WC_Subscriptions::$text_domain)));
// Trial Period
woocommerce_wp_select(array('id' => '_subscription_trial_length', 'class' => 'wc_input_subscription_trial_length', 'label' => __('Subscription Trial Period', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_subscription_trial_lengths($subscription_period), 'description' => __('free trial', WC_Subscriptions::$text_domain)));
do_action('woocommerce_subscriptions_product_options_pricing');
echo '</div>';
}
示例3: variable_subscription_pricing_fields
/**
* Output the subscription specific pricing fields on the "Edit Product" admin page.
*
* @since 1.3
*/
public static function variable_subscription_pricing_fields($loop, $variation_data, $variation)
{
global $woocommerce, $thepostid;
// Set month as the default billing period
if (!($subscription_period = get_post_meta($variation->ID, '_subscription_period', true))) {
$subscription_period = 'month';
}
// When called via Ajax
if (!function_exists('woocommerce_wp_text_input')) {
require_once $woocommerce->plugin_path() . '/admin/post-types/writepanels/writepanels-init.php';
}
if (!isset($thepostid)) {
$thepostid = $variation->post_parent;
}
?>
<tr class="variable_subscription_pricing show_if_variable-subscription">
<td colspan="2">
<label><?php
printf(__('Subscription Price (%s)', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol());
?>
</label>
<?php
// Subscription Price
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)', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol()), 'placeholder' => __('e.g. 5.90', WC_Subscriptions::$text_domain), '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', WC_Subscriptions::$text_domain), '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', WC_Subscriptions::$text_domain), 'value' => $subscription_period, 'description' => __('for', WC_Subscriptions::$text_domain), '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', WC_Subscriptions::$text_domain), 'options' => WC_Subscriptions_Manager::get_subscription_ranges($subscription_period), 'value' => get_post_meta($variation->ID, '_subscription_length', true)));
?>
</td>
<td class="sign-up-fee-cell show_if_variable-subscription">
<label><?php
printf(__('Sign-up Fee (%s)', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol());
?>
</label>
<?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)', WC_Subscriptions::$text_domain), get_woocommerce_currency_symbol()), 'placeholder' => __('e.g. 9.90', WC_Subscriptions::$text_domain), 'value' => get_post_meta($variation->ID, '_subscription_sign_up_fee', true), 'type' => 'number', 'custom_attributes' => array('step' => 'any', 'min' => '0')));
?>
</td>
</tr>
<tr class="variable_subscription_trial show_if_variable-subscription">
<td colspan="1" class="show_if_variable-subscription">
<label><?php
_e('Free Trial', WC_Subscriptions::$text_domain);
?>
</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', WC_Subscriptions::$text_domain), 'placeholder' => __('e.g. 3', WC_Subscriptions::$text_domain), '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', WC_Subscriptions::$text_domain), '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', WC_Subscriptions::$text_domain), self::get_trial_period_validation_message()), 'desc_tip' => true, 'value' => WC_Subscriptions_Product::get_trial_period($variation->ID)));
do_action('woocommerce_variable_subscription_pricing');
?>
</td>
</tr>
<?php
}
示例4: _e
?>
</select>
<label for="variable_subscription_period_interval[<?php
echo $loop;
?>
]" class="wcs_hidden_label"><?php
_e('Billing Interval', 'woocommerce-subscriptions');
?>
</label>
<select name="variable_subscription_period_interval[<?php
echo $loop;
?>
]" class="wc_input_subscription_period_interval">
<?php
foreach (WC_Subscriptions_Manager::get_subscription_period_interval_strings() as $key => $value) {
?>
<option value="<?php
echo esc_attr($key);
?>
" <?php
selected($key, $chosen_interval);
?>
><?php
echo esc_html($value);
?>
</option>
<?php
}
?>
</select>
示例5: printf
*/
if (!defined('ABSPATH')) {
exit;
}
?>
<tr class="variable_subscription_pricing show_if_variable-subscription">
<td colspan="2">
<label><?php
printf(__('Subscription Price (%s)', 'woocommerce-subscriptions'), get_woocommerce_currency_symbol());
?>
</label>
<?php
// Subscription Price
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">