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

PHP woocommerce_wp_text_input函数代码示例

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

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



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

示例1: wpuw_add_custom_general_fields

function wpuw_add_custom_general_fields()
{
    global $woocommerce, $post;
    $terms = wp_get_post_terms($post->ID, 'product_cat');
    foreach ($terms as $term) {
        $categories[] = $term->slug;
    }
    if (!empty($categories) && in_array('credit', $categories)) {
        echo '<div class="options_group">';
        woocommerce_wp_text_input(array('id' => '_credits_amount', 'label' => __('Credit Amount (' . get_woocommerce_currency_symbol() . ')', 'woocommerce'), 'placeholder' => '0.00', 'desc_tip' => 'true', 'description' => __('The amount of credits for this product in currency format.', 'woocommerce'), 'type' => 'number', 'custom_attributes' => array('step' => 'any', 'min' => '0')));
        echo '</div>';
    }
}
开发者ID:justingreerbbi,项目名称:user-waller-credit-system,代码行数:13,代码来源:functions.php


示例2: add_vendor_field

 public function add_vendor_field()
 {
     global $woocommerce, $post;
     echo '<div class="options_group">';
     woocommerce_wp_text_input(array('id' => '_vendor', 'label' => 'Производитель', 'placeholder' => '', 'description' => 'Если не заполенено, то не учавствует в выгрузке маркета', 'type' => 'text'));
     echo '</div>';
 }
开发者ID:KuzyT,项目名称:woo-export-yml,代码行数:7,代码来源:woo-export-yml.php


示例3: add_est_simple_field

 public function add_est_simple_field($post_id)
 {
     global $post, $thepostid, $product;
     $thepostid = $post->ID;
     $product = wc_get_product($thepostid);
     $get_value = 'eddwc_get_';
     $get_value .= $product->get_type();
     echo '<div class="options_group show_if_simple hide_if_external show_if_variable">';
     $type = eddwc_option('display_type');
     $field_type = 'number';
     $fieldClass = '';
     $custom_attributes = '';
     $value = $get_value($thepostid);
     if ($type == 'general_date') {
         $field_type = 'hidden';
         $custom_attributes = array('date-type' => 'range_select');
     } else {
         if ($value != '') {
             $value = explode(',', $value);
             if (isset($value[0]) && isset($value[1]) && $value[0] > $value[1]) {
                 $value = $value[0];
             } else {
                 if (isset($value[0]) && !isset($value[1])) {
                     $value = $value[0];
                 } else {
                     $value = $value[1];
                 }
             }
         }
     }
     woocommerce_wp_text_input(array('id' => EDDWCP_METAKEY, 'label' => __('Est. Dispatch Date:', EDDWC_TXT), 'placeholder' => __('number', EDDWC_TXT), 'type' => $field_type, 'wrapper_class' => $fieldClass, 'value' => $value, 'custom_attributes' => $custom_attributes));
     echo '</div>';
 }
开发者ID:technofreaky,项目名称:estimated-dispatch-date-woocommerce,代码行数:33,代码来源:class-admin-product-settings.php


示例4: output

    public static function output()
    {
        global $post, $thepostid;
        $thepostid = $post->ID;
        $_product = wc_get_product($thepostid);
        $terms = array();
        $delivery_time = $_product->gzd_product->delivery_time;
        woocommerce_wp_select(array('id' => '_unit', 'label' => __('Unit', 'woocommerce-germanized'), 'options' => array_merge(array('none' => __('Select unit', 'woocommerce-germanized')), WC_germanized()->units->get_units()), 'desc_tip' => true, 'description' => __('Needed if selling on a per unit basis', 'woocommerce-germanized')));
        woocommerce_wp_text_input(array('id' => '_unit_base', 'label' => __('Unit Base', 'woocommerce-germanized'), 'data_type' => 'decimal', 'desc_tip' => true, 'description' => __('Unit price per amount (e.g. 100)', 'woocommerce-germanized')));
        woocommerce_wp_text_input(array('id' => '_unit_price_regular', 'label' => __('Regular Unit Price', 'woocommerce-germanized') . ' (' . get_woocommerce_currency_symbol() . ')', 'data_type' => 'price'));
        woocommerce_wp_text_input(array('id' => '_unit_price_sale', 'label' => __('Sale Unit Price', 'woocommerce-germanized') . ' (' . get_woocommerce_currency_symbol() . ')', 'data_type' => 'price'));
        if (version_compare(WC()->version, '2.3', '<')) {
            return;
        }
        ?>
		
		<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&hellip;', '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 
    }
