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


PHP woocommerce_wp_text_input函数代码示例

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


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


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