• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP woocommerce_wp_hidden_input函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中woocommerce_wp_hidden_input函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_wp_hidden_input函数的具体用法?PHP woocommerce_wp_hidden_input怎么用?PHP woocommerce_wp_hidden_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: bf_wc_product_general

function bf_wc_product_general($thepostid, $customfield)
{
    ?>

    <div id="general_product_data"><?php 
    if (isset($customfield['product_sku']) && $customfield['product_sku'] != 'hidden') {
        echo '<div class="options_group hide_if_grouped">';
        // SKU
        if (wc_product_sku_enabled()) {
            $required = $customfield['product_sku'] == 'required' ? array('required' => '') : '';
            $required_html = $customfield['product_sku'] == 'required' ? '<span class="required">* </span>' : '';
            woocommerce_wp_text_input(array('custom_attributes' => $required, 'id' => '_sku', 'label' => $required_html . '<abbr title="' . __('Stock Keeping Unit', 'woocommerce') . '">' . __('SKU', 'woocommerce') . '</abbr><br>', 'desc_tip' => 'true', 'description' => __('SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce')));
        } else {
            echo '<input type="hidden" name="_sku" value="' . esc_attr(get_post_meta($thepostid, '_sku', true)) . '" />';
        }
        do_action('woocommerce_product_options_sku');
        echo '</div>';
    }
    echo '<div class="options_group show_if_external">';
    // External URL
    woocommerce_wp_text_input(array('id' => '_product_url', 'label' => __('Product URL', 'woocommerce') . '<br>', 'placeholder' => 'http://', 'description' => __('Enter the external URL to the product.', 'woocommerce')));
    // Button text
    woocommerce_wp_text_input(array('id' => '_button_text', 'label' => __('Button text', 'woocommerce') . '<br>', 'placeholder' => _x('Buy product', 'placeholder', 'woocommerce'), 'description' => __('This text will be shown on the button linking to the external product.', 'woocommerce')));
    echo '</div>';
    echo '<div class="options_group pricing show_if_simple show_if_external">';
    $required = $customfield['product_regular_price'][0] == 'required' ? array('required' => '') : '';
    $required_html = $customfield['product_regular_price'][0] == 'required' ? '<span class="required">* </span>' : '';
    // Price
    woocommerce_wp_text_input(array('custom_attributes' => $required, 'id' => '_regular_price', 'label' => $required_html . __('Regular Price', 'woocommerce') . ' (' . get_woocommerce_currency_symbol() . ')<br>', 'data_type' => 'price'));
    if (isset($customfield['product_sales_price']) && $customfield['product_sales_price'] != 'hidden') {
        $required = $customfield['product_sales_price'] == 'required' ? array('required' => '') : '';
        $required_html = $customfield['product_sales_price'] == 'required' ? '<span class="required">* </span>' : '';
        $description = isset($customfield['product_sales_price']) ? $customfield['product_sales_price'] == 'required' ? '' : '<a href="#" class="sale_schedule">' . __('Schedule', 'woocommerce') . '</a>' : '';
        // Special Price
        woocommerce_wp_text_input(array('custom_attributes' => $required, 'id' => '_sale_price', 'data_type' => 'price', 'label' => $required_html . __('Sale Price', 'woocommerce') . ' (' . get_woocommerce_currency_symbol() . ')<br>', 'description' => $description));
    } else {
        woocommerce_wp_hidden_input(array('id' => '_sale_price', 'data_type' => 'price'));
    }
    if (isset($customfield['product_sales_price_dates']) && $customfield['product_sales_price_dates'] != 'hidden') {
        $required = $customfield['product_sales_price_dates'] == 'required' ? array('required' => '') : '';
        $required_html = $customfield['product_sales_price_dates'] == 'required' ? '<span class="required">* </span>' : '';
        $description = isset($customfield['product_sales_price_dates']) ? $customfield['product_sales_price'] == 'required' ? 'style="display: block;"' : '' : '';
        // Special Price date range
        $sale_price_dates_from = ($date = get_post_meta($thepostid, '_sale_price_dates_from', true)) ? date_i18n('Y-m-d', $date) : '';
        $sale_price_dates_to = ($date = get_post_meta($thepostid, '_sale_price_dates_to', true)) ? date_i18n('Y-m-d', $date) : '';
        echo '	<p class="form-field sale_price_dates_fields" ' . $required_style . '>
            <label for="_sale_price_dates_from">' . $required_html . __('Sale Price Dates', 'woocommerce') . '</label>
            <input ' . $required . ' type="text" class="short" name="_sale_price_dates_from" id="_sale_price_dates_from" value="' . esc_attr($sale_price_dates_from) . '" placeholder="' . _x('From&hellip;', 'placeholder', 'woocommerce') . ' YYYY-MM-DD" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />
            <input ' . $required . ' type="text" class="short" name="_sale_price_dates_to" id="_sale_price_dates_to" value="' . esc_attr($sale_price_dates_to) . '" placeholder="' . _x('To&hellip;', 'placeholder', 'woocommerce') . '  YYYY-MM-DD" maxlength="10" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />
            <a href="#" class="cancel_sale_schedule">' . __('Cancel', 'woocommerce') . '</a>
        </p>';
    }
    do_action('woocommerce_product_options_pricing');
    echo '</div></div>';
    do_action('bf_woocommerce_product_options_general_last', $thepostid, $customfield);
}
开发者ID:Kemitestech,项目名称:WordPress-Skeleton,代码行数:56,代码来源:bf-wc-product-general.php


示例2: cr_woocommerce_buy_with_this_item_options

/**
 * Контент блока нашли девле
 */