开发者ID:radscheit,项目名称:unicorn,代码行数:35,代码来源:class-wc-gzd-meta-box-product-data.php


示例5: variable_fields

/**
 * Create new fields for variations
 *
*/
function variable_fields($loop, $variation_data, $variation)
{
    global $post;
    if (!$post) {
        $post = get_post($variation->ID);
    }
    ?>
	<tr>
		<td>
		</br>
			<?php 
    //$_pg_field = $variation_data['_pg_field'][0]
    $variation_id = $variation->ID;
    $_pg_field = get_post_meta($variation_id, '_pg_field', true);
    /*
    echo "</br>"; 
    var_dump($variation_data); 
    echo "</br>";
    echo "</br>";
    var_dump($variation); 
    echo "</br>";
    echo "</br>";
    var_dump($_pg_field); 
    echo "</br>";
    echo "</br>"."_pg_field : ". $_pg_field ."</br>";
    echo "</br>";
    */
    woocommerce_wp_text_input(array('id' => '_pg_field[' . $loop . ']', 'label' => __('Product Generator Data', 'woocommerce'), 'placeholder' => 'angle="33" lux="100" luxD="100" minD="100" maxD="500"', 'desc_tip' => 'true', 'description' => __('Enter the Product Generator Data here.', 'woocommerce'), 'value' => $_pg_field));
    ?>
		</td>
	</tr>
    
    <?php 
}
开发者ID:TheDraguun,项目名称:julitewoo,代码行数:38,代码来源:functions.php


示例6: woo_add_custom_general_fields

 /**
  * Add custom fields to Product General Tab.
  *
  * @subpackage	Product
  */
 function woo_add_custom_general_fields()
 {
     global $woocommerce, $post;
     echo '<div class="options_group">';
     echo '<h2>Book Details</h2>';
     woocommerce_wp_text_input(array('id' => '_amazon_link', 'label' => __('Amazon Link', 'woocommerce'), 'placeholder' => 'Amazon link', 'desc_tip' => true, 'description' => __('Enter Amazon link here.', 'woocommerce')));
     woocommerce_wp_text_input(array('id' => '_isbn', 'label' => __('ISBN', 'woocommerce'), 'placeholder' => 'ISBN', 'desc_tip' => true, 'description' => __('Enter ISBN here.', 'woocommerce')));
     woocommerce_wp_text_input(array('id' => '_number_of_pages', 'label' => __('No of Pages', 'woocommerce'), 'placeholder' => 'No of pages', 'desc_tip' => true, 'description' => __('Enter number of pages here.', 'woocommerce')));
     woocommerce_wp_select(array('id' => '_book_format', 'label' => __('Book Format', 'woocommerce'), 'desc_tip' => true, 'description' => __('Select Book Format.', 'woocommerce'), 'options' => array('paperback' => __('Paperback', 'woocommerce'), 'hardcover' => __('Hardcover', 'woocommerce'), 'ebook' => __('eBook', 'woocommerce'))));
     woocommerce_wp_select(array('id' => '_print_type', 'label' => __('Print Type', 'woocommerce'), 'desc_tip' => true, 'description' => __('Select Print Type.', 'woocommerce'), 'options' => array('colour' => __('Colour', 'woocommerce'), 'black' => __('Black & White', 'woocommerce'))));
     echo '</div>';
 }
开发者ID:rajraj,项目名称:lotus-2016,代码行数:17,代码来源:wc-custom-functions.php


示例7: rf_meta_box

/**
 * Creates the Referfriend Meta Box in the admin control panel when in the Giftcard Post Type.  Allows you to create a giftcard manually.
 * @param  [type] $post
 * @return [type]
 */
