本文整理汇总了PHP中get_woocommerce_currency_symbol函数的典型用法代码示例。如果您正苦于以下问题:PHP get_woocommerce_currency_symbol函数的具体用法?PHP get_woocommerce_currency_symbol怎么用?PHP get_woocommerce_currency_symbol使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_woocommerce_currency_symbol函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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…', '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
}
示例2: get_settings
/**
* Get settings array
*
* @return array
*/
public function get_settings()
{
$currency_code_options = get_woocommerce_currencies();
foreach ($currency_code_options as $code => $name) {
$currency_code_options[$code] = $name . ' (' . get_woocommerce_currency_symbol($code) . ')';
}
$settings = apply_filters('woocommerce_general_settings', array(array('title' => __('General Options', 'woocommerce'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'), array('title' => __('Base Location', 'woocommerce'), 'desc' => __('This is the base location for your business. Tax rates will be based on this country.', 'woocommerce'), 'id' => 'woocommerce_default_country', 'css' => 'min-width:350px;', 'default' => 'GB', 'type' => 'single_select_country', 'desc_tip' => true), array('title' => __('Selling Location(s)', 'woocommerce'), 'desc' => __('This option lets you limit which countries you are willing to sell to.', 'woocommerce'), 'id' => 'woocommerce_allowed_countries', 'default' => 'all', 'type' => 'select', 'class' => 'wc-enhanced-select', 'css' => 'min-width: 350px;', 'desc_tip' => true, 'options' => array('all' => __('Sell to all countries', 'woocommerce'), 'specific' => __('Sell to specific countries only', 'woocommerce'))), array('title' => __('Specific Countries', 'woocommerce'), 'desc' => '', 'id' => 'woocommerce_specific_allowed_countries', 'css' => 'min-width: 350px;', 'default' => '', 'type' => 'multi_select_countries'), array('title' => __('Default Customer Address', 'woocommerce'), 'id' => 'woocommerce_default_customer_address', 'desc_tip' => __('This option determines the customers default address (before they input their details).', 'woocommerce'), 'desc' => sprintf(__('Note: If you choose to Geolocate the user address, the %sMaxMind GeoLite Database%s will be periodically downloaded and stored in your wp-content directory.', 'woocommerce'), '<a href="http://dev.maxmind.com/geoip/legacy/geolite/">', '</a>'), 'default' => 'geolocation', 'type' => 'select', 'class' => 'wc-enhanced-select', 'options' => array('' => __('No address', 'woocommerce'), 'base' => __('Shop base address', 'woocommerce'), 'geolocation' => __('Geolocate address', 'woocommerce'))), array('title' => __('Store Notice', 'woocommerce'), 'desc' => __('Enable site-wide store notice text', 'woocommerce'), 'id' => 'woocommerce_demo_store', 'default' => 'no', 'type' => 'checkbox'), array('title' => __('Store Notice Text', 'woocommerce'), 'desc' => '', 'id' => 'woocommerce_demo_store_notice', 'default' => __('This is a demo store for testing purposes — no orders shall be fulfilled.', 'woocommerce'), 'type' => 'text', 'css' => 'min-width:300px;', 'autoload' => false), array('title' => __('API', 'woocommerce'), 'desc' => __('Enable the REST API', 'woocommerce'), 'id' => 'woocommerce_api_enabled', 'type' => 'checkbox', 'default' => 'yes'), array('type' => 'sectionend', 'id' => 'general_options'), array('title' => __('Currency Options', 'woocommerce'), 'type' => 'title', 'desc' => __('The following options affect how prices are displayed on the frontend.', 'woocommerce'), 'id' => 'pricing_options'), array('title' => __('Currency', 'woocommerce'), 'desc' => __('This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.', 'woocommerce'), 'id' => 'woocommerce_currency', 'css' => 'min-width:350px;', 'default' => 'GBP', 'type' => 'select', 'class' => 'wc-enhanced-select', 'desc_tip' => true, 'options' => $currency_code_options), array('title' => __('Currency Position', 'woocommerce'), 'desc' => __('This controls the position of the currency symbol.', 'woocommerce'), 'id' => 'woocommerce_currency_pos', 'css' => 'min-width:350px;', 'class' => 'wc-enhanced-select', 'default' => 'left', 'type' => 'select', 'options' => array('left' => __('Left', 'woocommerce') . ' (' . get_woocommerce_currency_symbol() . '99.99)', 'right' => __('Right', 'woocommerce') . ' (99.99' . get_woocommerce_currency_symbol() . ')', 'left_space' => __('Left with space', 'woocommerce') . ' (' . get_woocommerce_currency_symbol() . ' 99.99)', 'right_space' => __('Right with space', 'woocommerce') . ' (99.99 ' . get_woocommerce_currency_symbol() . ')'), 'desc_tip' => true), array('title' => __('Thousand Separator', 'woocommerce'), 'desc' => __('This sets the thousand separator of displayed prices.', 'woocommerce'), 'id' => 'woocommerce_price_thousand_sep', 'css' => 'width:50px;', 'default' => ',', 'type' => 'text', 'desc_tip' => true), array('title' => __('Decimal Separator', 'woocommerce'), 'desc' => __('This sets the decimal separator of displayed prices.', 'woocommerce'), 'id' => 'woocommerce_price_decimal_sep', 'css' => 'width:50px;', 'default' => '.', 'type' => 'text', 'desc_tip' => true), array('title' => __('Number of Decimals', 'woocommerce'), 'desc' => __('This sets the number of decimal points shown in displayed prices.', 'woocommerce'), 'id' => 'woocommerce_price_num_decimals', 'css' => 'width:50px;', 'default' => '2', 'desc_tip' => true, 'type' => 'number', 'custom_attributes' => array('min' => 0, 'step' => 1)), array('type' => 'sectionend', 'id' => 'pricing_options')));
return apply_filters('woocommerce_get_settings_' . $this->id, $settings);
}
示例3: pt_price_filter_init
function pt_price_filter_init()
{
if (function_exists('WC')) {
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '';
wp_register_script('wc-price-slider', WC()->plugin_url() . '/assets/js/frontend/price-slider' . $suffix . '.js', array('jquery-ui-slider'), WC_VERSION, true);
wp_localize_script('wc-price-slider', 'woocommerce_price_slider_params', array('currency_symbol' => get_woocommerce_currency_symbol(), 'currency_pos' => get_option('woocommerce_currency_pos'), 'min_price' => isset($_GET['min_price']) ? esc_attr($_GET['min_price']) : '', 'max_price' => isset($_GET['max_price']) ? esc_attr($_GET['max_price']) : ''));
//add_filter( 'loop_shop_post_in', array( $this, 'price_filter' ) );
}
}
示例4: auto_update_cart_total
function auto_update_cart_total()
{
// Only run in the Cart
if (is_cart()) {
global $woocommerce;
?>
<script>
jQuery(function($){
var currency = '<?php
echo get_woocommerce_currency_symbol();
?>
';
$('input[name*="qty"]').change(function(){
var quantity_number = $(this).val();
var prices = $(this).closest('.cart_item').find('.product-price').find('.amount').html().replace(/[^0-9\.]+/g,"");
var sub_total = quantity_number*prices;
$(this).closest('.cart_item').find('.product-subtotal').find('.amount').html(currency+sub_total.toFixed(2));
var sum = 0;
setTimeout(function(){
$('.product-subtotal .amount').each(function(){
var $amt = $(this);
sum += parseFloat($amt.html().replace(/[^0-9\.]+/g,""));
$('.cart-subtotal .amount').html(currency+sum.toFixed(2));
$('.order-total .amount').html(currency+sum.toFixed(2));
})
}, 300);
})
});
</script>
<?php
}
}
示例5: get_store_options
/**
* Gets woocommerce store options that are useful for all connect services
*
* @return object|array
*/
public function get_store_options()
{
$currency_symbol = sanitize_text_field(html_entity_decode(get_woocommerce_currency_symbol()));
$dimension_unit = sanitize_text_field(strtolower(get_option('woocommerce_dimension_unit')));
$weight_unit = sanitize_text_field(strtolower(get_option('woocommerce_weight_unit')));
return array('currency_symbol' => $currency_symbol, 'dimension_unit' => $this->translate_unit($dimension_unit), 'weight_unit' => $this->translate_unit($weight_unit));
}
开发者ID:Automattic,项目名称:woocommerce-connect-client,代码行数:12,代码来源:class-wc-connect-service-settings-store.php
示例6: setcommision_layout
function setcommision_layout($sid)
{
if (is_admin()) {
global $wpdb;
/*if(isset($_POST['commision']))
{
$wpdb->get_results("update {$wpdb->prefix}mpcommision set commision_on_seller='".$_POST['commision']."' where seller_id=$sid");
}*/
$com_res = $wpdb->get_results("select * from {$wpdb->prefix}mpcommision where seller_id={$sid}");
$cur_symbol = get_woocommerce_currency_symbol(get_option('woocommerce_currency'));
?>
<div id='admincommision'>
<h2> Set Seller Commision </h2>
<form action="<?php
echo get_home_url() . '/wp-admin/admin.php?page=Commissions&sid=' . $sid;
?>
" method='post' name='commision-form'>
<table>
<tr>
<th style="text-align: left;"><label for='commision'>Commision in fixed Rate</label></th>
<td><input type='text' title='commision in %' name='commision' value='<?php
echo $com_res[0]->commision_on_seller . ' %';
?>
' id='commisionid' /></td>
</tr>
<tr><th style="text-align: left;"><label for='totalsale'>Total Sale</label></th>
<td><input type='text' name='totalsale' value='<?php
echo $com_res[0]->last_com_on_total . ' ' . $cur_symbol;
?>
示例7: enqueue_styles
public function enqueue_styles()
{
global $post;
if (WBM_Frontend_Product::wbm_enabled($post->ID)) {
wp_enqueue_style('wbm_style_grids', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/css/grid.css', false);
wp_enqueue_style('wbm_style_tooltip', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/css/tooltipster.css', false);
wp_enqueue_style('wbm_style_checkbox', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/css/fm.checkator.css', false);
wp_enqueue_style('wbm_style_switch', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/css/lc_switch.css', false);
wp_enqueue_style('wbm_style_datetimepicker', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/css/jquery.datetimepicker.css', false);
wp_enqueue_style('wbm_style_accordion', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/css/smk-accordion.css', false);
wp_enqueue_style('wbm_style_alert', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/css/jquery.alerts.css', false);
wp_enqueue_style('wbm_style_frontend', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/css/style.css', false);
wp_enqueue_script('wbm_script_underscore', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/underscore-min.js', array('jquery'), null, true);
wp_enqueue_script('wbm_script_chekbox', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/fm.checkator.jquery.js', array('jquery'), null, true);
wp_enqueue_script('wbm_script_switch', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/lc_switch.min.js', array('jquery'), null, true);
wp_enqueue_script('wbm_script_datetimepicker', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/jquery.datetimepicker.full.js', array('jquery'), null, true);
wp_enqueue_script('wbm_script_tabs', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/jquery.responsiveTabs.js', array('jquery'), null, true);
wp_enqueue_script('wbm_script_accordion', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/smk-accordion.min.js', array('jquery'), null, true);
wp_enqueue_script('wbm_script_alert', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/jquery.alerts.js', array('jquery'), null, true);
wp_enqueue_script('wbm_script_tooltip', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/jquery.tooltipster.min.js', array('jquery'), null, true);
wp_register_script('wbm_script_frontend', WBM_PLUGIN_ABSOLUTE_PATH . 'assets/js/wbm.frontend.js', array('jquery'), null, true);
wp_localize_script('wbm_script_frontend', 'wbm_params', array('ajaxURL' => admin_url('admin-ajax.php'), 'yes_string' => __('Yes', 'wbm'), 'no_string' => __('No', 'wbm'), 'no_want' => __("I don't want this service", "wbm"), 'yes_want' => __("I want this service", "wbm"), 'currency_symbol' => get_woocommerce_currency_symbol(), 'alert_heading' => 'Error', 'alert_msg' => __('Please fill up all fields', 'wbm'), 'confirm_heading' => __('Confirmation', 'wbm'), 'confirm_msg' => __('Are you sure to book?', 'wbm'), 'choose_first_option_msg' => __('Please choose any option first', 'wbm')));
wp_enqueue_script('wbm_script_frontend');
}
}
示例8: add_price_column_content
function add_price_column_content($value, $column_name, $id)
{
$price = get_tax_meta($id, 'print_variation_price');
$priceFormatted = number_format($price, 2, '.', '');
$symbol = get_woocommerce_currency_symbol();
return $symbol . $priceFormatted;
}
示例9: addon_scripts
/**
* Enqueue addon scripts
*/
function addon_scripts()
{
wp_register_style('woocommerce-better-addons', plugins_url(basename(dirname(dirname(__FILE__)))) . '/assets/css/frontend.css', '', '0.3.2');
wp_enqueue_style('woocommerce-better-addons');
wp_register_script('accounting', plugins_url(basename(dirname(dirname(__FILE__)))) . '/assets/js/accounting.js', '', '0.3.2');
wp_enqueue_script('woocommerce-addons', plugins_url(basename(dirname(dirname(__FILE__)))) . '/assets/js/addons.js', array('jquery', 'accounting'), '1.0', true);
$params = array('i18n_addon_total' => __('Options total:', 'wc_product_addons'), 'i18n_grand_total' => __('Total:', 'wc_product_addons'), 'i18n_remaining' => __('characters remaining', 'wc_product_addons'), 'currency_format_num_decimals' => absint(get_option('woocommerce_price_num_decimals')), 'currency_format_symbol' => get_woocommerce_currency_symbol(), 'currency_format_decimal_sep' => esc_attr(stripslashes(get_option('woocommerce_price_decimal_sep'))), 'currency_format_thousand_sep' => esc_attr(stripslashes(get_option('woocommerce_price_thousand_sep'))));
if (!function_exists('get_woocommerce_price_format')) {
$currency_pos = get_option('woocommerce_currency_pos');
switch ($currency_pos) {
case 'left':
$format = '%1$s%2$s';
break;
case 'right':
$format = '%2$s%1$s';
break;
case 'left_space':
$format = '%1$s %2$s';
break;
case 'right_space':
$format = '%2$s %1$s';
break;
}
$params['currency_format'] = esc_attr(str_replace(array('%1$s', '%2$s'), array('%s', '%v'), $format));
} else {
$params['currency_format'] = esc_attr(str_replace(array('%1$s', '%2$s'), array('%s', '%v'), get_woocommerce_price_format()));
}
wp_localize_script('woocommerce-addons', 'woocommerce_addons_params', $params);
}
示例10: add_fields
public function add_fields($regular_price, $selling_price, $thepostid, $user_role_key, $name)
{
$allowed_currency = get_option(rbp_key . 'acs_allowed_currencies');
$this->acs_get_db_price($thepostid);
echo '<div class="wc_rbp_plugin_field_container">';
echo '<hr/> <h3>' . __('Role Based Price for Aelia Currency Switcher', lang_dom) . '</h3>';
foreach ($allowed_currency as $currency) {
$symbol = get_woocommerce_currency_symbol($currency);
$symbol = !empty($symbol) ? ' (' . $symbol . ') ' : ' (' . $currency . ') ';
if ($regular_price) {
echo '<p class="form-field ' . $currency . '_regular_price_' . $user_role_key . '_field form-row-first">
<label for="' . $currency . '_regular_price_' . $user_role_key . '_field">' . __('Regular Price' . $symbol, lang_dom) . '</label>
<input type="text" id="' . $currency . '_regular_price_' . $user_role_key . '_field"
name="acs[' . $user_role_key . '][' . $currency . '][regular_price]" class="short wc_input_price"
value="' . $this->acs_crp($currency, $user_role_key, 'regular_price') . '">
</p>';
}
if ($selling_price) {
echo '<p class="form-field ' . $currency . '_selling_price_' . $user_role_key . '_field form-row-last">
<label for="' . $currency . '_selling_price_' . $user_role_key . '_field">' . __('Selling Price' . $symbol, lang_dom) . '</label>
<input type="text" id="' . $currency . '_selling_price_' . $user_role_key . '_field"
name="acs[' . $user_role_key . '][' . $currency . '][selling_price]" class="short wc_input_price"
value="' . $this->acs_crp($currency, $user_role_key, 'selling_price') . '" >
</p>';
}
}
echo ' </div>';
}
开发者ID:aelia-co,项目名称:WooCommerce-Role-Based-Price,代码行数:28,代码来源:class-aelia-currencyswitcher-integration.php
示例11: add_checkout_options
function add_checkout_options()
{
global $woocommerce;
$vendor_ids = array();
foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {
if (!in_array($cart_item['data']->post->post_author, $vendor_ids)) {
$vendor_ids[] = $cart_item['data']->post->post_author;
}
}
?>
<div class="your-order">
<?php
foreach ($vendor_ids as $vendor_id) {
$store_settings = dokan_get_store_info($vendor_id);
$shipping_charge = get_user_meta($vendor_id, 'dokan_enable_seller_shipping', true);
$seller_shipping_charge = get_user_meta($vendor_id, 'dokan_seller_shipping_charge', true);
$currency_symbol = get_woocommerce_currency_symbol();
?>
<span class="order-title"><?php
echo $store_settings['store_name'];
?>
</span>
<div class="order-raw">
<input type="radio" name="dokan_product_shipping_choice[<?php
echo $vendor_id;
?>
]" class="dokan_product_shipping_choice" data-id="<?php
echo $vendor_id;
?>
" value="dokan_product_pick_at_farm">
<label>Pick up at the farm (<?php
echo $store_settings['address'];
?>
)</label>
<?php
if ($shipping_charge == "yes") {
?>
<input type="radio" name="dokan_product_shipping_choice[<?php
echo $vendor_id;
?>
]" class="dokan_product_shipping_choice" data-id="<?php
echo $vendor_id;
?>
" value="dokan_product_shipping">
<label>Shipping (<?php
echo $currency_symbol . " " . $seller_shipping_charge;
?>
)</label>
<?php
}
?>
</div>
<?php
}
?>
</div>
<?php
}
示例12: nyp_scripts
/**
* Load price input script
*
* @return void
*/
function nyp_scripts()
{
wp_enqueue_script('accounting');
wp_enqueue_script('woocommerce-nyp');
$params = array('currency_format_num_decimals' => esc_attr(wc_nyp_get_price_decimals()), 'currency_format_symbol' => get_woocommerce_currency_symbol(), 'currency_format_decimal_sep' => esc_attr(wc_nyp_get_price_decimal_separator()), 'currency_format_thousand_sep' => esc_attr(wc_nyp_get_price_thousand_separator()), 'currency_format' => esc_attr(str_replace(array('%1$s', '%2$s'), array('%s', '%v'), get_woocommerce_price_format())), 'annual_price_factors' => WC_Name_Your_Price_Helpers::annual_price_factors(), 'minimum_error' => WC_Name_Your_Price_Helpers::error_message('minimum_js'));
wp_localize_script('woocommerce-nyp', 'woocommerce_nyp_params', $params);
}
示例13: accounting
/**
* Get the accounting format from user settings
* POS uses a plugin to format currency: http://josscrowcroft.github.io/accounting.js/
*
* @return array $settings
*/
private function accounting()
{
$decimal = get_option('woocommerce_price_decimal_sep');
$thousand = get_option('woocommerce_price_thousand_sep');
$precision = get_option('woocommerce_price_num_decimals');
return array('currency' => array('decimal' => $decimal, 'format' => $this->currency_format(), 'precision' => $precision, 'symbol' => get_woocommerce_currency_symbol(get_woocommerce_currency()), 'thousand' => $thousand), 'number' => array('decimal' => $decimal, 'precision' => $precision, 'thousand' => $thousand));
}
示例14: enqueue_scripts
/**
* Register the stylesheets for the public-facing side of the site.
*
* @since 1.0.0
*/
public function enqueue_scripts()
{
global $post, $product;
if (is_object($post) && class_exists('WooCommerce')) {
$is_product_type_variable = 'false';
if (function_exists('wc_get_product')) {
$product = wc_get_product($post);
if ($product) {
if ($product->is_type('variable') && is_single()) {
$is_product_type_variable = 'true';
}
}
}
$attach_id = isset($_SESSION['attach_id']) && !empty($_SESSION['attach_id']) ? $_SESSION['attach_id'] : '';
if (!empty($attach_id)) {
$total_word = get_post_meta($attach_id, 'total_word', true);
} else {
$total_word = '';
}
if (!empty($attach_id)) {
$total_character = get_post_meta($attach_id, 'total_character', true);
} else {
$total_character = '';
}
wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/woocommerce-price-per-word-public.js', array('jquery'), $this->version, false);
if (wp_script_is($this->plugin_name)) {
wp_localize_script($this->plugin_name, 'woocommerce_price_per_word_params', apply_filters('woocommerce_price_per_word_params', array('ajax_url' => admin_url('admin-ajax.php'), 'woocommerce_price_per_word_params_nonce' => wp_create_nonce("woocommerce_price_per_word_params_nonce"), 'total_word' => $total_word, 'total_character' => $total_character, 'is_product_type_variable' => $is_product_type_variable, 'woocommerce_currency_symbol_js' => get_woocommerce_currency_symbol(), 'woocommerce_price_num_decimals' => wc_get_price_decimals(), 'aewcppw_word_character' => $this->wppw_get_product_type(), 'aewcppw_allow_users_to_enter_qty' => $this->aewcppw_allow_users_to_enter_qty())));
}
wp_enqueue_script($this->plugin_name . '-bn', plugin_dir_url(__FILE__) . 'js/woocommerce-price-per-word-bn.js', array('jquery'), $this->version, false);
}
}
开发者ID:angelleye,项目名称:woocommerce-price-per-word,代码行数:36,代码来源:class-woocommerce-price-per-word-public.php
示例15: addon_scripts
/**
* Enqueue addon scripts
*/
public function addon_scripts()
{
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_register_script('accounting', plugins_url(basename(dirname(dirname(__FILE__)))) . '/assets/js/accounting' . $suffix . '.js', '', '0.3.2');
wp_enqueue_script('woocommerce-addons', plugins_url(basename(dirname(dirname(__FILE__)))) . '/assets/js/addons' . $suffix . '.js', array('jquery', 'accounting'), '1.0', true);
$params = array('price_display_suffix' => esc_attr(get_option('woocommerce_price_display_suffix')), 'ajax_url' => WC()->ajax_url(), 'i18n_addon_total' => __('Options total:', 'grmpd-frames'), 'i18n_grand_total' => __('Grand total:', 'grmpd-frames'), 'i18n_remaining' => __('characters remaining', 'grmpd-frames'), 'currency_format_num_decimals' => absint(get_option('woocommerce_price_num_decimals')), 'currency_format_symbol' => get_woocommerce_currency_symbol(), 'currency_format_decimal_sep' => esc_attr(stripslashes(get_option('woocommerce_price_decimal_sep'))), 'currency_format_thousand_sep' => esc_attr(stripslashes(get_option('woocommerce_price_thousand_sep'))));
if (!function_exists('get_woocommerce_price_format')) {
$currency_pos = get_option('woocommerce_currency_pos');
switch ($currency_pos) {
case 'left':
$format = '%1$s%2$s';
break;
case 'right':
$format = '%2$s%1$s';
break;
case 'left_space':
$format = '%1$s %2$s';
break;
case 'right_space':
$format = '%2$s %1$s';
break;
}
$params['currency_format'] = esc_attr(str_replace(array('%1$s', '%2$s'), array('%s', '%v'), $format));
} else {
$params['currency_format'] = esc_attr(str_replace(array('%1$s', '%2$s'), array('%s', '%v'), get_woocommerce_price_format()));
}
wp_localize_script('woocommerce-addons', 'grmpd_frames_params', $params);
}