function cr_woocommerce_buy_with_this_item_options()
{
    global $post;
    $values = get_post_meta($post->ID, '_buy_with_this', true);
    $buy_with_this = explode(',', $values);
    ?>

    <div id="cr_buy_with_this_item" class="panel woocommerce_options_panel">
        <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css">
        <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"></script>
        <div class="club-opening-hours">
            <?php 
    echo get_the_ID();
    ?>
            <fieldset class="form-field">
                <div class="wrap">

                    <p>
                        <?php 
    $out = '<select id="multiple-select-box" class="js-example-basic-multiple" data-placeholder="Type to search cities" name="_buy_with_this_sel" multiple="multiple">';
    $args = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => 10000);
    $products = new WP_Query($args);
    if ($products->have_posts()) {
        while ($products->have_posts()) {
            $products->the_post();
            $selected = in_array($post->ID, $buy_with_this) ? ' selected="selected"' : '';
            $out .= '<option value="' . $post->ID . '"' . $selected . '>' . $post->post_title . '</option>';
        }
    }
    wp_reset_query();
    $out .= '</select>';
    woocommerce_wp_hidden_input(array('id' => '_buy_with_this', 'value' => $values));
    echo $out;
    ?>
                        <a class="ccc" href="#">submit</a>
                    </p>

                    <script>
                        $eventSelect = jQuery('#multiple-select-box').select2();

                        $eventSelect.on("change", function (e) { jQuery('#_buy_with_this').val($eventSelect.val()) });

                        jQuery('a.ccc').click(function (e) {
                           // alert(jQuery('#multiple-select-box').val());
                        });
                    </script>

                </div>
            </fieldset>
        </div>
    </div>
    <?php 
}
开发者ID:WP-Panda,项目名称:m.video,代码行数:56,代码来源:buy-with-this-item.php


示例3: output


//.........这里部分代码省略.........
" value="<?php 
        echo implode(',', array_keys($json_ids));
        ?>
" /> <img class="help_tip" data-tip='<?php 
        _e('Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce');
        ?>
' src="<?php 
        echo WC()->plugin_url();
        ?>
/assets/images/help.png" height="16" width="16" />
					</p>
				</div>

				<div class="options_group grouping show_if_simple show_if_external">

					<p class="form-field">
						<label for="parent_id"><?php 
        _e('Grouping', 'woocommerce');
        ?>
</label>
						<input type="hidden" class="wc-product-search" style="width: 50%;" id="parent_id" name="parent_id" data-placeholder="<?php 
        _e('Search for a product&hellip;', 'woocommerce');
        ?>
" data-action="woocommerce_json_search_grouped_products" data-allow_clear="true" data-multiple="false" data-exclude="<?php 
        echo intval($post->ID);
        ?>
" data-selected="<?php 
        $parent_id = absint($post->post_parent);
        if ($parent_id) {
            $parent = wc_get_product($parent_id);
            if (is_object($parent)) {
                $parent_title = wp_kses_post(html_entity_decode($parent->get_formatted_name()));
            }
            echo esc_attr($parent_title);
        }
        ?>
" value="<?php 
        echo $parent_id ? $parent_id : '';
        ?>
" /> <img class="help_tip" data-tip='<?php 
        _e('Set this option to make this product part of a grouped product.', 'woocommerce');
        ?>
' src="<?php 
        echo WC()->plugin_url();
        ?>
/assets/images/help.png" height="16" width="16" />
					</p>

					<?php 
        woocommerce_wp_hidden_input(array('id' => 'previous_parent_id', 'value' => absint($post->post_parent)));
        do_action('woocommerce_product_options_grouping');
        ?>
				</div>

				<?php 
        do_action('woocommerce_product_options_related');
        ?>
			</div>

			<div id="advanced_product_data" class="panel woocommerce_options_panel">

				<div class="options_group hide_if_external">
					<?php 
        // Purchase note
        woocommerce_wp_textarea_input(array('id' => '_purchase_note', 'label' => __('Purchase Note', 'woocommerce'), 'desc_tip' => 'true', 'description' => __('Enter an optional note to send the customer after purchase.', 'woocommerce')));
        ?>
				</div>

				<div class="options_group">
					<?php 
        // menu_order
        woocommerce_wp_text_input(array('id' => 'menu_order', 'label' => __('Menu order', 'woocommerce'), 'desc_tip' => 'true', 'description' => __('Custom ordering position.', 'woocommerce'), 'value' => intval($post->menu_order), 'type' => 'number', 'custom_attributes' => array('step' => '1')));
        ?>
				</div>

				<div class="options_group reviews">
					<?php 
        woocommerce_wp_checkbox(array('id' => 'comment_status', 'label' => __('Enable reviews', 'woocommerce'), 'cbvalue' => 'open', 'value' => esc_attr($post->comment_status)));
        do_action('woocommerce_product_options_reviews');
        ?>
				</div>

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

			</div>

			<?php 
        self::output_variations();
        do_action('woocommerce_product_data_panels');
        do_action('woocommerce_product_write_panels');
        // _deprecated
        ?>

			<div class="clear"></div>

		</div>
		<?php 
    }
开发者ID:WordCommerce,项目名称:woocommerce,代码行数:101,代码来源:class-wc-meta-box-product-data.php