function rf_meta_box($post)
{
    global $woocommerce;
    wp_nonce_field('woocommerce_save_data', 'woocommerce_meta_nonce');
    ?>
	<style type="text/css">
		#edit-slug-box, #minor-publishing-actions { display:none }

		.form-field input, .form-field textarea { width:100%;}

		input[type="checkbox"], input[type="radio"] { float: left; width:16px;}
	</style>

	<div class="panel woocommerce_options_panel">
	<?php 
    woocommerce_wp_select(array('id' => 'rf_coupon_type', 'label' => __('Coupon Type', 'mg_referfriend'), 'placeholder' => '', 'description' => __('Coupon Type', 'mg_referfriend'), 'options' => wc_get_coupon_types()));
    woocommerce_wp_text_input(array('id' => 'rf_coupon_amount', 'label' => __('Coupon Amount', 'mg_referfriend'), 'placeholder' => '', 'description' => __('Coupon Amount', 'mg_referfriend'), 'type' => 'number', 'custom_attributes' => array('step' => 'any', 'min' => '0')));
    woocommerce_wp_select(array('id' => 'rf_type', 'label' => __('Type', 'mg_referfriend'), 'placeholder' => '', 'options' => array('' => '', '1' => 'Refered by Email', '2' => 'Refered by share link')));
    // Description
    woocommerce_wp_textarea_input(array('id' => 'rf_description', 'label' => __('Description', 'rpgiftcards'), 'placeholder' => '', 'description' => __('Description', 'rpgiftcards')));
    woocommerce_wp_text_input(array('id' => 'rf_product_id', 'label' => __('Product IDs', 'mg_referfriend'), 'placeholder' => '', 'description' => __('Product IDs', 'mg_referfriend'), 'type' => 'number'));
    woocommerce_wp_text_input(array('id' => 'rf_usage', 'label' => __('Usage', 'mg_referfriend'), 'placeholder' => '', 'description' => __('Usage', 'mg_referfriend')));
    woocommerce_wp_text_input(array('id' => 'rf_limit', 'label' => __('Limit', 'mg_referfriend'), 'placeholder' => '', 'description' => __('Limit', 'mg_referfriend')));
    woocommerce_wp_text_input(array('id' => 'rf_expiry_date', 'label' => __('Expiry Date', 'mg_referfriend'), 'placeholder' => '', 'description' => __('Expiry Date', 'mg_referfriend')));
    echo '</div>';
}
开发者ID:javolero,项目名称:dabba,代码行数:31,代码来源:referfriend-metabox.php


示例8: woo_add_button_text_field

/**
 * Add the custom field to the Edit Product page 
 */
function woo_add_button_text_field()
{
    echo '<div class="options_group">';
    // Custom fields will be created here...
    woocommerce_wp_text_input(array('id' => 'custom-add-to-cart-text', 'label' => __('Custom Add to Cart Text', 'woocommerce'), 'placeholder' => 'Add to Cart', 'desc_tip' => 'true', 'description' => __('Enter any text here that will override the original Add to Cart button text.', 'woocommerce')));
    echo '</div>';
}
开发者ID:WPprodigy,项目名称:Custom-WooCommerce-Add-to-Cart,代码行数:10,代码来源:custom-woocommerce-add-to-cart.php


示例9: 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


示例10: add_video_field

 /**
  * Add the field in the product data box
  */
 public function add_video_field()
 {
     echo '<div class="options_group">';
     // Expirey
     woocommerce_wp_text_input(array('id' => '_video_url', 'label' => __('Featured Video URL', 'yit'), 'placeholder' => __('Video URL', 'yit'), 'desc_tip' => true, 'description' => sprintf(__('Enter the URL for the video you want to show in place of the featured image in the product detail page. (the services enabled are: %s).', 'yit'), implode(', ', $this->services))));
     echo '</div>';
 }
开发者ID:shahadat014,项目名称:geleyi,代码行数:10,代码来源:class.yith-woo-featured-video-admin.php


示例11: 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


示例12: variable_fields_js

