/** * change_currency_symbol. * * @version 2.4.4 */ public function change_currency_symbol($currency_symbol, $currency) { global $product; if (is_object($product) && isset($product->product_type) && 'external' === $product->product_type) { return wcj_get_currency_symbol(get_option('wcj_currency_external_products_symbol')); } return $currency_symbol; }
/** * change_currency_symbol. * * @version 2.4.4 */ function change_currency_symbol($currency_symbol, $currency) { if ('yes' === get_option('wcj_currency_hide_symbol')) { return ''; } // return apply_filters( 'booster_get_option', wcj_get_currency_symbol( $currency ), get_option( 'wcj_currency_' . $currency, $currency_symbol ) ); // TODO: custom currency return wcj_get_currency_symbol($currency); }
/** * change_currency_symbol_reports. */ function change_currency_symbol_reports($currency_symbol, $currency) { if (isset($_GET['page']) && 'wc-reports' === $_GET['page']) { if (isset($_GET['currency'])) { return 'merge' === $_GET['currency'] ? '' : wcj_get_currency_symbol($_GET['currency']); } } return $currency_symbol; }
/** * change_currency_symbol. */ public function change_currency_symbol($currency_symbol, $currency) { if ($this->is_cart_or_checkout()) { global $woocommerce; $current_gateway = $woocommerce->session->chosen_payment_method; if ('' != $current_gateway) { $gateway_currency = get_option('wcj_gateways_currency_' . $current_gateway); return wcj_get_currency_symbol($gateway_currency); } } return $currency_symbol; }
/** * change_currency_symbol_on_product_edit. */ function change_currency_symbol_on_product_edit($currency_symbol, $currency) { if (is_admin()) { global $pagenow; if ('post.php' === $pagenow && isset($_GET['action']) && 'edit' === $_GET['action']) { $multicurrency_base_price_currency = get_post_meta(get_the_ID(), '_' . 'wcj_multicurrency_base_price_currency', true); if ('' != $multicurrency_base_price_currency) { return wcj_get_currency_symbol($multicurrency_base_price_currency); } } } return $currency_symbol; }
/** * add_settings. * * @version 2.5.8 * @since 2.5.2 */ function add_settings() { $settings = array(array('title' => __('Formats', 'woocommerce-jetpack'), 'type' => 'title', 'id' => 'wcj_price_formats_options'), array('title' => __('Total Number', 'woocommerce-jetpack'), 'id' => 'wcj_price_formats_total_number', 'default' => 1, 'type' => 'custom_number', 'desc' => apply_filters('booster_get_message', '', 'desc'), 'custom_attributes' => array_merge(is_array(apply_filters('booster_get_message', '', 'readonly')) ? apply_filters('booster_get_message', '', 'readonly') : array(), array('step' => '1', 'min' => '0')))); for ($i = 1; $i <= apply_filters('booster_get_option', 1, get_option('wcj_price_formats_total_number', 1)); $i++) { $currency_symbol = wcj_get_currency_symbol(get_option('wcj_price_formats_currency_' . $i, get_woocommerce_currency())); $settings = array_merge($settings, array(array('title' => __('Format', 'woocommerce-jetpack') . ' #' . $i, 'desc' => __('Currency', 'woocommerce-jetpack'), 'id' => 'wcj_price_formats_currency_' . $i, 'default' => get_woocommerce_currency(), 'type' => 'select', 'options' => wcj_get_currencies_names_and_symbols(), 'css' => 'width:300px;'), array('desc' => __('Currency Position', 'woocommerce-jetpack'), 'id' => 'wcj_price_formats_currency_position_' . $i, 'default' => get_option('woocommerce_currency_pos'), 'type' => 'select', 'options' => array('left' => __('Left', 'woocommerce') . ' (' . $currency_symbol . '99.99)', 'right' => __('Right', 'woocommerce') . ' (99.99' . $currency_symbol . ')', 'left_space' => __('Left with space', 'woocommerce') . ' (' . $currency_symbol . ' 99.99)', 'right_space' => __('Right with space', 'woocommerce') . ' (99.99 ' . $currency_symbol . ')'), 'css' => 'width:300px;'), array('desc' => __('Thousand Separator', 'woocommerce-jetpack'), 'id' => 'wcj_price_formats_thousand_separator_' . $i, 'default' => wc_get_price_thousand_separator(), 'type' => 'text', 'css' => 'width:300px;'), array('desc' => __('Decimal Separator', 'woocommerce-jetpack'), 'id' => 'wcj_price_formats_decimal_separator_' . $i, 'default' => wc_get_price_decimal_separator(), 'type' => 'text', 'css' => 'width:300px;'), array('desc' => __('Number of Decimals', 'woocommerce-jetpack'), 'id' => 'wcj_price_formats_number_of_decimals_' . $i, 'default' => wc_get_price_decimals(), 'type' => 'number', 'custom_attributes' => array('min' => 0, 'step' => 1), 'css' => 'width:300px;'), array('desc' => __('WPML Language Code', 'woocommerce-jetpack'), 'desc_tip' => __('Option to set different price formats for different WPML languages. Can be comma separated list. Leave empty to disable.', 'woocommerce-jetpack'), 'id' => 'wcj_price_formats_wpml_language_' . $i, 'default' => '', 'type' => 'text', 'css' => 'width:300px;'))); } $settings = array_merge($settings, array(array('type' => 'sectionend', 'id' => 'wcj_price_formats_options'))); return $settings; }
/** * get_all_options_html. */ public function get_all_options_html($simple_or_variable, $current_post_id, $total_number, $variation_id_addon = '') { $html = ''; $options = $this->get_prices_options(); for ($i = 1; $i <= $total_number; $i++) { if ('variable' == $simple_or_variable) { $html .= '<div>'; } //if ( 'simple' == $simple_or_variable ) { $html .= '<p>'; $html .= '<strong>'; $html .= __('Country Group Nr.', 'woocommerce-jetpack') . ' ' . $i; $html .= ': '; $html .= get_option('wcj_price_by_country_exchange_rate_countries_group_' . $i); $html .= '</strong>'; $html .= '</p>'; //} //elseif ( 'variable' == $simple_or_variable ) { // $html .= '<tr>'; //} foreach ($options as $option) { // $option_id = $option['id'] . $i . $variation_id_addon; $option_id = $option['id'] . $i; if ('simple' == $simple_or_variable) { $html .= '<p class="form-field ' . $option_id . $variation_id_addon . '_field">'; } else { $column_position = 'full'; if ('checkbox' != $option['type']) { $column_position = false !== strpos($option['id'], '_regular_price_') ? 'first' : 'last'; } $html .= '<p class="form-row form-row-' . $column_position . '">'; } $group_currency_code = get_option('wcj_price_by_country_exchange_rate_currency_group_' . $i); $currency_code_html = 'checkbox' != $option['type'] ? ' (' . wcj_get_currency_symbol($group_currency_code) . ')' : ''; $html .= '<label for="' . $option_id . $variation_id_addon . '">' . $option['title'] . $currency_code_html . '</label>'; //} //elseif ( 'variable' == $simple_or_variable ) { // $html .= '<td>'; //} $html .= $this->get_option_field_html($current_post_id, $option_id, $option, $variation_id_addon); //if ( 'simple' == $simple_or_variable ) { $html .= '</p>'; //} //elseif ( 'variable' == $simple_or_variable ) { // $html .= '</td>'; //} } //if ( 'variable' == $simple_or_variable ) { // $html .= '</tr>'; //} if ('variable' == $simple_or_variable) { $html .= '</div>'; } } return $html; }
/** * change_currency_symbol. * * @version 2.5.0 */ function change_currency_symbol($currency_symbol, $currency) { if ($this->do_revert()) { return $currency_symbol; } return wcj_get_currency_symbol($this->get_current_currency_code($currency)); }
/** * change_currency_symbol. * * @version 2.5.2 * @since 2.5.2 */ function change_currency_symbol($currency_symbol, $currency) { $the_ID = get_the_ID(); if (0 != $the_ID && 'product' === get_post_type($the_ID)) { $currency_per_product_currency = get_post_meta($the_ID, '_' . 'wcj_currency_per_product_currency', true); if ('' != $currency_per_product_currency) { return wcj_get_currency_symbol($currency_per_product_currency); } } return $currency_symbol; }
/** * change_currency_symbol. */ public function change_currency_symbol($currency_symbol, $currency) { if (null != ($group_id = $this->get_customer_country_group_id())) { $country_currency_code = get_option('wcj_price_by_country_exchange_rate_currency_group_' . $group_id); if ('' != $country_currency_code) { return wcj_get_currency_symbol($country_currency_code); } } return $currency_symbol; }