示例4: meta_box

 /**
  * Show the meta box for shipment info on the order page
  *
  * @access public
  */
 public function meta_box()
 {
     global $woocommerce, $post;
     $tracking_items = $this->get_tracking_items($post->ID);
     echo '<div id="tracking-items">';
     if (count($tracking_items) > 0) {
         foreach ($tracking_items as $tracking_item) {
             $this->display_html_tracking_item_for_meta_box($post->ID, $tracking_item);
         }
     }
     echo '</div>';
     echo '<button class="button button-show-form" type="button">' . __('Add Tracking Number', 'wc_shipment_tracking') . '</button>';
     echo '<div id="shipment-tracking-form">';
     // Providers
     echo '<p class="form-field tracking_provider_field"><label for="tracking_provider">' . __('Provider:', 'wc_shipment_tracking') . '</label><br/><select id="tracking_provider" name="tracking_provider" class="chosen_select" style="width:100%;">';
     echo '<option value="">' . __('Custom Provider', 'wc_shipment_tracking') . '</option>';
     $selected_provider = '';
     if (!$selected_provider) {
         $selected_provider = sanitize_title(apply_filters('woocommerce_shipment_tracking_default_provider', ''));
     }
     foreach ($this->get_providers() as $provider_group => $providers) {
         echo '<optgroup label="' . $provider_group . '">';
         foreach ($providers as $provider => $url) {
             echo '<option value="' . sanitize_title($provider) . '" ' . selected(sanitize_title($provider), $selected_provider, true) . '>' . $provider . '</option>';
         }
         echo '</optgroup>';
     }
     echo '</select> ';
     woocommerce_wp_hidden_input(array('id' => 'wc_shipment_tracking_delete_nonce', 'value' => wp_create_nonce('delete-tracking-item')));
     woocommerce_wp_hidden_input(array('id' => 'wc_shipment_tracking_create_nonce', 'value' => wp_create_nonce('create-tracking-item')));
     woocommerce_wp_text_input(array('id' => 'custom_tracking_provider', 'label' => __('Provider Name:', 'wc_shipment_tracking'), 'placeholder' => '', 'description' => '', 'value' => ''));
     woocommerce_wp_text_input(array('id' => 'tracking_number', 'label' => __('Tracking number:', 'wc_shipment_tracking'), 'placeholder' => '', 'description' => '', 'value' => ''));
     woocommerce_wp_text_input(array('id' => 'custom_tracking_link', 'label' => __('Tracking link:', 'wc_shipment_tracking'), 'placeholder' => 'http://', 'description' => '', 'value' => ''));
     woocommerce_wp_text_input(array('id' => 'date_shipped', 'label' => __('Date shipped:', 'wc_shipment_tracking'), 'placeholder' => date_i18n(__('Y-m-d', 'wc_shipment_tracking'), time()), 'description' => '', 'class' => 'date-picker-field', 'value' => date_i18n(__('Y-m-d', 'wc_shipment_tracking'), current_time('timestamp'))));
     echo '<button class="button button-primary button-save-form">' . __('Save Tracking', 'wc_shipment_tracking') . '</button>';
     // Live preview
     echo '<p class="preview_tracking_link">' . __('Preview:', 'wc_shipment_tracking') . ' <a href="" target="_blank">' . __('Click here to track your shipment', 'wc_shipment_tracking') . '</a></p>';
     echo '</div>';
     $provider_array = array();
     foreach ($this->get_providers() as $providers) {
         foreach ($providers as $provider => $format) {
             $provider_array[sanitize_title($provider)] = urlencode($format);
         }
     }
     $js = "\n\t\t\tjQuery('p.custom_tracking_link_field, p.custom_tracking_provider_field').hide();\n\n\t\t\tjQuery('input#custom_tracking_link, input#tracking_number, #tracking_provider').change(function(){\n\n\t\t\t\tvar tracking = jQuery('input#tracking_number').val();\n\t\t\t\tvar provider = jQuery('#tracking_provider').val();\n\t\t\t\tvar providers = jQuery.parseJSON( '" . json_encode($provider_array) . "' );\n\n\t\t\t\tpostcode = jQuery('#_billing_postcode').val();\n\t\t\t\tpostcode = encodeURIComponent( postcode );\n\n\t\t\t\tvar link = '';\n\n\t\t\t\tif ( providers[ provider ] ) {\n\t\t\t\t\tlink = providers[provider];\n\t\t\t\t\tlink = link.replace( '%251%24s', tracking );\n\t\t\t\t\tlink = link.replace( '%252%24s', postcode );\n\t\t\t\t\tlink = decodeURIComponent( link );\n\n\t\t\t\t\tjQuery('p.custom_tracking_link_field, p.custom_tracking_provider_field').hide();\n\t\t\t\t} else {\n\t\t\t\t\tjQuery('p.custom_tracking_link_field, p.custom_tracking_provider_field').show();\n\n\t\t\t\t\tlink = jQuery('input#custom_tracking_link').val();\n\t\t\t\t}\n\n\t\t\t\tif ( link ) {\n\t\t\t\t\tjQuery('p.preview_tracking_link a').attr('href', link);\n\t\t\t\t\tjQuery('p.preview_tracking_link').show();\n\t\t\t\t} else {\n\t\t\t\t\tjQuery('p.preview_tracking_link').hide();\n\t\t\t\t}\n\n\t\t\t}).change();";
     if (function_exists('wc_enqueue_js')) {
         wc_enqueue_js($js);
     } else {
         $woocommerce->add_inline_js($js);
     }
     wp_enqueue_script('wc-shipment-tracking-js', plugins_url() . '/woocommerce-shipment-tracking/assets/js/admin.min.js');
 }
开发者ID:TakenCdosG,项目名称:chefs,代码行数:57,代码来源:class-wc-shipment-tracking.php


