Plugin Directory

Changeset 2421969


Ignore:
Timestamp:
11/20/2020 01:47:03 AM (5 years ago)
Author:
springthistle
Message:

Added ability to specify a currency symbol

Location:
very-simple-paypal-donation-form/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • very-simple-paypal-donation-form/trunk/lib/class.vsdf-main.php

    r2044834 r2421969  
    7676            'paypal_email' => '',
    7777            'the_currency' => 'USD',
     78            'the_currency_symbol' => '$',
    7879            'the_amounts' => '5, 25, 50, 100',
    7980            'default_checked_amount' => '25',
  • very-simple-paypal-donation-form/trunk/lib/class.vsdf-settings.php

    r2044834 r2421969  
    5151
    5252        add_settings_field(
     53            'the_currency_symbol',
     54            __( 'Currency Symbol', 'vsdf' ),
     55            array($this, 'the_currency_symbol_render'),
     56            'vsdf_page',
     57            'vsdf_donation_settings'
     58        );
     59
     60        add_settings_field(
    5361            'the_amounts',
    5462            __( 'Amount Options', 'vsdf' ),
     
    127135        $options = $vsdf->get_options();
    128136        ?>
    129         <input type='text' id="the_currency" name='vsdf_settings[the_currency]' value='<?php echo $options['the_currency']; ?>'>
     137        <input type='text' id="the_currency" name='vsdf_settings[the_currency]' value='<?php echo $options['the_currency']; ?>' style="width: 50px;">
    130138        <br />
    131139        <div class="note">A list of currency codes can be found on <a href="https://developer.paypal.com/docs/integration/direct/rest/currency-codes/" target-"_blank">PayPal's website</a>.</div>
     140        <?php
     141    }
     142
     143    function the_currency_symbol_render(  ) {
     144        global $vsdf;
     145        $options = $vsdf->get_options();
     146        ?>
     147        <input type='text' id="the_currency_symbol" name='vsdf_settings[the_currency_symbol]' value='<?php echo $options['the_currency_symbol']; ?>' style="width: 30px;">
    132148        <?php
    133149    }
  • very-simple-paypal-donation-form/trunk/readme.txt

    r2044836 r2421969  
    33Tags: donate, paypal, shortcode
    44Requires at least: 4.4
    5 Tested up to: 5.1
    6 Stable tag: 1.2
     5Tested up to: 5.5
     6Stable tag: 1.3
    77
    88Put a simple PayPal donation form on any post or page with a shortcode.
     
    3131== Changelog ==
    3232
     33= 1.3 =
     34* You can now specify a currency symbol to display on the form.
     35
    3336= 1.2 =
    3437* You can now specify currency.
  • very-simple-paypal-donation-form/trunk/views/donationform.php

    r2044834 r2421969  
    1313                $radios .= '<input class="hidden radio-label" type="radio" name="radio_amount" value="'.$amt.'" id="amount-'.$amt.'" ';
    1414                if ($checked == $amt) $radios .= 'checked="checked"';
    15                 $radios .= '/><label class="button-label" for="amount-'.$amt.'"><h1>$'.$amt.'</h1></label>';
     15                $radios .= '/><label class="button-label" for="amount-'.$amt.'"><h1>'.$options['the_currency_symbol'].$amt.'</h1></label>';
    1616                $css .= '#amount-'.$amt.':checked + .button-label { background: #0bd451; color: #efefef; }
    1717        #amount-'.$amt.':checked + .button-label:hover { background: #05ae40; color: #e2e2e2; }';
     
    2424            <label class="button-label" for="amount-other"><h1>Other</h1></label>
    2525            <div class="pre_dollar"><input type="number" id="amount-typed" name="amount-typed" value="<?php echo $options['other_amount']; ?>" /></div>
     26            <style type="text/css">#vsdf_form .pre_dollar:before { content: '<?php echo $options['the_currency_symbol'] ?>';}</style>
    2627        </div>
    2728
  • very-simple-paypal-donation-form/trunk/views/settings.php

    r1841023 r2421969  
    3737        html += '<label for="vsdf_settings[default_checked_amount]" class="amountsradio"><input type="radio" name="vsdf_settings[default_checked_amount]" value="'+amounts[i].trim()+'"';
    3838        if (radioValue == amounts[i].trim()) html += ' checked="checked"';
    39         html += '>$'+amounts[i].trim()+'</label> &nbsp; ';
     39        html += '>'+jQuery('#the_currency_symbol').val()+amounts[i].trim()+'</label> &nbsp; ';
    4040    }
    4141    jQuery('.amountsradio').parent().html(html);
  • very-simple-paypal-donation-form/trunk/vs_donor_form.php

    r2044834 r2421969  
    55* Author: Aaron Hodge Silver
    66* Author URI: http://springthistle.com/
    7 * Version: 1.2
     7* Version: 1.3
    88
    99    This program is free software: you can redistribute it and/or modify
Note: See TracChangeset for help on using the changeset viewer.