/**
 * Create new fields for new variations
 *
*/
function variable_fields_js()
{
    ?>
	<tr>
		<td>
			<?php 
    // Text Field
    woocommerce_wp_text_input(array('id' => '_retailer_price[ + loop + ]', 'label' => __('Retailer Price', 'woocommerce'), 'placeholder' => '0', 'data_type' => 'price', 'wrapper_class' => 'form-row form-row-first', 'value' => ''));
    ?>
		</td>
	</tr>
	<tr>
		<td>
			<?php 
    // Text Field
    woocommerce_wp_text_input(array('id' => '_retailer_price_sale[ + loop + ]', 'label' => __('Retailer Sale Price', 'woocommerce'), 'placeholder' => '0', 'data_type' => 'price', 'wrapper_class' => 'form-row form-row-last', 'value' => ''));
    ?>
		</td>
	</tr>
	<tr>
		<td>
			<?php 
    // Number Field
    woocommerce_wp_text_input(array('id' => '_minimum_quantity[ + loop + ]', 'label' => __('Minimum Quantity for Retailer', 'woocommerce'), 'desc_tip' => 'true', 'description' => __('Enter the custom number here.', 'woocommerce'), 'value' => '', 'custom_attributes' => array('step' => 'any', 'min' => '1')));
    ?>
		</td>
	</tr>
<?php 
}
开发者ID:neogenesis,项目名称:wordpress-code,代码行数:33,代码来源:woocommerce-custom-fields.php


示例13: add_field_funkwoocost

 public function add_field_funkwoocost()
 {
     global $woocommerce, $post;
     echo '<div class="options_group">';
     woocommerce_wp_text_input(array('id' => '_funkwoocost', 'label' => sprintf(__('Product Cost (%s)', 'funkwoocost'), get_woocommerce_currency_symbol()), 'placeholder' => '', 'description' => __('Add product cost for profit report.', 'funkwoocost'), 'type' => 'number'));
     echo '</div>';
 }
开发者ID:qutek,项目名称:Woocommerce-Product-Costs,代码行数:7,代码来源:admin.class.php


示例14: render_simple_product_fields

 /**
  * Render simple product points earned / maximum discount fields
  *
  * @since 1.0
  */
 public function render_simple_product_fields()
 {
     // points earned
     woocommerce_wp_text_input(array('id' => '_wc_points_earned', 'wrapper_class' => 'show_if_simple', 'class' => 'short', 'label' => __('Points Earned', 'wc_points_rewards'), 'description' => __('This can be either a fixed number of points earned for purchasing this product, or a percentage which assigns points based on the price. For example, if you want to award points equal to double the normal rate, enter 200%.  This setting modifies the global Points Conversion Rate and overrides any category value.  Use 0 to assign no points for this product, and empty to use the global/category settings.', 'wc_points_rewards'), 'desc_tip' => true, 'type' => 'text'));
     // maximum discount allowed on product
     woocommerce_wp_text_input(array('id' => '_wc_points_max_discount', 'class' => 'short', 'wrapper_class' => 'show_if_simple', 'label' => __('Maximum Points Discount', 'wc_points_rewards'), 'description' => __('Enter either a fixed maximum discount amount or percentage which restricts the amount of points that can be redeemed for a discount based on the product price. For example, if you want to restrict the discount on this product to a maximum of 50%, enter 50%, or enter 5 to restrict the maximum discount to $5.  This setting overrides the global/category defaults, use 0 to disable point discounts for this product, and blank to use the global/category default.', 'wc_points_rewards'), 'desc_tip' => true, 'type' => 'text'));
 }
开发者ID:chhavinav,项目名称:fr.ilovejuice,代码行数:12,代码来源:class-wc-points-rewards-product-admin.php


示例15: woo_add_custom_wholesale_price_fields

function woo_add_custom_wholesale_price_fields()
{
    global $woocommerce, $post;
    echo '<div class="options_group">';
    woocommerce_wp_text_input(array('id' => '_wholesale_price', 'label' => __('Wholesale Price (' . get_woocommerce_currency_symbol() . ')', 'woocommerce'), 'desc_tip' => 'true', 'description' => __('Price will be applicable only for wholesale customers', 'woocommerce')));
    echo '</div>';
}
开发者ID:swapnilghone,项目名称:WP-codesnippets,代码行数:7,代码来源:addNewProductOptionWooCommerce.php


