本文整理汇总了PHP中wc_help_tip函数的典型用法代码示例。如果您正苦于以下问题:PHP wc_help_tip函数的具体用法?PHP wc_help_tip怎么用?PHP wc_help_tip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wc_help_tip函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: dd_select_colvariants_products
function dd_select_colvariants_products()
{
global $post, $woocommerce;
$product_ids = array_filter(array_map('absint', (array) get_post_meta($post->ID, '_colvariants_ids', true)));
?>
<div class="options_group">
<p class="form-field">
<label for="colvariants_ids"><?php
_e('Color Variants', 'woocommerce');
?>
</label>
<input type="hidden" class="wc-product-search" style="width: 50%;" id="colvariants_ids" name="colvariants_ids" data-placeholder="<?php
_e('Search for a product…', 'woocommerce');
?>
" data-action="woocommerce_json_search_products" data-multiple="true" data-selected="<?php
$json_ids = array();
foreach ($product_ids as $product_id) {
$product = wc_get_product($product_id);
if (is_object($product)) {
$json_ids[$product_id] = wp_kses_post(html_entity_decode($product->get_formatted_name(), ENT_QUOTES, get_bloginfo('charset')));
}
}
echo esc_attr(json_encode($json_ids));
?>
" value="<?php
echo implode(',', array_keys($json_ids));
?>
" /> <?php
echo wc_help_tip(__('Color variants are products which are diplayed and linked on product page as a color selector field. Please included current color variant also.', 'dd'));
?>
</p>
</div>
<?php
}
开发者ID:ceto,项目名称:dogdayswear,代码行数:34,代码来源:woocommerce.php
示例2: wc_help_tip
/**
* Display a WooCommerce help tip.
*
* @since 1.0.4
*
* @param string $tip
* @return string
*/
public static function wc_help_tip($tip)
{
if (self::is_wc_version_gte_2_5()) {
return wc_help_tip($tip);
} else {
return '<img class="help_tip woocommerce-help-tip" data-tip="' . $tip . '" src="' . WC()->plugin_url() . '/assets/images/help.png" />';
}
}
开发者ID:seb86,项目名称:woocommerce-subscribe-to-all-the-things,代码行数:16,代码来源:class-wcsatt-core-compatibility.php
示例3: wc_help_tip
/**
* Backports wc_help_tip() to WC 2.4/2.3
*
* @link https://github.com/woothemes/woocommerce/pull/9417
*
* @since 4.2.0
* @param string $tip help tip content, HTML allowed if $has_html is true
* @param bool $has_html false by default, true to indicate tip content has HTML
* @return string help tip HTML, a <span> in WC 2.5, <img> in WC 2.4/2.3
*/
public static function wc_help_tip($tip, $has_html = false)
{
if (self::is_wc_version_gte_2_5()) {
return wc_help_tip($tip, $has_html);
} else {
$tip = $has_html ? wc_sanitize_tooltip($tip) : esc_attr($tip);
return sprintf('<img class="help_tip" data-tip="%1$s" src="%2$s" height="16" width="16" />', $tip, esc_url(WC()->plugin_url()) . '/assets/images/help.png');
}
}
开发者ID:lilweirdward,项目名称:blofishwordpress,代码行数:19,代码来源:class-sv-wc-plugin-compatibility.php
示例4: wc_price
:</td>
<td class="total">
<?php
echo wc_price($order->get_total_discount(), array('currency' => $order->get_order_currency()));
?>
</td>
<td width="1%"></td>
</tr>
<?php
do_action('woocommerce_admin_order_totals_after_discount', $order->id);
?>
<tr>
<td class="label"><?php
echo wc_help_tip(__('This is the shipping and handling total costs for the order.', 'woocommerce'));
?>
<?php
_e('Shipping', 'woocommerce');
?>
:</td>
<td class="total"><?php
if (($refunded = $order->get_total_shipping_refunded()) > 0) {
echo '<del>' . strip_tags(wc_price($order->get_total_shipping(), array('currency' => $order->get_order_currency()))) . '</del> <ins>' . wc_price($order->get_total_shipping() - $refunded, array('currency' => $order->get_order_currency())) . '</ins>';
} else {
echo wc_price($order->get_total_shipping(), array('currency' => $order->get_order_currency()));
}
?>
</td>
<td width="1%"></td>
</tr>
开发者ID:bitoncoin,项目名称:woocommerce,代码行数:31,代码来源:html-order-items.php
示例5: __
if (!current_theme_supports('woocommerce') && !in_array($active_theme->template, wc_get_core_supported_themes())) {
echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . __('Not Declared', 'woocommerce') . '</mark>';
} else {
echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>';
}
?>
</td>
</tr>
</tbody>
</table>
<table class="wc_status_table widefat" cellspacing="0">
<thead>
<tr>
<th colspan="3" data-export-label="Templates"><h2><?php
_e('Templates', 'woocommerce');
echo wc_help_tip(__('This section shows any files that are overriding the default WooCommerce template pages.', 'woocommerce'));
?>
</h2></th>
</tr>
</thead>
<tbody>
<?php
if (file_exists(get_stylesheet_directory() . '/woocommerce.php') || file_exists(get_template_directory() . '/woocommerce.php')) {
?>
<tr>
<td data-export-label="Overrides"><?php
_e('Archive Template', 'woocommerce');
?>
:</td>
<td class="help"> </td>
<td><?php
开发者ID:Biont,项目名称:woocommerce,代码行数:31,代码来源:html-admin-page-status-report.php
示例6: esc_attr
]" value="<?php
if (isset($_download_limit)) {
echo esc_attr($_download_limit);
}
?>
" placeholder="<?php
esc_attr_e('Unlimited', 'woocommerce');
?>
" step="1" min="0" />
</p>
<p class="form-row form-row-last">
<label><?php
_e('Download expiry', 'woocommerce');
?>
<?php
echo wc_help_tip(__('Enter the number of days before a download link expires, or leave blank.', 'woocommerce'));
?>
</a></label>
<input type="number" size="5" name="variable_download_expiry[<?php
echo $loop;
?>
]" value="<?php
if (isset($_download_expiry)) {
echo esc_attr($_download_expiry);
}
?>
" placeholder="<?php
esc_attr_e('Unlimited', 'woocommerce');
?>
" step="1" min="0" />
</p>
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:31,代码来源:html-variation-admin.php
示例7: output
/**
* Output the metabox.
*/
public static function output($post)
{
global $post;
$args = array('post_id' => $post->ID, 'orderby' => 'comment_ID', 'order' => 'DESC', 'approve' => 'approve', 'type' => 'order_note');
remove_filter('comments_clauses', array('WC_Comments', 'exclude_order_comments'), 10, 1);
$notes = get_comments($args);
add_filter('comments_clauses', array('WC_Comments', 'exclude_order_comments'), 10, 1);
echo '<ul class="order_notes">';
if ($notes) {
foreach ($notes as $note) {
$note_classes = get_comment_meta($note->comment_ID, 'is_customer_note', true) ? array('customer-note', 'note') : array('note');
$note_classes = apply_filters('woocommerce_order_note_class', $note_classes, $note);
?>
<li rel="<?php
echo absint($note->comment_ID);
?>
" class="<?php
echo esc_attr(implode(' ', $note_classes));
?>
">
<div class="note_content">
<?php
echo wpautop(wptexturize(wp_kses_post($note->comment_content)));
?>
</div>
<p class="meta">
<abbr class="exact-date" title="<?php
echo $note->comment_date;
?>
"><?php
printf(__('added on %1$s at %2$s', 'woocommerce'), date_i18n(wc_date_format(), strtotime($note->comment_date)), date_i18n(wc_time_format(), strtotime($note->comment_date)));
?>
</abbr>
<?php
if ($note->comment_author !== __('WooCommerce', 'woocommerce')) {
printf(' ' . __('by %s', 'woocommerce'), $note->comment_author);
}
?>
<a href="#" class="delete_note"><?php
_e('Delete note', 'woocommerce');
?>
</a>
</p>
</li>
<?php
}
} else {
echo '<li>' . __('There are no notes yet.', 'woocommerce') . '</li>';
}
echo '</ul>';
?>
<div class="add_note">
<h4><?php
_e('Add note', 'woocommerce');
?>
<?php
echo wc_help_tip(__('Add a note for your reference, or add a customer note (the user will be notified).', 'woocommerce'));
?>
</h4>
<p>
<textarea type="text" name="order_note" id="add_order_note" class="input-text" cols="20" rows="5"></textarea>
</p>
<p>
<select name="order_note_type" id="order_note_type">
<option value=""><?php
_e('Private note', 'woocommerce');
?>
</option>
<option value="customer"><?php
_e('Note to customer', 'woocommerce');
?>
</option>
</select>
<a href="#" class="add_note button"><?php
_e('Add', 'woocommerce');
?>
</a>
</p>
</div>
<?php
}
开发者ID:bitoncoin,项目名称:woocommerce,代码行数:84,代码来源:class-wc-meta-box-order-notes.php
示例8: color_picker
/**
* Output a colour picker input box.
*
* @param mixed $name
* @param string $id
* @param mixed $value
* @param string $desc (default: '')
*/
public function color_picker($name, $id, $value, $desc = '')
{
echo '<div class="color_box">' . wc_help_tip($desc) . '
<input name="' . esc_attr($id) . '" id="' . esc_attr($id) . '" type="text" value="' . esc_attr($value) . '" class="colorpick" /> <div id="colorPickerDiv_' . esc_attr($id) . '" class="colorpickdiv"></div>
</div>';
}
开发者ID:unfulvio,项目名称:woocommerce,代码行数:14,代码来源:class-wc-settings-general.php
示例9: esc_attr
echo esc_attr($user_string);
?>
" value="<?php
echo esc_attr($user_id);
?>
" data-allow_clear="true" />
</td>
</tr>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="key_permissions"><?php
_e('Permissions', 'woocommerce');
?>
</label>
<?php
echo wc_help_tip(__('Select the access type of these keys.', 'woocommerce'));
?>
</th>
<td class="forminp">
<select id="key_permissions" class="wc-enhanced-select">
<?php
$permissions = array('read' => __('Read', 'woocommerce'), 'write' => __('Write', 'woocommerce'), 'read_write' => __('Read/Write', 'woocommerce'));
foreach ($permissions as $permission_id => $permission_name) {
?>
<option value="<?php
echo esc_attr($permission_id);
?>
" <?php
selected($key_data['permissions'], $permission_id, true);
?>
><?php
开发者ID:Korkey128k,项目名称:woocommerce,代码行数:31,代码来源:html-keys-edit.php
示例10: esc_attr
</th>
<td class="forminp">
<input name="webhook_delivery_url" id="webhook_delivery_url" type="text" class="input-text regular-input" value="<?php
echo esc_attr($webhook->get_delivery_url());
?>
" />
</td>
</tr>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="webhook_secret"><?php
_e('Secret', 'woocommerce');
?>
</label>
<?php
echo wc_help_tip(__('The Secret Key is used to generate a hash of the delivered webhook and provided in the request headers. This will default to the current API user\'s consumer secret if not provided.', 'woocommerce'));
?>
</th>
<td class="forminp">
<input name="webhook_secret" id="webhook_secret" type="text" class="input-text regular-input" value="<?php
echo esc_attr($webhook->get_secret());
?>
" />
</td>
</tr>
</tbody>
</table>
<?php
do_action('woocommerce_webhook_options');
?>
开发者ID:unfulvio,项目名称:woocommerce,代码行数:31,代码来源:html-webhooks-edit.php
示例11: esc_attr
</th>
<td class="forminp">
<input name="webhook_delivery_url" id="webhook_delivery_url" type="text" class="input-text regular-input" value="<?php
echo esc_attr($webhook->get_delivery_url());
?>
" />
</td>
</tr>
<tr valign="top">
<th scope="row" class="titledesc">
<label for="webhook_secret"><?php
_e('Secret', 'woocommerce');
?>
</label>
<?php
echo wc_help_tip(__('The Secret Key is used to generate a hash of the delivered webhook and provided in the request headers.', 'woocommerce'));
?>
</th>
<td class="forminp">
<input name="webhook_secret" id="webhook_secret" type="text" class="input-text regular-input" value="<?php
echo esc_attr($webhook->get_secret());
?>
" />
</td>
</tr>
</tbody>
</table>
<?php
do_action('woocommerce_webhook_options');
?>
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:31,代码来源:html-webhooks-edit.php
示例12: get_main_chart
/**
* Get the main chart.
*
* @return string
*/
public function get_main_chart()
{
$query_data = array('_order_tax' => array('type' => 'meta', 'function' => 'SUM', 'name' => 'tax_amount'), '_order_shipping_tax' => array('type' => 'meta', 'function' => 'SUM', 'name' => 'shipping_tax_amount'), '_order_total' => array('type' => 'meta', 'function' => 'SUM', 'name' => 'total_sales'), '_order_shipping' => array('type' => 'meta', 'function' => 'SUM', 'name' => 'total_shipping'), 'ID' => array('type' => 'post_data', 'function' => 'COUNT', 'name' => 'total_orders', 'distinct' => true), 'post_date' => array('type' => 'post_data', 'function' => '', 'name' => 'post_date'));
$tax_rows_orders = $this->get_order_report_data(array('data' => $query_data, 'group_by' => $this->group_by_query, 'order_by' => 'post_date ASC', 'query_type' => 'get_results', 'filter_range' => true, 'order_types' => wc_get_order_types('sales-reports'), 'order_status' => array('completed', 'processing', 'on-hold')));
$tax_rows_partial_refunds = $this->get_order_report_data(array('data' => $query_data, 'group_by' => $this->group_by_query, 'order_by' => 'post_date ASC', 'query_type' => 'get_results', 'filter_range' => true, 'order_types' => array('shop_order_refund'), 'parent_order_status' => array('completed', 'processing', 'on-hold')));
// Merge
$tax_rows = array();
foreach ($tax_rows_orders as $tax_row) {
$key = date($this->chart_groupby == 'month' ? 'Ym' : 'Ymd', strtotime($tax_row->post_date));
$tax_rows[$key] = isset($tax_rows[$key]) ? $tax_rows[$key] : (object) array('tax_amount' => 0, 'shipping_tax_amount' => 0, 'total_sales' => 0, 'total_shipping' => 0, 'total_orders' => 0);
$tax_rows[$key]->tax_amount += $tax_row->tax_amount;
$tax_rows[$key]->shipping_tax_amount += $tax_row->shipping_tax_amount;
$tax_rows[$key]->total_sales += $tax_row->total_sales;
$tax_rows[$key]->total_shipping += $tax_row->total_shipping;
$tax_rows[$key]->total_orders += $tax_row->total_orders;
}
foreach ($tax_rows_partial_refunds as $tax_row) {
$key = date($this->chart_groupby == 'month' ? 'Ym' : 'Ymd', strtotime($tax_row->post_date));
$tax_rows[$key] = isset($tax_rows[$key]) ? $tax_rows[$key] : (object) array('tax_amount' => 0, 'shipping_tax_amount' => 0, 'total_sales' => 0, 'total_shipping' => 0, 'total_orders' => 0);
$tax_rows[$key]->tax_amount += $tax_row->tax_amount;
$tax_rows[$key]->shipping_tax_amount += $tax_row->shipping_tax_amount;
$tax_rows[$key]->total_sales += $tax_row->total_sales;
$tax_rows[$key]->total_shipping += $tax_row->total_shipping;
}
?>
<table class="widefat">
<thead>
<tr>
<th><?php
_e('Period', 'woocommerce');
?>
</th>
<th class="total_row"><?php
_e('Number of Orders', 'woocommerce');
?>
</th>
<th class="total_row"><?php
_e('Total Sales', 'woocommerce');
?>
<?php
echo wc_help_tip(__("This is the sum of the 'Order Total' field within your orders.", 'woocommerce'));
?>
</th>
<th class="total_row"><?php
_e('Total Shipping', 'woocommerce');
?>
<?php
echo wc_help_tip(__("This is the sum of the 'Shipping Total' field within your orders.", 'woocommerce'));
?>
</th>
<th class="total_row"><?php
_e('Total Tax', 'woocommerce');
?>
<?php
echo wc_help_tip(__('This is the total tax for the rate (shipping tax + product tax).', 'woocommerce'));
?>
</th>
<th class="total_row"><?php
_e('Net profit', 'woocommerce');
?>
<?php
echo wc_help_tip(__("Total sales minus shipping and tax.", 'woocommerce'));
?>
</th>
</tr>
</thead>
<?php
if (!empty($tax_rows)) {
?>
<tbody>
<?php
foreach ($tax_rows as $date => $tax_row) {
$gross = $tax_row->total_sales - $tax_row->total_shipping;
$total_tax = $tax_row->tax_amount + $tax_row->shipping_tax_amount;
?>
<tr>
<th scope="row"><?php
if ($this->chart_groupby == 'month') {
echo date_i18n('F', strtotime($date . '01'));
} else {
echo date_i18n(get_option('date_format'), strtotime($date));
}
?>
</th>
<td class="total_row"><?php
echo $tax_row->total_orders;
?>
</td>
<td class="total_row"><?php
echo wc_price($gross);
?>
</td>
<td class="total_row"><?php
echo wc_price($tax_row->total_shipping);
?>
//.........这里部分代码省略.........
开发者ID:tlovett1,项目名称:woocommerce,代码行数:101,代码来源:class-wc-report-taxes-by-date.php
示例13: _e
</label>
<table class="widefat">
<thead>
<div>
<th><?php
_e('Name', 'woocommerce');
?>
<?php
echo wc_help_tip(__('This is the name of the download shown to the customer.', 'woocommerce'));
?>
</th>
<th colspan="2"><?php
_e('File URL', 'woocommerce');
?>
<?php
echo wc_help_tip(__('This is the URL or absolute path to the file which customers will get access to. URLs entered here should already be encoded.', 'woocommerce'));
?>
</th>
<th> </th>
</div>
</thead>
<tbody>
<?php
if ($downloads = $variation_object->get_downloads('edit')) {
foreach ($downloads as $key => $file) {
include 'html-product-variation-download.php';
}
}
?>
</tbody>
<tfoot>
开发者ID:woocommerce,项目名称:woocommerce,代码行数:31,代码来源:html-variation-admin.php
示例14: wc_help_tip
</span>
<?php
echo wc_help_tip(__('LxWxH in decimal form', 'woocommerce'));
?>
</p><?php
}
do_action('woocommerce_product_options_dimensions');
?>
</div>
<div class="options_group">
<?php
$args = array('taxonomy' => 'product_shipping_class', 'hide_empty' => 0, 'show_option_none' => __('No shipping class', 'woocommerce'), 'name' => 'product_shipping_class', 'id' => 'product_shipping_class', 'selected' => $product_object->get_shipping_class_id('edit'), 'class' => 'select short');
?>
<p class="form-field dimensions_field">
<label for="product_shipping_class"><?php
_e('Shipping class', 'woocommerce');
?>
</label>
<?php
wp_dropdown_categories($args);
?>
<?php
echo wc_help_tip(__('Shipping classes are used by certain shipping methods to group similar products.', 'woocommerce'));
?>
</p><?php
do_action('woocommerce_product_options_shipping');
?>
</div>
</div>
开发者ID:woocommerce,项目名称:woocommerce,代码行数:30,代码来源:html-product-data-shipping.php
示例15: admin_options
//.........这里部分代码省略.........
<img src="<?php
echo plugins_url('../assets/images/payments/master-card.png', __FILE__);
?>
" />
<img src="<?php
echo plugins_url('../assets/images/payments/discover.png', __FILE__);
?>
" />
<img src="<?php
echo plugins_url('../assets/images/payments/american-express.png', __FILE__);
?>
" />
<img src="<?php
echo plugins_url('../assets/images/payments/paypal.png', __FILE__);
?>
" />
</div>
</div>
<?php
if (empty($this->merchant_access_token)) {
?>
<p class='paypal-braintree-admin-connect-prompt'>
<?php
echo esc_html('Connect with Braintree to start accepting credit and debit card payments in your checkout.', 'woocommerce-gateway-paypal-braintree');
?>
<br/>
<a href="https://www.braintreepayments.com/partners/learn-more" target="_blank">
<?php
echo esc_html('Learn more', 'woocommerce-gateway-paypal-braintree');
?>
</a>
</p>
<?php
}
?>
<table class="form-table">
<tbody>
<tr>
<th>
<?php
_e('Connect/Disconnect', 'woocommerce-gateway-paypal-braintree');
?>
<?php
$connect_help_tip = __('Click button to create an account with Braintree and start transacting.', 'woocommerce-gateway-paypal-braintree');
if (!empty($this->merchant_access_token)) {
$connect_help_tip = sprintf('%s<br><br>%s<br><br>%s', __('You just connected your Braintree account to WooCommerce. You can start taking payments now.', 'woocommerce-gateway-paypal-braintree'), __('Once you have processed a payment, PayPal will review your application for final approval. Before you ship any goods make sure you have received a final approval for your Braintree account.', 'woocommerce-gateway-paypal-braintree'), __('Questions? We are a phone call away: 1-855-489-0345.', 'woocommerce-gateway-paypal-braintree'));
}
echo wc_help_tip($connect_help_tip);
?>
</th>
<td>
<?php
if (!empty($this->merchant_access_token)) {
?>
<a href="<?php
echo esc_attr($disconnect_url);
?>
" class='button-primary'>
<?php
echo esc_html__('Disconnect from PayPal Powered by Braintree', 'woocommerce-gateway-paypal-braintree');
?>
</a>
<?php
} else {
?>
<a href="<?php
echo esc_attr($production_connect_url);
?>
">
<img src="<?php
echo plugins_url('../assets/images/button/connect-braintree.png', __FILE__);
?>
"/>
</a>
<br/>
<br/>
<a href="<?php
echo esc_attr($sandbox_connect_url);
?>
">
<?php
echo esc_html__('Not ready to accept live payments? Click here to connect using sandbox mode.', 'woocommerce-gateway-paypal-braintree');
?>
</a>
<?php
}
?>
</td>
</tr>
</tbody>
</table>
<table class="form-table">
<?php
$this->generate_settings_html();
?>
</table>
<?php
}
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:101,代码来源:class-wc-gateway-paypal-braintree.php
示例16: esc_html_e
<tr valign="top" class="">
<th scope="row" class="titledesc">
<label><?php
esc_html_e('Shipping method(s)', 'woocommerce');
?>
</label>
<?php
echo wc_help_tip(__('The following shipping methods apply to customers with shipping addresses within this zone.', 'woocommerce'));
?>
</th>
<td class="">
<table class="wc-shipping-zone-methods widefat">
<thead>
<tr>
<th class="wc-shipping-zone-method-sort"><?php
echo wc_help_tip(__('Drag and drop to re-order your shipping methods. This is the order in which they will display during checkout.', 'woocommerce'));
?>
</th>
<th class="wc-shipping-zone-method-title"><?php
esc_html_e('Title', 'woocommerce');
?>
</th>
<th class="wc-shipping-zone-method-type"><?php
esc_html_e('Type', 'woocommerce');
?>
</th>
<th class="wc-shipping-zone-method-enabled"><?php
esc_html_e('Enabled', 'woocommerce');
?>
</th>
<th class="wc-shipping-zone-method-description"><?php
开发者ID:Korkey128k,项目名称:woocommerce,代码行数:31,代码来源:html-admin-page-shipping-zone-methods.php
示例17: get_tooltip_html
/**
* Get HTML for tooltips.
*
* @param array $data
* @return string
*/
public function get_tooltip_html($data)
{
if ($data['desc_tip'] === true) {
$tip = $data['description'];
} elseif (!empty($data['desc_tip'])) {
$tip = $data['desc_tip'];
} else {
$tip = '';
}
return $tip ? wc_help_tip($tip, true) : '';
}
开发者ID:tlovett1,项目名称:woocommerce,代码行数:17,代码来源:abstract-wc-settings-api.php
示例18: _e
?>
</td>
</tr>
<tr>
<td class="label"><label for="refund_amount"><?php
_e('Refund amount', 'woocommerce');
?>
:</label></td>
<td class="total">
<input type="text" class="text" id="refund_amount" name="refund_amount" class="wc_input_price" />
<div class="clear"></div>
</td>
</tr>
<tr>
<td class="label"><label for="refund_reason"><?php
echo wc_help_tip(__('Note: the refund reason will be visible by the customer.', 'woocommerce'));
?>
<?php
_e('Reason for refund (optional)', 'woocommerce');
?>
:</label></td>
<td class="total">
<input type="text" class="text" id="refund_reason" name="refund_reason" />
<div class="clear"></div>
</td>
</tr>
</table>
<div class="clear"></div>
<div class="refund-actions">
<?php
$refund_amount = '<span class="wc-order-refund-amount">' . wc_price(0, array('currency' => $order->get_currency())) . '</span>';
开发者ID:pelmered,项目名称:woocommerce,代码行数:31,代码来源:html-order-items.php
示例19: output
/**
* Output the metabox.
*
* @param WP_Post $post
*/
public static function output($post)
{
wp_nonce_field('woocommerce_save_data', 'woocommerce_meta_nonce');
$coupon = new WC_Coupon($post->ID);
?>
<style type="text/css">
#edit-slug-box, #minor-publishing-actions { display:none }
</style>
<div id="coupon_options" class="panel-wrap coupon_data">
<div class="wc-tabs-back"></div>
<ul class="coupon_data_tabs wc-tabs" style="display:none;">
<?php
$coupon_data_tabs = apply_filters('woocommerce_coupon_data_tabs', array('general' => array('label' => __('General', 'woocommerce'), 'target' => 'general_coupon_data', 'class' => 'general_coupon_data'), 'usage_restriction' => array('label' => __('Usage restriction', 'woocommerce'), 'target' => 'usage_restriction_coupon_data', 'class' => ''), 'usage_limit' => array('label' => __('Usage limits', 'woocommerce'), 'target' => 'usage_limit_coupon_data', 'class' => '')));
foreach ($coupon_data_tabs as $key => $tab) {
?>
<li class="<?php
echo $key;
?>
_options <?php
echo $key;
?>
_tab <?php
echo implode(' ', (array) $tab['class']);
?>
">
<a href="#<?php
echo $tab['target'];
?>
"><?php
echo esc_html($tab['label']);
?>
</a>
</li><?php
}
?>
</ul>
<div id="general_coupon_data" class="panel woocommerce_options_panel"><?php
// Type
woocommerce_wp_select(array('id' => 'discount_type', 'label' => __('Discount type', 'woocommerce'), 'options' => wc_get_coupon_types()));
// Amount
woocommerce_wp_text_input(array('id' => 'coupon_amount', 'label' => __('Coupon amount', 'woocommerce'), 'placeholder' => wc_format_localized_price(0), 'description' => __('Value of the coupon.', 'woocommerce'), 'data_type' => 'price', 'desc_tip' => true));
// Free Shipping
woocommerce_wp_checkbox(array('id' => 'free_shipping', 'label' => __('Allow free shipping', 'woocommerce'), 'description' => sprintf(__('Check this box if the coupon grants free shipping. A <a href="%s" target="_blank">free shipping method</a> must be enabled in your shipping zone and be set to require "a valid free shipping coupon" (see the "Free Shipping Requires" setting).', 'woocommerce'), 'https://docs.woocommerce.com/document/free-shipping/')));
// Expiry date
$expiry_date = $coupon->get_date_expires() ? date('Y-m-d', $coupon->get_date_expires()) : '';
woocommerce_wp_text_input(array('id' => 'expiry_date', 'value' => esc_attr($expiry_date), 'label' => __('Coupon expiry date', 'woocommerce'), 'placeholder' => esc_attr__('YYYY-MM-DD', 'woocommerce'), 'description' => '', 'class' => 'date-picker', 'custom_attributes' => array('pattern' => "[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])")));
do_action('woocommerce_coupon_options');
?>
</div>
<div id="usage_restriction_coupon_data" class="panel woocommerce_options_panel"><?php
echo '<div class="options_group">';
// minimum spend
woocommerce_wp_text_input(array('id' => 'minimum_amount', 'label' => __('Minimum spend', 'woocommerce'), 'placeholder' => __('No minimum', 'woocommerce'), 'description' => __('This field allows you to set the minimum spend (subtotal, including taxes) allowed to use the coupon.', 'woocommerce'), 'data_type' => 'price', 'desc_tip' => true));
// maximum spend
woocommerce_wp_text_input(array('id' => 'maximum_amount', 'label' => __('Maximum spend', 'woocommerce'), 'placeholder' => __('No maximum', 'woocommerce'), 'description' => __('This field allows you to set the maximum spend (subtotal, including taxes) allowed when using the coupon.', 'woocommerce'), 'data_type' => 'price', 'desc_tip' => true));
// Individual use
woocommerce_wp_checkbox(array('id' => 'individual_use', 'label' => __('Individual use only', 'woocommerce'), 'description' => __('Check this box if the coupon cannot be used in conjunction with other coupons.', 'woocommerce')));
// Exclude Sale Products
woocommerce_wp_checkbox(array('id' => 'exclude_sale_items', 'label' => __('Exclude sale items', 'woocommerce'), 'description' => __('Check this box if the coupon should not apply to items on sale. Per-item coupons will only work if the item is not on sale. Per-cart coupons will only work if there are no sale items in the cart.', 'woocommerce')));
echo '</div><div class="options_group">';
// Product ids
?>
<p class="form-field"><label><?php
_e('Products', 'woocommerce');
?>
</label>
<input type="hidden" class="wc-product-search" data-multiple="true" style="width: 50%;" name="product_ids" data-placeholder="<?php
esc_attr_e('Search for a product…', 'woocommerce');
?>
" data-action="woocommerce_json_search_products_and_variations" data-selected="<?php
$product_ids = $coupon->get_product_ids();
$json_ids = array();
foreach ($product_ids as $product_id) {
$product = wc_get_product($product_id);
if (is_object($product)) {
$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));
?>
" /> <?php
echo wc_help_tip(__('Products which need to be in the cart to use this coupon or, for "Product Discounts", which products are discounted.', 'woocommerce'));
?>
</p>
<?php
// Exclude Product ids
?>
<p class="form-field"><label><?php
_e('Exclude products', 'woocommerce');
?>
//.........这里部分代码省略.........
开发者ID:johnulist,项目名称:woocommerce,代码行数:101,代码来源:class-wc-meta-box-coupon-data.php
示例20: shipping_methods_setting
/**
* Output shipping method settings.
*/
public function shipping_methods_setting()
{
$selection_priority = get_option('woocommerce_shipping_method_selection_priority', array());
?>
<tr valign="top">
<th scope="row" class="titledesc"><?php
_e('Shipping Methods', 'woocommerce');
?>
</th>
<td class="forminp">
<table class="wc_shipping widefat wp-list-table" cellspacing="0">
<thead>
<tr>
<th class="sort"> </th>
<th class="name"><?php
_e('Name', 'woocommerce');
?>
</th>
<th class="id"><?php
_e('ID', 'woocommerce');
?>
</th>
<th class="status"><?php
_e('Enabled', 'woocommerce');
?>
</th>
<th class="priority"><?php
_e('Selection Priority', 'woocommerce');
?>
<?php
echo wc_help_tip(__('Available methods will be chosen by default in this order. If multiple methods have the same priority, they will be sorted by cost.', 'woocommerce'));
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach (WC()->shipping->load_shipping_methods() as $key => $method) {
?>
<tr>
<td width="1%" class="sort">
<input type="hidden" name="method_order[<?php
echo esc_attr($method->id);
?>
]" value="<?php
echo esc_attr($method->id);
?>
" />
</td>
<td class="name">
<?php
if ($method->has_settings) {
?>
<a href="&l
|
请发表评论