PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.3
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.3
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / inc / admin / views / setup / steps / currency.php

currency.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.3, at inc/admin/views/setup/steps/currency.php

84 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for displaying currency form while setting up.
4 *
5 * @author ThimPres
6 * @package LearnPress/Admin/Views
7 * @version 3.0.0
8 */
9
10 defined( 'ABSPATH' ) or exit;
11
12 // $settings = LP_Settings::instance()->refresh();
13 $settings = LP_Settings::instance();
14 $currency = $settings->get( 'currency', 'USD' );
15 $preview_price = '';
16 ?>
17
18 <h2><?php _e( 'Currency', 'learnpress' ); ?></h2>
19
20 <table>
21 <tr>
22 <th><?php _e( 'Currency', 'learnpress' ); ?></th>
23 <td>
24 <select id="currency" name="settings[currency][currency]">
25 <?php
26 $payment_currencies = learn_press_currencies();
27 if ( $payment_currencies ) {
28 foreach ( $payment_currencies as $code => $symbol ) {
29 ?>
30 <option value="<?php echo esc_attr( $code ); ?>"
31 data-symbol="<?php echo learn_press_get_currency_symbol( $code ); ?>" <?php selected( $code == $currency ); ?>>
32 <?php echo wp_kses_post( $symbol ); ?>
33 </option>
34 <?php
35 }
36 }
37 ?>
38 </select>
39 </td>
40 </tr>
41 <tr>
42 <th><?php _e( 'Currency position', 'learnpress' ); ?></th>
43 <td>
44 <select id="currency-pos" name="settings[currency][currency_pos]">
45 <?php
46 $positions = array();
47 foreach ( learn_press_currency_positions() as $pos => $text ) {
48 ?>
49 <option value="<?php echo esc_attr( $pos ); ?>"<?php selected( $pos == $settings->get( 'currency_pos' ) ); ?>><?php echo wp_kses_post( $text ); ?></option>
50 <?php
51 }
52 ?>
53 </select>
54 </td>
55 </tr>
56 <tr>
57 <th><?php _e( 'Thousands Separator', 'learnpress' ); ?></th>
58 <td>
59 <input id="thousands-separator" type="text" name="settings[currency][thousands_separator]"
60 value="<?php echo esc_attr( $settings->get( 'thousands_separator', ',' ) ); ?>">
61 </td>
62 </tr>
63 <tr>
64 <th><?php _e( 'Decimal separator', 'learnpress' ); ?></th>
65 <td>
66 <input id="decimals-separator" type="text" name="settings[currency][decimals_separator]"
67 value="<?php echo esc_attr( $settings->get( 'decimals_separator', '.' ) ); ?>">
68 </td>
69 </tr>
70 <tr>
71 <th><?php _e( 'The number of decimals', 'learnpress' ); ?></th>
72 <td>
73 <input id="number-of-decimals" type="text" name="settings[currency][number_of_decimals]"
74 value="<?php echo esc_attr( $settings->get( 'number_of_decimals', '2' ) ); ?>">
75 </td>
76 </tr>
77 <tr>
78 <th></th>
79 <td>
80 <div id="preview-price"><?php echo learn_press_format_price( 1234.56, true ); ?></div>
81 </td>
82 </tr>
83 </table>
84