示例16: awspn_add_custom_general_field

 /**
  * Adding price note options on WooCommerce single product general section.
  *
  * @return void
  */
 public static function awspn_add_custom_general_field()
 {
     echo '<div class="options_group">';
     // Product per note separator
     woocommerce_wp_text_input(array('id' => 'awspn_product_price_note_separator', 'label' => __('Note Separator', 'woo-set-price-note'), 'placeholder' => '/', 'desc_tip' => 'true', 'description' => __('Enter separator between price and note, like, "/", "-", "per", etc', 'woo-set-price-note')));
     // Product per note text
     woocommerce_wp_text_input(array('id' => 'awspn_product_price_note', 'label' => __('Price Note', 'woo-set-price-note'), 'placeholder' => 'Piece', 'desc_tip' => 'true', 'description' => __('Enter price note that you want to display with product price, like, Offer, Unit, Edition, etc.', 'woo-set-price-note')));
     echo '</div>';
 }
开发者ID:shshanker,项目名称:woo-set-price-note,代码行数:14,代码来源:awspn-backend.php


示例17: min_max_count_admin_option

    /**
     * Admin min/max settings display / save.
     */
    public static function min_max_count_admin_option()
    {
        ?>
<div class="options_group"><?php 
        woocommerce_wp_text_input(array('id' => '_wcpb_min_qty_limit', 'type' => 'number', 'label' => __('Min Items', 'woocommerce'), 'desc_tip' => 'false', 'description' => __('Minimum allowed quantity of items in the bundle.', 'woocommerce-product-bundles-min-max-items')));
        woocommerce_wp_text_input(array('id' => '_wcpb_max_qty_limit', 'type' => 'number', 'label' => __('Max Items', 'woocommerce'), 'desc_tip' => 'false', 'description' => __('Maximum allowed quantity of items in the bundle.', 'woocommerce-product-bundles-min-max-items')));
        ?>
</div><?php 
    }
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:12,代码来源:woocommerce-product-bundles-min-max-items.php


示例18: 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


示例19: woo_add_custom_general_fields

function woo_add_custom_general_fields()
{
    global $woocommerce, $post;
    echo '<div id="thong_tin_hoa_chat" class="panel woocommerce_options_panel"><div class="options_group">';
    woocommerce_wp_text_input(array('id' => '_ten_hoa_hoc_field', 'label' => __('Tển hoá học', 'woocommerce'), 'placeholder' => 'Calcium Hypochlorite', 'desc_tip' => 'true', 'description' => __('Enter the custom value here.', 'woocommerce')));
    woocommerce_wp_textarea_input(array('id' => '_ten_goi_khac_field', 'label' => __('Các tên gọi khác', 'woocommerce'), 'placeholder' => 'Tên gọi 1, Tên gọi 2, Tên gọi 3', 'desc_tip' => 'true', 'description' => __('Enter the custom value here.', 'woocommerce')));
    woocommerce_wp_text_input(array('id' => '_cong_thuc_hoa_hoc_field', 'label' => __('Công thức hoá học', 'woocommerce'), 'placeholder' => 'Ca(OCl)2', 'desc_tip' => 'true', 'description' => __('Enter the custom value here.', 'woocommerce')));
    woocommerce_wp_text_input(array('id' => '_ham_luong_hoa_chat_field', 'label' => __('Hàm lượng hoá chất', 'woocommerce'), 'placeholder' => '%', 'desc_tip' => 'true', 'description' => __('Enter the custom value here.', 'woocommerce')));
    woocommerce_wp_text_input(array('id' => '_xuat_xu_field', 'label' => __('Xuất xứ', 'woocommerce'), 'placeholder' => '', 'desc_tip' => 'true', 'description' => __('Enter the custom value here.', 'woocommerce')));
    woocommerce_wp_text_input(array('id' => '_dong_goi_field', 'label' => __('Đóng gói', 'woocommerce'), 'placeholder' => 'Kg/1thùng', 'desc_tip' => 'true', 'description' => __('Enter the custom value here.', 'woocommerce')));
    echo '</div></div>';
}
开发者ID:bachhuong,项目名称:dains-development,代码行数:12,代码来源:functions_custom.php


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP woocommerce_wp_textarea_input函数代码示例发布时间:2022-05-23
下一篇:
PHP woocommerce_wp_select函数代码示例发布时间: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