本文整理汇总了PHP中woocommerce_wp_checkbox函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_wp_checkbox函数的具体用法?PHP woocommerce_wp_checkbox怎么用?PHP woocommerce_wp_checkbox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woocommerce_wp_checkbox函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: admin_coupon_options_extended_features
public function admin_coupon_options_extended_features()
{
//=============================
//Title
echo "<h3 style='display:inline'>" . esc_html(__('Auto coupon', 'woocommerce-jos-autocoupon')) . "</h3>\n";
//=============================
// Auto coupon checkbox
woocommerce_wp_checkbox(array('id' => '_wjecf_is_auto_coupon', 'label' => __('Auto coupon', 'woocommerce-jos-autocoupon'), 'description' => __("Automatically add the coupon to the cart if the restrictions are met. Please enter a description when you check this box, the description will be shown in the customer's cart if the coupon is applied.", 'woocommerce-jos-autocoupon')));
//=============================
// Apply without notice
woocommerce_wp_checkbox(array('id' => '_wjecf_apply_silently', 'label' => __('Apply silently', 'woocommerce-jos-autocoupon'), 'description' => __("Don't display a message when this coupon is automatically applied.", 'woocommerce-jos-autocoupon')));
?>
<script type="text/javascript">
//Hide/show when AUTO-COUPON value changes
function update_wjecf_apply_silently_field( animation ) {
if ( animation === undefined ) animation = 'slow';
if (jQuery("#_wjecf_is_auto_coupon").prop('checked')) {
jQuery("._wjecf_apply_silently_field").show( animation );
} else {
jQuery("._wjecf_apply_silently_field").hide( animation );
}
}
update_wjecf_apply_silently_field( 0 );
jQuery("#_wjecf_is_auto_coupon").click( update_wjecf_apply_silently_field );
</script>
<?php
}
开发者ID:JaneJieYing,项目名称:kiddoonline_dvlpment,代码行数:30,代码来源:wjecf-autocoupon.php
示例2: ss_wc_write_coming_soon_tab_panel
/**
* Adds the option to set the product as coming soon for single products.
*
* @since 1.0.0
* @access public
* @uses woocommerce_wp_checkbox()
* @uses woocommerce_wp_text_input()
*/
function ss_wc_write_coming_soon_tab_panel()
{
echo '<div class="options_group">';
woocommerce_wp_checkbox(array('id' => '_set_coming_soon', 'label' => __('Set for Coming Soon?', 'ss-wc-coming-soon'), 'desc_tip' => true, 'description' => __('Make sure that you have set the stock to "Out of Stock".', 'ss-wc-coming-soon'), 'wrapper_class' => 'hide_if_variable'));
woocommerce_wp_text_input(array('id' => '_coming_soon_label', 'label' => __('Coming Soon Label', 'ss-wc-coming-soon'), 'placeholder' => __('Coming Soon', 'ss-wc-coming-soon'), 'desc_tip' => true, 'description' => __('Enter the label you want to show if coming soon is set. Default: Coming Soon', 'ss-wc-coming-soon'), 'wrapper_class' => 'hide_if_variable'));
echo '</div>';
}
开发者ID:wsenjer,项目名称:WooCommerce-Coming-Soon,代码行数:15,代码来源:class-wc-coming-soon-meta-box-product-data.php
示例3: output_shipping
public static function output_shipping()
{
global $post, $thepostid;
if (version_compare(WC()->version, '2.3', '<')) {
return;
}
$thepostid = $post->ID;
$_product = wc_get_product($thepostid);
$delivery_time = $_product->gzd_product->delivery_time;
?>
<p class="form-field">
<label for="delivery_time"><?php
_e('Delivery Time', 'woocommerce-germanized');
?>
</label>
<input type="hidden" class="wc-product-search wc-gzd-delivery-time-search" style="width: 50%" id="delivery_time" name="delivery_time" data-minimum_input_length="1" data-allow_clear="true" data-placeholder="<?php
_e('Search for a delivery time…', 'woocommerce-germanized');
?>
" data-action="woocommerce_gzd_json_search_delivery_time" data-multiple="false" data-selected="<?php
echo $delivery_time ? $delivery_time->name : '';
?>
" value="<?php
echo $delivery_time ? $delivery_time->term_id : '';
?>
" />
</p>
<?php
// Free shipping
woocommerce_wp_checkbox(array('id' => '_free_shipping', 'label' => __('Free shipping?', 'woocommerce-germanized'), 'description' => __('This option disables the "plus shipping costs" notice on product page', 'woocommerce-germanized')));
}
开发者ID:shwetadubey,项目名称:upfit,代码行数:33,代码来源:class-wc-gzd-meta-box-product-data.php
示例4: woo_refercheck_add_custom_general_fields
/**
* Display the custom WCRC fields on every product edit page
*/
function woo_refercheck_add_custom_general_fields()
{
global $woocommerce, $post;
// read the current referrers list
$referrers = get_post_meta($post->ID, '_woo_refercheck_referrers', true);
// convert to array
$ref_array = json_decode($referrers);
// build the value of the textarea
$theval = '';
if (count($ref_array) > 0) {
$i = 0;
foreach ($ref_array as $item) {
$theval .= $item;
if ($i != count($ref_array) - 1) {
$theval .= PHP_EOL;
}
$i++;
}
}
// start the HTML output for the custom fields
echo '<div class="options_group">';
// create and output the checkbox
woocommerce_wp_checkbox(array('id' => '_woo_refercheck_checkbox', 'label' => __('Limit to referrer(s)', 'woo-refercheck'), 'description' => __('Select if the display of this product should be limited to the specified referrer(s).', 'woo-refercheck')));
// create and output the text field
woocommerce_wp_textarea_input(array('id' => '_woo_refercheck_referrers', 'label' => __('Allowed referrer(s)', 'woo-refercheck'), 'placeholder' => '', 'desc_tip' => 'true', 'description' => __('Add the full HTTP addresseses of allowed referrer(s) for this product, one per line.', 'woo-refercheck'), 'value' => $theval));
woocommerce_wp_text_input(array('id' => '_woo_refercheck_target', 'label' => __('Redirect to', 'woo-refercheck'), 'placeholder' => 'http://', 'desc_tip' => 'true', 'description' => __('Enter the absolute URL to redirect to when this product is accessed form an unallowed referer.', 'woo-refercheck')));
// complete the HTML output
echo '</div>';
}
开发者ID:kathmann,项目名称:woo_refercheck,代码行数:32,代码来源:functions.php
示例5: discontinued_product_for_woocommerce_add_custom_fields
/**
* Adds the custom fields
*
* @access public
* @return void
*/
function discontinued_product_for_woocommerce_add_custom_fields()
{
global $woocommerce, $post;
echo '<div class="options_group">';
woocommerce_wp_checkbox(array('id' => '_discontinued', 'label' => __('Discontinued', 'discontinued_product_for_woocommerce'), 'name' => '_discontinued', 'description' => __('Check this box to mark this product as discontinued.', 'discontinued_product_for_woocommerce')));
echo '</div>';
}
开发者ID:vutran,项目名称:discontinued-product-for-woocommerce,代码行数:13,代码来源:discontinued-product-for-woocommerce.php
示例6: add_product_fields
public function add_product_fields()
{
global $woocommerce, $post;
echo '<div class="options_group show_if_variable">';
woocommerce_wp_checkbox(array('id' => '_dh_disable_variation_gallery', 'label' => __('Disable Variation Gallery ?', 'sitesao')));
echo '</div>';
}
开发者ID:jonasbelcina,项目名称:platinumdxb,代码行数:7,代码来源:woocommerce_product_variable.php
示例7: ss_wc_write_digital_details_tab_panel
/**
* Displays the fields for the new tab panel.
*
* @since 0.0.1
* @access public
* @uses woocommerce_wp_checkbox()
* @uses woocommerce_wp_text_input()
* @uses woocommerce_wp_select()
* @uses ss_wc_wp_select()
*/
function ss_wc_write_digital_details_tab_panel()
{
echo '<div id="digital_details_product_data" class="panel woocommerce_options_panel">';
do_action('ss_wc_digital_details_options_top');
echo '<div class="options_group">';
// What licence
woocommerce_wp_text_input(array('id' => '_licence', 'label' => __('Licence', 'ss-wc-digital-details'), 'desc_tip' => true, 'description' => __('Enter the licence that is associated with this file.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable', 'style' => 'width: 300px;'));
// File Size
woocommerce_wp_text_input(array('id' => '_file_size', 'label' => __('File Size', 'ss-wc-digital-details'), 'desc_tip' => true, 'description' => __('Enter the size of the file. e.g. 1 KB, 1 MB or 1 GB', 'ss-wc-digital-details'), 'placeholder' => __('1.5 MB', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable', 'style' => 'width: 150px;'));
echo '</div>';
echo '<div class="options_group">';
// Is Web Font?
woocommerce_wp_checkbox(array('id' => '_is_web_font', 'label' => __('Web Font?', 'ss-wc-digital-details'), 'description' => __('Enable if this file is a Web Font.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
echo '</div>';
echo '<div class="options_group">';
// Is Tileable?
woocommerce_wp_checkbox(array('id' => '_is_tileable', 'label' => __('Tileable?', 'ss-wc-digital-details'), 'description' => __('Enable if this file is Tileable.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
// Is Layered?
woocommerce_wp_checkbox(array('id' => '_is_layered', 'label' => __('Layered?', 'ss-wc-digital-details'), 'description' => __('Enable if this file has Layers.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
// Is Vector?
woocommerce_wp_checkbox(array('id' => '_is_vector', 'label' => __('Vector Formatted?', 'ss-wc-digital-details'), 'description' => __('Enable if this file has a Vector format.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
echo '</div>';
echo '<div class="options_group">';
// Is Fluid Layout?
woocommerce_wp_checkbox(array('id' => '_is_fluid_layout', 'label' => __('Fluid Layout?', 'ss-wc-digital-details'), 'description' => __('Enable if this file has a fluid layout.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
// Is Fixed Layout?
woocommerce_wp_checkbox(array('id' => '_is_fixed_layout', 'label' => __('Fixed Layout?', 'ss-wc-digital-details'), 'description' => __('Enable if this file has a fixed layout.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
// Is Responsive Layout?
woocommerce_wp_checkbox(array('id' => '_is_responsive_layout', 'label' => __('Responsive Layout?', 'ss-wc-digital-details'), 'description' => __('Enable if this file has a responsive layout.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
// Columns
woocommerce_wp_text_input(array('id' => '_columns', 'label' => __('Columns', 'ss-wc-digital-details'), 'placeholder' => '12', 'desc_tip' => true, 'description' => __('Enter the amount of columns this theme has.', 'ss-wc-digital-details'), 'type' => 'number', 'custom_attributes' => array('step' => 'any', 'min' => '1'), 'wrapper_class' => 'hide_if_variable', 'style' => 'width: 60px;'));
// Minimum Browser Requirement
// @filter ss_wc_digital_details_min_browser_options
ss_wc_wp_select(array('id' => '_minimum_browser_requirement', 'label' => __('Minimum Browser', 'ss-wc-digital-details'), 'type' => 'multiselect', 'options' => apply_filters('ss_wc_digital_details_min_browser_options', array('' => '', 'ie9' => __('IE 9+', 'ss-wc-digital-details'), 'firefox_14' => __('Firefox 14+', 'ss-wc-digital-details'), 'chrome_19' => __('Chrome 19+', 'ss-wc-digital-details'), 'safari_5' => __('Safari 5.1+', 'ss-wc-digital-details'), 'opera_12' => __('Opera 12+', 'ss-wc-digital-details'))), 'default' => '', 'wrapper_class' => 'hide_if_variable', 'placeholder' => __('Select the browsers this theme works in.', 'ss-wc-digital-details'), 'class' => 'wc-enhanced-select chosen_select', 'style' => 'min-width: 350px;'));
echo '</div>';
echo '<div class="options_group">';
// Dimensions
woocommerce_wp_textarea_input(array('id' => '_dimensions', 'label' => __('Dimensions', 'ss-wc-digital-details'), 'placeholder' => sprintf(__('Enter the dimensions of the digital item by "%s" seperating the values.', 'ss-wc-digital-details'), WC_DELIMITER), 'desc_tip' => true, 'description' => __('e.g. 8.5 x 11 in', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
// Orientation
ss_wc_wp_select(array('id' => '_orientation', 'label' => __('Orientation', 'ss-wc-digital-details'), 'options' => array('' => '', 'landscape' => __('Landscape', 'ss-wc-digital-details'), 'portrait' => __('Portrait', 'ss-wc-digital-details'), 'square' => __('Square', 'ss-wc-digital-details')), 'default' => '', 'wrapper_class' => 'show_if_photo', 'placeholder' => __('Select the orientation of this photo.', 'ss-wc-digital-details'), 'class' => 'wc-enhanced-select chosen_select', 'style' => 'width: 300px;'));
// DPI Size
woocommerce_wp_text_input(array('id' => '_dpi_size', 'label' => __('DPI Size', 'ss-wc-digital-details'), 'placeholder' => '72', 'desc_tip' => true, 'description' => __('Enter the DPI size of the file.', 'ss-wc-digital-details'), 'type' => 'number', 'custom_attributes' => array('step' => 'any', 'min' => '72'), 'wrapper_class' => 'hide_if_variable', 'style' => 'width: 60px;'));
echo '</div>';
echo '<div class="options_group">';
// Requirements
// @filter ss_wc_digital_details_requirement_options
ss_wc_wp_select(array('id' => '_requirements', 'label' => __('Requirements', 'ss-wc-digital-details'), 'type' => 'multiselect', 'options' => apply_filters('ss_wc_digital_details_requirement_options', array('' => '', 'adobe_cs1+' => 'Adobe CS1+', 'adobe_cs2+' => 'Adobe CS2+', 'adobe_cs3+' => 'Adobe CS3+', 'adobe_cs4+' => 'Adobe CS4+', 'adobe_cs5+' => 'Adobe CS5+', 'adobe_photoshop' => 'Adobe Photoshop', 'adobe_indesign' => 'Adobe InDesign', 'adobe_illustrator' => 'Adobe Illustrator', 'adobe_after_effcts' => 'Adobe After Effects')), 'default' => '', 'wrapper_class' => 'hide_if_variable', 'placeholder' => __('Select the requirements this file needs to edit', 'ss-wc-digital-details'), 'class' => 'wc-enhanced-select chosen_select', 'style' => 'min-width: 350px;'));
// Live Preview
woocommerce_wp_text_input(array('id' => '_live_preview', 'label' => __('Live Preview', 'ss-wc-digital-details'), 'placeholder' => 'http://', 'desc_tip' => true, 'description' => __('Enter the URL address for the live preview of this item.', 'ss-wc-digital-details'), 'data_type' => 'url', 'wrapper_class' => 'hide_if_variable', 'style' => 'min-width: 350px;'));
echo '</div>';
echo '<div class="options_group">';
// Message to Customers
woocommerce_wp_textarea_input(array('id' => '_message_to_customers', 'label' => __('Message to Customers', 'ss-wc-digital-details'), 'desc_tip' => true, 'description' => __('Leave a message for your customers. This will be displayed under the featured image.', 'ss-wc-digital-details'), 'wrapper_class' => 'hide_if_variable'));
echo '</div>';
// Close group
do_action('ss_wc_digital_details_options_bottom');
echo '</div>';
// Close product tab panel
}
开发者ID:bdacode,项目名称:WooCommerce-Digital-Details,代码行数:69,代码来源:class-wc-digital-details-meta-box-product-data.php
示例8: wc_ebs_add_product_option_pricing
public function wc_ebs_add_product_option_pricing()
{
global $woocommerce, $post;
echo '<div class="options_group">';
// Checkbox
woocommerce_wp_checkbox(array('id' => '_booking_option', 'class' => 'wc_booking_option checkbox', 'wrapper_class' => 'show_if_simple', 'label' => __('Add booking option', 'wc_ebs')));
echo '</div>';
}
开发者ID:geoffspink,项目名称:woocommerce-easy-booking-system,代码行数:8,代码来源:wc-ebs-plugin.php
示例9: fbc_wc_tab_options
function fbc_wc_tab_options()
{
global $post;
$fbc_wc_tab_options = array('title' => get_post_meta($post->ID, 'fbc_wc_tab_title', true), 'count' => get_post_meta($post->ID, 'fbc_wc_tab_count', true));
?>
<div id="fbc_wc_tab_option" class="panel woocommerce_options_panel">
<div class="options_group">
<p class="form-field">
<?php
woocommerce_wp_checkbox(array('id' => 'fbc_wc_tab_enabled', 'label' => __('Enable Facebook Comment Tab?', 'woocommerce'), 'description' => __('Enable this option to enable the facebook comment widget tab on the frontend.', 'woocommerce')));
?>
</p>
<?php
if (get_option('fbc_share_enabled') != 'yes') {
?>
<p class="form-field">
<?php
woocommerce_wp_checkbox(array('id' => 'fbc_wc_soc_share', 'label' => __('Enable Social Share?', 'woocommerce'), 'description' => __('Enable this option to enable the shocial share on the frontend.', 'woocommerce')));
?>
</p>
<?php
}
?>
</div>
<div class="options_group fbc_wc_tab_option">
<p class="form-field">
<label for="fbc_wc_tab_title"><?php
_e('FB Comment Title:', 'woocommerce');
?>
</label>
<input type="text" size="5" name="fbc_wc_tab_title" id="fbc_wc_tab_title" value="<?php
echo @$fbc_wc_tab_options['title'];
?>
" placeholder="<?php
_e('Enter your FB Comment tab title', 'woocommerce');
?>
" />
</p>
<p class="form-field">
<label for="fbc_wc_tab_count"><?php
_e('Comment Count:', 'woocommerce');
?>
</label>
<input type="text" size="3" name="fbc_wc_tab_count" id="fbc_wc_tab_count" value="<?php
echo @$fbc_wc_tab_options['count'];
?>
" placeholder="<?php
_e('How much comment will be shown', 'woocommerce');
?>
" />
</p>
</div>
</div>
<?php
}
开发者ID:phanhoanglong2610,项目名称:flowershop,代码行数:56,代码来源:fbc-class-admin.php
示例10: wsbs_calculator_tab_options
function wsbs_calculator_tab_options()
{
global $post, $woocommerce, $product;
// Start a container
echo "<div id=\"calculator_tab_data\" class=\"panel woocommerce_options_panel\">";
// Boolean calculator
woocommerce_wp_checkbox(array('id' => '_calculatorscript_active', 'label' => __('Enable Calculator', 'wsbs'), 'value' => esc_attr($post->_calculatorscript_active)));
// Calculator value
woocommerce_wp_text_input(array('id' => '_calculatorscript_value', 'label' => __('Calculator value', 'wsbs'), 'description' => __('This package contains ... m<sup>2</sup> (e.g. 1.5)', 'woocommerce'), 'value' => $post->_calculatorscript_value));
// Close the container
echo "</div>";
}
开发者ID:spiderPan,项目名称:Woocommerce-Service-Booking-System,代码行数:12,代码来源:plugin.php
示例11: points_add_custom_settings
public function points_add_custom_settings()
{
global $woocommerce, $post;
echo '<div class="options_group show-if-points">';
// Commission Price pulled from WooCommerce Core
woocommerce_wp_text_input(array('id' => '_regular_price', 'label' => __('Commission Price', 'woocommerce') . ' (' . get_woocommerce_currency_symbol() . ')', 'data_type' => 'price'));
// Create a number field, for example for UPC
woocommerce_wp_text_input(array('id' => 'points_product_cost', 'label' => __('Points Cost', 'woocommerce'), 'placeholder' => '', 'desc_tip' => 'true', 'description' => __('Enter the amount of points this product costs.', 'woocommerce'), 'type' => 'number'));
// Individual product
woocommerce_wp_checkbox(array('id' => '_sold_individually', 'label' => __('Sold Individually', 'woocommerce'), 'description' => __('Enable this to only allow one of this item to be bought in a single order', 'woocommerce')));
echo '</div>';
}
开发者ID:alexritchey,项目名称:fuzzy-wodhack,代码行数:12,代码来源:class-custom-points-product-settings.php
示例12: add_to_metabox
public function add_to_metabox()
{
global $post;
echo '<div class="options_group">';
// Checkbox
woocommerce_wp_checkbox(array('id' => '_wc_extension_boilerplate_checkbox', 'wrapper_class' => 'show_if_simple', 'label' => __('Sample Checkbox', 'woocommerce-extension-boilerplate'), 'description' => __('This is a sample checkbox.', 'woocommerce-extension-boilerplate')));
// Number
woocommerce_wp_text_input(array('id' => '_wc_extension_boilerplate_number', 'class' => 'show_if_simple', 'label' => __('Sample Number Field', 'woocommerce-extension-boilerplate'), 'desc_tip' => 'true', 'description' => __('This is a sample number field', 'woocommerce-extension-boilerplate'), 'type' => 'decimal'));
// Text
woocommerce_wp_text_input(array('id' => '_wc_extension_boilerplate_textbox', 'class' => 'show_if_simple', 'label' => __('Sample Text Field', 'woocommerce-extension-boilerplate'), 'desc_tip' => 'true', 'description' => __('This is a sample text field', 'woocommerce-extension-boilerplate')));
do_action('wc_extension_boilerplate_product_options');
echo '</div>';
}
开发者ID:helgatheviking,项目名称:wc-extension-boilerplate,代码行数:13,代码来源:class-wc-extension-boilerplate-admin.php
示例13: add_daily_coupons_fields
/**
* Prints the daily coupons checkboxes
*/
public function add_daily_coupons_fields()
{
global $post;
$rawValues = get_post_meta($post->ID, 'daily_coupon', true);
$values = empty($rawValues) ? array() : explode(',', $rawValues);
$days = array('Monday', 'Tuesday', 'Wednesday', 'Thusday', 'Friday', 'Saturday', 'Sunday');
echo '<h3>' . __('Only allow this coupon to be used on the following days:', $this->plugin_name) . '</h3>';
echo '<p><i>If left blank, the coupon will work as normal.</i></p>';
foreach ($days as $day) {
$minDay = substr($day, 0, 3);
woocommerce_wp_checkbox(array('id' => 'daily_coupon_' . $day, 'label' => __($day, $this->plugin_name), 'name' => __('daily_coupon[]', $this->plugin_name), 'cbvalue' => $minDay, 'value' => in_array($minDay, $values) ? $minDay : ''));
}
}
开发者ID:jakewhiteley,项目名称:woocommerce-daily-coupons,代码行数:16,代码来源:class-woocommerce-daily-coupons-admin.php
示例14: rental_options_product_tab_content
/**
* Contents of the rental options product tab.
*/
function rental_options_product_tab_content()
{
global $post;
?>
<div id='rental_options' class='panel woocommerce_options_panel'><?php
?>
<div class='options_group'><?php
woocommerce_wp_checkbox(array('id' => '_enable_renta_option', 'label' => __('Enable rental option X', 'woocommerce')));
woocommerce_wp_text_input(array('id' => '_text_input_y', 'label' => __('What is the value of Y', 'woocommerce'), 'desc_tip' => 'true', 'description' => __('A handy description field', 'woocommerce'), 'type' => 'text'));
print_r(wc_get_product($post));
?>
</div>
</div><?php
}
开发者ID:willowmagrini,项目名称:dg,代码行数:18,代码来源:pre-venda.php
示例15: product_settings_fields
public function product_settings_fields()
{
global $woocommerce, $post;
echo '<div id="fees_product_data" class="fee_panel panel woocommerce_options_panel wc-metaboxes-wrapper">';
echo '<div class="options_group">';
// Text Field - Fee Name
woocommerce_wp_text_input(array('id' => 'product-fee-name', 'label' => __('Fee Name', 'woocommerce-product-fees'), 'data_type' => 'text', 'placeholder' => __('Product Fee', 'placeholder', 'woocommerce-product-fees'), 'desc_tip' => 'true', 'description' => __('This will be shown at checkout descriping the added fee.', 'woocommerce-product-fees')));
// Text Field - Fee Amount
woocommerce_wp_text_input(array('id' => 'product-fee-amount', 'label' => __('Fee Amount', 'woocommerce-product-fees') . ' (' . get_woocommerce_currency_symbol() . ')', 'data_type' => 'price', 'desc_tip' => 'true', 'description' => __('Enter a monetary decimal without any currency symbols or thousand seperators. This field also accepts percentages.', 'woocommerce-product-fees')));
echo '</div>';
echo '<div class="options_group">';
// Check Box - Fee Multiply Option
woocommerce_wp_checkbox(array('id' => 'product-fee-multiplier', 'label' => __('Multiply Fee by Quantity', 'woocommerce-product-fees'), 'desc_tip' => 'true', 'description' => __('Multiply the fee by the quanitity of this product that is added to the cart.', 'woocommerce-product-fees')));
echo '</div>';
echo '</div>';
}
开发者ID:spraveenitpro,项目名称:WooCommerce-Product-Fees,代码行数:16,代码来源:class-woocommerce-product-fees-admin.php
示例16: variation_settings_fields
public function variation_settings_fields($loop, $variation_data, $variation)
{
// Set placeholders based on global product level fees.
$parent_id = $variation->post_parent;
if (get_post_meta($parent_id, 'product-fee-name', true) != '' && get_post_meta($parent_id, 'product-fee-amount', true) != '') {
$placeholders = array('name' => get_post_meta($parent_id, 'product-fee-name', true), 'amount' => get_post_meta($parent_id, 'product-fee-amount', true));
} else {
$placeholders = array('name' => __('Product Fee', 'woocommerce-product-fees'), 'amount' => __('Monetary Decimal or Percentage', 'woocommerce-product-fees'));
}
// Text Field - Fee Name
woocommerce_wp_text_input(array('id' => 'product-fee-name[' . $variation->ID . ']', 'label' => __('Fee Name', 'woocommerce-product-fees'), 'data_type' => 'text', 'placeholder' => $placeholders['name'], 'value' => get_post_meta($variation->ID, 'product-fee-name', true), 'wrapper_class' => "form-row form-row-first"));
// Text Field - Fee Amount
woocommerce_wp_text_input(array('id' => 'product-fee-amount[' . $variation->ID . ']', 'label' => __('Fee Amount', 'woocommerce-product-fees') . ' (' . get_woocommerce_currency_symbol() . ')', 'data_type' => 'price', 'placeholder' => $placeholders['amount'], 'value' => get_post_meta($variation->ID, 'product-fee-amount', true), 'wrapper_class' => "form-row form-row-last"));
// Check Box - Fee Multiply Option
woocommerce_wp_checkbox(array('id' => 'product-fee-multiplier[' . $variation->ID . ']', 'label' => __('Multiply Fee by Quantity', 'woocommerce-product-fees'), 'value' => get_post_meta($variation->ID, 'product-fee-multiplier', true), 'wrapper_class' => "product-fee-multiplier"));
do_action('wcpf_add_variation_settings');
}
开发者ID:WPprodigy,项目名称:woocommerce-product-fees,代码行数:17,代码来源:class-wcpf-admin-product-settings.php
示例17: output
/**
* Output Meta Box
*
* The function to be called to output the meta box in product details page.
*
* @param $post object the current product
* @since 1.0.0
* @author Alberto Ruggiero
* @return void
*/
public static function output($post)
{
wp_nonce_field('woocommerce_save_data', 'woocommerce_meta_nonce');
$args = array('add_to_cart' => array('id' => '_ywctm_exclude_catalog_mode', 'wrapper_class' => '', 'label' => __('"Add to cart" button', 'ywctm'), 'description' => 'Exclude this product from hiding "Add to cart" button'), 'price' => array('id' => '_ywctm_exclude_hide_price', 'wrapper_class' => '', 'label' => __('Product price', 'ywctm'), 'description' => 'Exclude this product from hiding price'));
?>
<div class="panel woocommerce_options_panel">
<div class="options_group">
<?php
woocommerce_wp_checkbox($args['add_to_cart']);
?>
<?php
woocommerce_wp_checkbox($args['price']);
?>
</div>
</div>
<?php
}
开发者ID:GolgoSoft,项目名称:KeenerWP,代码行数:27,代码来源:class-ywctm-meta-box.php
示例18: product_settings_fields
public function product_settings_fields()
{
global $woocommerce, $post;
echo '<div id="fees_product_data" class="fee_panel panel woocommerce_options_panel wc-metaboxes-wrapper">';
echo '<div class="options_group">';
// Text Field - Fee Name
woocommerce_wp_text_input(array('id' => 'product-fee-name', 'label' => __('Fee Name', 'woocommerce-product-fees'), 'data_type' => 'text', 'placeholder' => __('Product Fee', 'placeholder', 'woocommerce-product-fees'), 'desc_tip' => 'true', 'description' => __('This will be shown at checkout descriping the added fee.', 'woocommerce-product-fees')));
// Load product's base currency. It will be used to show the Admin which
// fees can be calculated automatically
$product_base_currency = WooCommerce_Product_Fees_Currency_Helper::get_product_base_currency($post->ID);
// Get a list of the enabled currencies. We will need to display one price
// field for each. By using the merge/unique trick, we can make sure that
// product's base currency is always the first in the list (the enabled_currencies()
// method returns them sorted alphabetically)
$enabled_currencies = array_unique(array_merge(array($product_base_currency), WooCommerce_Product_Fees_Currency_Helper::enabled_currencies()));
$placeholder = '';
foreach ($enabled_currencies as $currency) {
$field_description = __('Enter a monetary decimal without any currency symbols or thousand separators. This field also accepts percentages.', 'woocommerce-product-fees');
// For additional currencies, add an extra description to explain that the
// fees can be calculated automatically
if ($currency != $product_base_currency) {
$field_description = ' ' . sprintf(__('If you leave this field empty, its value will be calculated automatically, by converting the base amount in %s to this currency.', 'woocommerce-product-fees'), $product_base_currency);
}
// If we have more than one currency, show a different placeholder for
// the base currency and the additional ones, to help the admin to understand
// which ones can be calculated automatically. When a single currency is
// used, the placeholder can be left empty, as the field's purpose is
// obvious
if (count($enabled_currencies) > 1) {
$placeholder = $currency === $product_base_currency ? __('Base amount', 'woocommerce-product-fees') : __('Auto', 'woocommerce-product-fees');
}
// Text Field - Fee Amount
woocommerce_wp_text_input(array('id' => 'product-fee-amount-' . $currency, 'label' => __('Fee Amount', 'woocommerce-product-fees') . ' (' . $currency . ')', 'data_type' => 'price', 'desc_tip' => 'true', 'description' => $field_description, 'name' => 'product-fee-amount[' . $currency . ']', 'placeholder' => $placeholder));
}
echo '</div>';
echo '<div class="options_group">';
// Check Box - Fee Multiply Option
woocommerce_wp_checkbox(array('id' => 'product-fee-multiplier', 'label' => __('Multiply Fee by Quantity', 'woocommerce-product-fees'), 'desc_tip' => 'true', 'description' => __('Multiply the fee by the quanitity of this product that is added to the cart.', 'woocommerce-product-fees')));
echo '</div>';
echo '</div>';
}
开发者ID:aelia-co,项目名称:WooCommerce-Product-Fees,代码行数:41,代码来源:class-woocommerce-product-fees-admin.php
示例19: data_display
/**
* Display product settings
*
* @access public
* @since 2.2
*/
public function data_display()
{
?>
<div id="rcp_access_control" class="panel woocommerce_options_panel">
<div class="options_group">
<p><?php
_e('Restrict purchasing of this product to:', 'rcp');
?>
</p>
<?php
woocommerce_wp_checkbox(array('id' => '_rcp_woo_active_to_purchase', 'label' => __('Active subscribers only?', 'rcp'), 'cbvalue' => 1));
$levels = (array) get_post_meta(get_the_ID(), '_rcp_woo_subscription_levels_to_purchase', true);
foreach (rcp_get_subscription_levels('all') as $level) {
woocommerce_wp_checkbox(array('name' => '_rcp_woo_subscription_levels_to_purchase[]', 'id' => '_rcp_woo_subscription_level_' . $level->id, 'label' => $level->name, 'value' => in_array($level->id, $levels) ? $level->id : 0, 'cbvalue' => $level->id));
}
woocommerce_wp_select(array('id' => '_rcp_woo_access_level_to_purchase', 'label' => __('Access level required?', 'rcp'), 'options' => rcp_get_access_levels()));
?>
</div>
<div class="options_group">
<p><?php
_e('Restrict viewing of this product to:', 'rcp');
?>
</p>
<?php
woocommerce_wp_checkbox(array('id' => '_rcp_woo_active_to_view', 'label' => __('Active subscribers only?', 'rcp'), 'cbvalue' => 1));
$levels = (array) get_post_meta(get_the_ID(), '_rcp_woo_subscription_levels_to_view', true);
foreach (rcp_get_subscription_levels('all') as $level) {
woocommerce_wp_checkbox(array('name' => '_rcp_woo_subscription_levels_to_view[]', 'id' => '_rcp_woo_subscription_level_to_view_' . $level->id, 'label' => $level->name, 'value' => in_array($level->id, $levels) ? $level->id : 0, 'cbvalue' => $level->id));
}
woocommerce_wp_select(array('id' => '_rcp_woo_access_level_to_view', 'label' => __('Access level required?', 'rcp'), 'options' => rcp_get_access_levels()));
?>
</div>
</div>
<?php
}
开发者ID:ramiy,项目名称:restrict-content-pro,代码行数:44,代码来源:class-rcp-woocommerce.php
示例20: add_to_metabox
public static function add_to_metabox()
{
global $post;
echo '<div class="options_group show_if_nyp">';
if (class_exists('WC_Subscriptions')) {
// make billing period variable
woocommerce_wp_checkbox(array('id' => '_variable_billing', 'wrapper_class' => 'show_if_subscription', 'label' => __('Variable Billing Period', 'wc_name_your_price'), 'description' => __('Allow the customer to set the billing period.', 'wc_name_your_price')));
}
// Suggested Price
woocommerce_wp_text_input(array('id' => '_suggested_price', 'class' => 'wc_input_price short', 'label' => __('Suggested Price', 'wc_name_your_price') . ' (' . get_woocommerce_currency_symbol() . ')', 'desc_tip' => 'true', 'description' => __('Price to pre-fill for customers. Leave blank to not suggest a price.', 'wc_name_your_price'), 'data_type' => 'price'));
if (class_exists('WC_Subscriptions')) {
// Suggested Billing Period
woocommerce_wp_select(array('id' => '_suggested_billing_period', 'label' => __('per', 'wc_name_your_price'), 'options' => WC_Name_Your_Price_Helpers::get_subscription_period_strings()));
}
// Minimum Price
woocommerce_wp_text_input(array('id' => '_min_price', 'class' => 'wc_input_price short', 'label' => __('Minimum Price', 'wc_name_your_price') . ' (' . get_woocommerce_currency_symbol() . ')', 'desc_tip' => 'true', 'description' => __('Lowest acceptable price for product. Leave blank to not enforce a minimum. Must be less than or equal to the set suggested price.', 'wc_name_your_price'), 'data_type' => 'price'));
if (class_exists('WC_Subscriptions')) {
// Minimum Billing Period
woocommerce_wp_select(array('id' => '_minimum_billing_period', 'label' => __('per', 'wc_name_your_price'), 'options' => WC_Name_Your_Price_Helpers::get_subscription_period_strings()));
}
do_action('woocommerce_name_your_price_options_pricing');
echo '</div>';
}
开发者ID:slavic18,项目名称:cats,代码行数:23,代码来源:class-name-your-price-admin.php
注:本文中的woocommerce_wp_checkbox函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论