示例5: woo_vou_product_write_panel

    /**
     * WooCommerce custom product tab data
     *
     * Adds the panel to the Product Data postbox in the product interface
     *
     * @package WooCommerce - PDF Vouchers
     * @since   1.0.0
     */
    public function woo_vou_product_write_panel()
    {
        $prefix = WOO_VOU_META_PREFIX;
        global $current_user, $woo_vou_vendor_role;
        $voucher_options = array('' => __('Please Select', 'woovoucher'));
        $voucher_data = $this->model->woo_vou_get_vouchers();
        foreach ($voucher_data as $voucher) {
            if (isset($voucher['ID']) && !empty($voucher['ID'])) {
                // Check voucher id is not empty
                $voucher_options[$voucher['ID']] = $voucher['post_title'];
            }
        }
        $vendors_options = array('' => __('Please Select', 'woovoucher'));
        $vendors_data = get_users();
        if (!empty($vendors_data)) {
            // Check vendor users are not empty
            foreach ($vendors_data as $vendors) {
                if (user_can($vendors->ID, 'woo_vendor_options')) {
                    $vendors_options[$vendors->ID] = $vendors->display_name . ' (#' . $vendors->ID . ' &ndash; ' . sanitize_email($vendors->user_email) . ')';
                }
            }
        }
        $based_on_purchase_opt = array('7' => '7 Days', '15' => '15 Days', '30' => '1 Month (30 Days)', '90' => '3 Months (90 Days)', '180' => '6 Months (180 Days)', '365' => '1 Year (365 Days)', 'cust' => 'Custom');
        $using_type_opt = array('' => __('Default', 'woovoucher'), '0' => __('One time only', 'woovoucher'), '1' => __('Unlimited', 'woovoucher'));
        // Voucher Code Error
        $vou_codes_error_class = ' woo-vou-display-none ';
        $codes_error_msg = '<br/><span id="woo_vou_codes_error" class="woo-vou-codes-error ' . $vou_codes_error_class . '">' . __('Please enter atleast 1 voucher code.', 'woovoucher') . '</span>';
        $days_error_msg = '<span id="woo_vou_days_error" class="woo-vou-days-error ' . $vou_codes_error_class . '">' . __(' Please enter valid days.', 'woovoucher') . '</span>';
        $user_roles = isset($current_user->roles) ? $current_user->roles : array();
        $user_role = array_shift($user_roles);
        $vendor_flag = false;
        if (!empty($user_role) && in_array($user_role, $woo_vou_vendor_role)) {
            // Check vendor user role
            $vendor_flag = true;
        }
        $vou_hide_vendor_options = get_option('vou_hide_vendor_options');
        // display the custom tab panel
        echo '<div id="woo_vou_voucher" class="panel wc-metaboxes-wrapper woocommerce_options_panel">';
        //Enable Voucher Code
        $this->woo_vou_add_checkbox(array('id' => $prefix . 'enable', 'label' => __('Enable Voucher Codes:', 'woovoucher'), 'description' => __('To enable the Voucher for this Product check the "Enable Voucher Codes" check box.', 'woovoucher')));
        //Recipient Name Detail
        $this->woo_vou_add_checkbox(array('id' => $prefix . 'enable_recipient_name', 'label' => __('Enable Recipient Name:', 'woovoucher'), 'description' => __('To enable the Recipient Name on product page', 'woovoucher')));
        echo '<div class="recipient-detail-wrap">';
        $this->woo_vou_add_text(array('id' => $prefix . 'recipient_name_label', 'class' => 'woo_vou_recipient_text', 'wrap_class' => 'woo_vou_recipient_details', 'label' => __('Label:', 'woovoucher'), 'description' => __('', 'woovoucher') . $days_error_msg));
        $this->woo_vou_add_text(array('id' => $prefix . 'recipient_name_max_length', 'class' => 'woo_vou_recipient_text', 'wrap_class' => 'woo_vou_recipient_details', 'label' => __('Max Length:', 'woovoucher'), 'description' => __('', 'woovoucher') . $days_error_msg));
        $this->woo_vou_add_cust_checkbox(array('id' => $prefix . 'recipient_name_is_required', 'label' => __('Required:', 'woovoucher'), 'description' => __('Make this field required in order to add a voucher product to the cart', 'woovoucher')));
        echo '</div>';
        //Recipient Email Detail
        $this->woo_vou_add_checkbox(array('id' => $prefix . 'enable_recipient_email', 'label' => __('Enable Recipient Email:', 'woovoucher'), 'description' => __('To enable the Recipient Email on product page', 'woovoucher')));
        echo '<div class="recipient-detail-wrap">';
        $this->woo_vou_add_text(array('id' => $prefix . 'recipient_email_label', 'class' => 'woo_vou_recipient_text', 'wrap_class' => 'woo_vou_recipient_details', 'label' => __('Label:', 'woovoucher'), 'description' => __('', 'woovoucher') . $days_error_msg));
        $this->woo_vou_add_cust_checkbox(array('id' => $prefix . 'recipient_email_is_required', 'label' => __('Required:', 'woovoucher'), 'description' => __('Make this field required in order to add a voucher product to the cart', 'woovoucher')));
        echo '</div>';
        //Recipient Message Detail
        $this->woo_vou_add_checkbox(array('id' => $prefix . 'enable_recipient_message', 'label' => __('Enable Recipient Message:', 'woovoucher'), 'description' => __('To enable the Recipient Message on product page', 'woovoucher')));
        echo '<div class="recipient-detail-wrap">';
        $this->woo_vou_add_text(array('id' => $prefix . 'recipient_message_label', 'class' => 'woo_vou_recipient_text', 'wrap_class' => 'woo_vou_recipient_details', 'label' => __('Label:', 'woovoucher'), 'description' => __('', 'woovoucher')));
        $this->woo_vou_add_text(array('id' => $prefix . 'recipient_message_max_length', 'class' => 'woo_vou_recipient_text', 'wrap_class' => 'woo_vou_recipient_details', 'label' => __('Max Length:', 'woovoucher'), 'description' => __('', 'woovoucher')));
        $this->woo_vou_add_cust_checkbox(array('id' => $prefix . 'recipient_message_is_required', 'label' => __(' Required:', 'woovoucher'), 'description' => __('Make this field required in order to add a voucher product to the cart', 'woovoucher')));
        echo '</div>';
        // if user is vendor and hide options set
        if ($vendor_flag == true && $vou_hide_vendor_options == 'yes') {
        } else {
            //PDF Template
            woocommerce_wp_select(array('id' => $prefix . 'pdf_template', 'style' => 'min-width:200px;', 'class' => 'wc-enhanced-select', 'options' => $voucher_options, 'label' => __('PDF Template:', 'woovoucher'), 'description' => __('Select a PDF template. This setting modifies the global PDF template setting and overrides vendor\'s PDF template value. Leave it empty to use the global/vendor settings.', 'woovoucher')));
        }
        if ($vendor_flag == true) {
            // Check vendor user role
            woocommerce_wp_hidden_input(array('id' => $prefix . 'vendor_user', 'value' => $current_user->ID));
        } else {
            //Vendor User
            woocommerce_wp_select(array('id' => $prefix . 'vendor_user', 'style' => 'min-width:200px;', 'class' => 'wc-enhanced-select', 'options' => $vendors_options, 'label' => __('Vendor User:', 'woovoucher'), 'description' => __('Please select the vendor user.', 'woovoucher')));
        }
        if ($vendor_flag == true && $vou_hide_vendor_options == 'yes') {
        } else {
            //voucher's type to use it
            woocommerce_wp_select(array('id' => $prefix . 'using_type', 'style' => 'min-width:200px;', 'class' => 'wc-enhanced-select', 'options' => $using_type_opt, 'label' => __('Usability:', 'woovoucher'), 'description' => sprintf(__('Choose how you wanted to use vouchers codes. %sif you set usability "%sone time only%s" then it will automatically set product quantity equal to number of voucher codes entered and it will automatically decrease quanity  by 1 when it get purchased.
if you set usability "%sunlimited%s" then plugin will automatically generate unique voucher codes when product  purchased. %sThis setting modifies the global usability setting and overrides vendor\'s usability value. Leave it empty to use the global/vendor settings.', 'woovoucher'), '<br />', '<b>', '</b>', '<b>', '</b>', '<br />')));
        }
        //voucher's code comma seprated
        woocommerce_wp_textarea_input(array('id' => $prefix . 'codes', 'label' => __('Voucher Codes:', 'woovoucher'), 'description' => __('If you have a list of Voucher Codes you can copy and paste them in to this option. Make sure, that they are comma separated.', 'woovoucher') . $codes_error_msg));
        //import to csv field
        $this->woo_vou_add_importcsv(array('id' => $prefix . 'import_csv', 'btntext' => __('Generate / Import Codes', 'woovoucher'), 'label' => __('Generate / Import Codes:', 'woovoucher'), 'description' => __('Here you can import a csv file with voucher vodes or you can enter the prefix, pattern and extension will automatically create the voucher codes.', 'woovoucher')));
        //purchased voucher codes field
        $this->woo_vou_add_purchasedvoucodes(array('id' => $prefix . 'purchased_codes', 'btntext' => __('Purchased Voucher Codes', 'woovoucher'), 'label' => __('Purchased Voucher Code:', 'woovoucher'), 'description' => __('Click on the button to see a list of all purchased voucher vodes.', 'woovoucher')));
        //used voucher codes field
        $this->woo_vou_add_usedvoucodes(array('id' => $prefix . 'used_codes', 'btntext' => __('Used Voucher Codes', 'woovoucher'), 'label' => __('Used Voucher Code:', 'woovoucher'), 'description' => __('Click on the button to see a list of all used voucher vodes.', 'woovoucher')));
        //voucher expiration date type
        $expdate_types = apply_filters('woo_vou_exp_date_types', array('specific_date' => __('Specific Time', 'woovoucher'), 'based_on_purchase' => __('Based on purchase', 'woovoucher')));
        $this->woo_vou_add_radio(array('id' => $prefix . 'exp_type', 'options' => $expdate_types, 'default' => array('specific_date'), 'label' => __('Expiration Date Type:', 'woovoucher'), 'description' => __('Please select Expiration Date Type either specific time or set date based on purchased voucher date like After 7 days, 30 days, 1 year etc.', 'woovoucher')));
        //
        $this->woo_vou_add_select(array('id' => $prefix . 'days_diff', 'style' => 'min-width:200px;', 'class' => '_woo_vou_days_diff wc-enhanced-select', 'options' => $based_on_purchase_opt, 'label' => __('Expiration Days:', 'woovoucher'), 'description' => __('', 'woovoucher'), 'sign' => __(' After purchase', 'woovoucher')));
//.........这里部分代码省略.........
开发者ID:flasomm,项目名称:Montkailash,代码行数:101,代码来源:class-woo-vou-admin-meta.php


示例6: product_panel

 /**
  * Freshdesk tab panel.
  *
  * @since  1.0.0
  *
  * @return string Tab panel content.
  */
 public function product_panel()
 {
     global $post;
     // Forum category data.
     $forum = get_post_meta($post->ID, '_forum_category', true);
     $forum_enable = isset($forum['enable']) ? $forum['enable'] : '';
     $forum_title = isset($forum['title']) ? $forum['title'] : $post->post_title;
     $forum_description = isset($forum['description']) ? $forum['description'] : '';
     $forum_id = get_post_meta($post->ID, '_forum_category_id', true);
     // Solutions category data.
     $solutions = get_post_meta($post->ID, '_solutions_category', true);
     $solutions_enable = isset($solutions['enable']) ? $solutions['enable'] : '';
     $solutions_title = isset($solutions['title']) ? $solutions['title'] : $post->post_title;
     $solutions_description = isset($solutions['description']) ? $solutions['description'] : '';
     $solutions_id = get_post_meta($post->ID, '_solutions_category_id', true);
     wp_nonce_field(basename(__FILE__), 'woocommerce_freshdesk_nonce');
     echo '<div id="freshdesk_product_data" class="panel woocommerce_options_panel">';
     if ('sprout' != $this->plan) {
         echo '<div class="options_group">';
         echo '<h4>' . __('Forum Category', 'woocommerce-freshdesk') . '</h4>';
         if ('yes' != $forum_enable) {
             woocommerce_wp_select(array('id' => '_forum_category', 'label' => __('Add/get Category', 'woocommerce-freshdesk'), 'cbvalue' => 'yes', 'value' => '', 'desc_tip' => 'true', 'description' => __('Create or synchronize a Freshdesk Forum Category.', 'woocommerce-freshdesk'), 'options' => array('' => __('Select an option&hellip;', 'woocommerce-freshdesk'), 'create' => __('Create', 'woocommerce-freshdesk'), 'sync' => __('Synchronize', 'woocommerce-freshdesk'))));
             woocommerce_wp_text_input(array('id' => '_forum_category_id', 'label' => __('Category ID', 'woocommerce-freshdesk'), 'value' => esc_attr($forum_id), 'desc_tip' => 'true', 'description' => __('Enter the Forum Category ID to synchronize.', 'woocommerce-freshdesk')));
         } else {
             echo '<p class="category-id">' . __('Forum Category ID:', 'woocommerce-freshdesk') . ' <code>' . esc_attr($forum_id) . '</code></p>';
             woocommerce_wp_hidden_input(array('id' => '_forum_category_enable', 'value' => sanitize_text_field($forum_enable)));
             woocommerce_wp_checkbox(array('id' => '_forum_category_delete', 'label' => __('Remove Relationship?', 'woocommerce-freshdesk'), 'cbvalue' => 'yes', 'value' => '', 'description' => __('This option remove the synchronization with this Forum Category and your Freshdesk.', 'woocommerce-freshdesk')));
         }
         woocommerce_wp_text_input(array('id' => '_forum_category_title', 'label' => __('Category Title', 'woocommerce-freshdesk'), 'value' => sanitize_text_field($forum_title), 'desc_tip' => 'true', 'description' => __('Enter with the Forum Category title.', 'woocommerce-freshdesk')));
         woocommerce_wp_textarea_input(array('id' => '_forum_category_description', 'label' => __('Category Description', 'woocommerce-freshdesk'), 'value' => esc_attr($forum_description), 'desc_tip' => 'true', 'description' => __('Enter with the Forum Category description.', 'woocommerce-freshdesk')));
         echo '</div>';
     }
     echo '<div class="options_group">';
     echo '<h4>' . __('Solution Category', 'woocommerce-freshdesk') . '</h4>';
     if ('yes' != $solutions_enable) {
         woocommerce_wp_select(array('id' => '_solutions_category', 'label' => __('Add/get Category', 'woocommerce-freshdesk'), 'cbvalue' => 'yes', 'value' => '', 'desc_tip' => 'true', 'description' => __('Create or synchronize a Freshdesk Solutions Category.', 'woocommerce-freshdesk'), 'options' => array('' => __('Select an option&hellip;', 'woocommerce-freshdesk'), 'create' => __('Create', 'woocommerce-freshdesk'), 'sync' => __('Synchronize', 'woocommerce-freshdesk'))));
         woocommerce_wp_text_input(array('id' => '_solutions_category_id', 'label' => __('Category ID', 'woocommerce-freshdesk'), 'value' => esc_attr($solutions_id), 'desc_tip' => 'true', 'description' => __('Enter the Solutions Category ID to synchronize.', 'woocommerce-freshdesk')));
     } else {
         echo '<p class="category-id">' . __('Solution Category ID:', 'woocommerce-freshdesk') . ' <code>' . esc_attr($solutions_id) . '</code></p>';
         woocommerce_wp_hidden_input(array('id' => '_solutions_category_enable', 'value' => sanitize_text_field($solutions_enable)));
         woocommerce_wp_checkbox(array('id' => '_solutions_category_delete', 'label' => __('Remove Relationship?', 'woocommerce-freshdesk'), 'cbvalue' => 'yes', 'value' => '', 'description' => __('This option remove the synchronization with this Solutions Category and your Freshdesk.', 'woocommerce-freshdesk')));
     }
     woocommerce_wp_text_input(array('id' => '_solutions_category_title', 'label' => __('Category Title', 'woocommerce-freshdesk'), 'value' => sanitize_text_field($solutions_title), 'desc_tip' => 'true', 'description' => __('Enter with the Solutions Category title.', 'woocommerce-freshdesk')));
     woocommerce_wp_textarea_input(array('id' => '_solutions_category_description', 'label' => __('Category Description', 'woocommerce-freshdesk'), 'value' => esc_attr($solutions_description), 'desc_tip' => 'true', 'description' => __('Enter with the Solutions Category description.', 'woocommerce-freshdesk')));
     echo '</div>';
     echo '</div>';
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:54,代码来源:class-wc-freshdesk-integration.php


示例7: woocommerce_product_data_box


//.........这里部分代码省略.........
    ?>
' src="<?php 
    echo $woocommerce->plugin_url();
    ?>
/assets/images/help.png" height="16" width="16" /></p>

			<p class="form-field"><label for="crosssell_ids"><?php 
    _e('Cross-Sells', 'woocommerce');
    ?>
</label>
			<select id="crosssell_ids" name="crosssell_ids[]" class="ajax_chosen_select_products" multiple="multiple" data-placeholder="<?php 
    _e('Search for a product&hellip;', 'woocommerce');
    ?>
">
				<?php 
    $crosssell_ids = get_post_meta($post->ID, '_crosssell_ids', true);
    $product_ids = !empty($crosssell_ids) ? array_map('absint', $crosssell_ids) : null;
    if ($product_ids) {
        foreach ($product_ids as $product_id) {
            $product = get_product($product_id);
            $product_name = woocommerce_get_formatted_product_name($product);
            if ($product) {
                echo '<option value="' . esc_attr($product_id) . '" selected="selected">' . esc_html($product_name) . '</option>';
            }
        }
    }
    ?>

			</select> <img class="help_tip" data-tip='<?php 
    _e('Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce');
    ?>
' src="<?php 
    echo $woocommerce->plugin_url();
    ?>
/assets/images/help.png" height="16" width="16" /></p>

			</div>

			<?php 
    echo '<div class="options_group grouping show_if_simple show_if_external">';
    // List Grouped products
    $post_parents = array();
    $post_parents[''] = __('Choose a grouped product&hellip;', 'woocommerce');
    $posts_in = array_unique((array) get_objects_in_term(get_term_by('slug', 'grouped', 'product_type')->term_id, 'product_type'));
    if (sizeof($posts_in) > 0) {
        $args = array('post_type' => 'product', 'post_status' => 'any', 'numberposts' => -1, 'orderby' => 'title', 'order' => 'asc', 'post_parent' => 0, 'include' => $posts_in);
        $grouped_products = get_posts($args);
        if ($grouped_products) {
            foreach ($grouped_products as $product) {
                if ($product->ID == $post->ID) {
                    continue;
                }
                $post_parents[$product->ID] = $product->post_title;
            }
        }
    }
    woocommerce_wp_select(array('id' => 'parent_id', 'label' => __('Grouping', 'woocommerce'), 'value' => absint($post->post_parent), 'options' => $post_parents, 'desc_tip' => true, 'description' => __('Set this option to make this product part of a grouped product.', 'woocommerce')));
    woocommerce_wp_hidden_input(array('id' => 'previous_parent_id', 'value' => absint($post->post_parent)));
    do_action('woocommerce_product_options_grouping');
    echo '</div>';
    ?>


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


		</div>

		<div id="advanced_product_data" class="panel woocommerce_options_panel">

			<?php 
    echo '<div class="options_group hide_if_external">';
    // Purchase note
    woocommerce_wp_textarea_input(array('id' => '_purchase_note', 'label' => __('Purchase Note', 'woocommerce'), 'description' => __('Enter an optional note to send the customer after purchase.', 'woocommerce')));
    echo '</div>';
    echo '<div class="options_group">';
    // menu_order
    woocommerce_wp_text_input(array('id' => 'menu_order', 'label' => __('Menu order', 'woocommerce'), 'description' => __('Custom ordering position.', 'woocommerce'), 'value' => intval($post->menu_order), 'type' => 'number', 'custom_attributes' => array('step' => '1')));
    echo '</div>';
    echo '<div class="options_group reviews">';
    woocommerce_wp_checkbox(array('id' => 'comment_status', 'label' => __('Enable reviews', 'woocommerce'), 'cbvalue' => 'open', 'value' => esc_attr($post->comment_status)));
    do_action('woocommerce_product_options_reviews');
    echo '</div>';
    ?>


		</div>

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


		<div class="clear"></div>

	</div>
	<?php 
}
开发者ID:joshquila,项目名称:demo2-youse,代码行数:101,代码来源:writepanel-product_data.php


示例8: bf_wc_product_linked

function bf_wc_product_linked($thepostid, $customfield)
{
    global $post;
    ?>


<div id="linked_product_data">

    <div class="options_group">

        <?php 
    if (!isset($customfield['product_up_sales'])) {
        ?>
            <p class="form-field"><label for="upsell_ids"><?php 
        _e('Up-Sells', 'woocommerce');
        ?>
</label>
                <input type="hidden" class="wc-product-search" style="width: 50%;" id="upsell_ids" name="upsell_ids" data-placeholder="<?php 
        _e('Search for a product&hellip;', 'woocommerce');
        ?>
" data-action="woocommerce_json_search_products_and_variations" data-multiple="true" data-selected="<?php 
        $product_ids = array_filter(array_map('absint', (array) get_post_meta($post->ID, '_upsell_ids', true)));
        $json_ids = array();
        foreach ($product_ids as $product_id) {
            $product = wc_get_product($product_id);
            $json_ids[$product_id] = wp_kses_post($product->get_formatted_name());
        }
        echo esc_attr(json_encode($json_ids));
        ?>
" value="<?php 
        echo implode(',', array_keys($json_ids));
        ?>
" /> <img class="help_tip" data-tip='<?php 
        _e('Up-sells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive.', 'woocommerce');
        ?>
' src="<?php 
        echo WC()->plugin_url();
        ?>
/assets/images/help.png" height="16" width="16" /></p>
        <?php 
    }
    ?>

        <?php 
    if (!isset($customfield['product_cross_sales'])) {
        ?>
            <p class="form-field"><label for="crosssell_ids"><?php 
        _e('Cross-Sells', 'woocommerce');
        ?>
</label>
                <input type="hidden" class="wc-product-search" style="width: 50%;" id="crosssell_ids" name="crosssell_ids" data-placeholder="<?php 
        _e('Search for a product&hellip;', 'woocommerce');
        ?>
" data-action="woocommerce_json_search_products_and_variations" data-multiple="true" data-selected="<?php 
        $product_ids = array_filter(array_map('absint', (array) get_post_meta($post->ID, '_crosssell_ids', true)));
        $json_ids = array();
        foreach ($product_ids as $product_id) {
            $product = wc_get_product($product_id);
            $json_ids[$product_id] = wp_kses_post($product->get_formatted_name());
        }
        echo esc_attr(json_encode($json_ids));
        ?>
" value="<?php 
        echo implode(',', array_keys($json_ids));
        ?>
" /> <img class="help_tip" data-tip='<?php 
        _e('Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce');
        ?>
' src="<?php 
        echo WC()->plugin_url();
        ?>
/assets/images/help.png" height="16" width="16" /></p>
        <?php 
    }
    ?>
         </div>

    <?php 
    echo '<div class="options_group grouping show_if_simple show_if_external">';
    // List Grouped products
    $post_parents = array();
    $post_parents[''] = __('Choose a grouped product&hellip;', 'woocommerce');
    if ($grouped_term = get_term_by('slug', 'grouped', 'product_type')) {
        $posts_in = array_unique((array) get_objects_in_term($grouped_term->term_id, 'product_type'));
        if (sizeof($posts_in) > 0) {
            $args = array('post_type' => 'product', 'post_status' => 'any', 'numberposts' => -1, 'orderby' => 'title', 'order' => 'asc', 'post_parent' => 0, 'suppress_filters' => 0, 'include' => $posts_in);
            $grouped_products = get_posts($args);
            if ($grouped_products) {
                foreach ($grouped_products as $product) {
                    if ($product->ID == $thepostid) {
                        continue;
                    }
                    $post_parents[$product->ID] = $product->post_title;
                }
            }
        }
    }
    if (!isset($customfield['product_grouping'])) {
        woocommerce_wp_select(array('id' => 'parent_id', 'label' => __('Grouping', 'woocommerce') . '<br>', 'value' => absint($post->post_parent), 'options' => $post_parents, 'desc_tip' => true, 'description' => __('Set this option to make this product part of a grouped product.', 'woocommerce')));
        woocommerce_wp_hidden_input(array('id' => 'previous_parent_id', 'value' => absint($post->post_parent)));
//.........这里部分代码省略.........
开发者ID:Kemitestech,项目名称:WordPress-Skeleton,代码行数:101,代码来源:bf-wc-product-linked.php


示例9: _e

?>
	<div class="options_group ml_required_fields">
		<p class="form-field ml_category_id_field">
			<label for="ml_category_id"><?php 
_e('Category', $textdomain);
?>
</label>
			<?php 
if ($ml_product->is_published()) {
    printf('<a href="%s" target="_blank">%s</a>', $ml_product->permalink, implode(' > ', wp_list_pluck(ML_Category::get_category_path($ml_product->category_id), 'name')));
    $variations = ML_Category::get_category_variations($ml_product->category_id);
    if (!empty($variations)) {
        include_once 'html-variations.php';
    }
} else {
    woocommerce_wp_hidden_input(array('id' => 'ml_category_id', 'value' => $ml_product->category_id));
}
?>
		</p>
	</div>
	<div class="options_group">
		<?php 
if (!empty(ML()->ml_official_stores)) {
    woocommerce_wp_select(array('id' => 'ml_official_store_id', 'label' => __('Official Store', $textdomain), 'description' => __('Determines which official store the product will be posted', $textdomain), 'desc_tip' => true, 'options' => ML()->ml_official_stores, 'value' => isset($_POST['ml_official_store_id']) ? $_POST['ml_official_store_id'] : $ml_product->official_store_id, 'custom_attributes' => $ml_product->is_published() ? array('disabled' => 'disabled') : array()));
}
//Modifiable with conditions
woocommerce_wp_select(array('id' => 'ml_listing_type_id', 'label' => __('Listing Type', $textdomain), 'description' => __('Determines how your product will be listed on MercadoLivre', $textdomain), 'desc_tip' => true, 'options' => wp_list_pluck(ML()->ml_communication->get_listing_types(), 'name', 'id'), 'value' => isset($_POST['ml_listing_type_id']) ? $_POST['ml_listing_type_id'] : $ml_product->listing_type_id));
?>
	</div>
	<div class="options_group">
		<?php 
开发者ID:agenciamagma,项目名称:woocommerce-mercadolivre,代码行数:31,代码来源:html-product-tab.php


示例10: display_field_options

 public static function display_field_options($fieldoptions)
 {
     global $woocommerce, $post;
     foreach ($fieldoptions as $key => $fields) {
         if (isset($fields['type'])) {
             switch ($fields['type']) {
                 case 'select':
                     if ($result = get_post_meta($post->ID, $fields['id'], true)) {
                         $fields['value'] = $result;
                     }
                     woocommerce_wp_select($fields);
                     break;
                 case 'checkbox':
                     if ($result = get_post_meta($post->ID, $fields['id'], true)) {
                         $fields['value'] = $result;
                     }
                     woocommerce_wp_checkbox($fields);
                     break;
                 case 'radio':
                     if ($result = get_post_meta($post->ID, $fields['id'], true)) {
                         $fields['value'] = $result;
                     }
                     woocommerce_wp_radio($fields);
                     break;
                 case 'hidden':
                     if ($result = get_post_meta($post->ID, $fields['id'], true)) {
                         $fields['value'] = $result;
                     }
                     woocommerce_wp_hidden_input($fields);
                     break;
                 case 'number':
                 case 'text':
                     if ($result = get_post_meta($post->ID, $fields['id'], true)) {
                         $fields['value'] = $result;
                     }
                     woocommerce_wp_text_input($fields);
                     break;
                 case 'textarea':
                     if ($result = get_post_meta($post->ID, $fields['id'], true)) {
                         $fields['value'] = $result;
                     }
                     woocommerce_wp_textarea_input($fields);
                     break;
             }
         }
     }
 }
开发者ID:arifur,项目名称:woocommerce-pay-what-you-want,代码行数:47,代码来源:woocommerce-pay-what-you-want.php


示例11: bf_wc_product_inventory

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP woocommerce_wp_select函数代码示例发布时间:2022-05-23
下一篇:
PHP woocommerce_wp_checkbox函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap