Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dparker1005 committed Jan 4, 2024
2 parents 1b01c9d + 973d2ce commit 753338d
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 20 deletions.
32 changes: 28 additions & 4 deletions languages/pmpro-variable-pricing-fr_FR.po
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Copyright (C) 2023 Paid Memberships Pro
# Copyright (C) 2024 Paid Memberships Pro
# This file is distributed under the same license as the Paid Memberships Pro - Variable Pricing Add On plugin.
msgid ""
msgstr ""
"Project-Id-Version: Paid Memberships Pro - Variable Pricing Add On 0.4.5\n"
"Project-Id-Version: Paid Memberships Pro - Variable Pricing Add On 0.4.6\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"Last-Translator: Paid Memberships Pro <[email protected]>\n"
"Language-Team: Paid Memberships Pro <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-02-01T07:15:50+00:00\n"
"POT-Creation-Date: 2024-01-04T17:07:32+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Generator: WP-CLI 2.9.0\n"
"X-Domain: pmpro-variable-pricing\n"

#. Plugin Name of the plugin
Expand Down Expand Up @@ -137,13 +137,18 @@ msgid "Your price:"
msgstr "Votre prix :"

#: pmpro-variable-pricing.php:364
<<<<<<< HEAD
#: pmpro-variable-pricing.php:367
=======
#: pmpro-variable-pricing.php:368
>>>>>>> dev
msgid "The highest accepted price is %1$s%2$s. Please enter a new amount."
msgstr "Le prix le plus élevé accepté est %1$s%2$s. Veuillez entrer un nouveau montant."

#~ msgid "Error: You tried to set the price on a level that doesn't have variable pricing. Please try again."
#~ msgstr "Erreur: Vous avez essayé de définir le prix à un niveau qui n'a pas de prix variable. Veuillez réessayer."

<<<<<<< HEAD
#: pmpro-variable-pricing.php:359
#~ msgid "The lowest accepted price is %1$s%2$s. Please enter a new amount."
#~ msgstr "Le prix accepté le plus bas est %1$s%2$s. Veuillez entrer un nouveau montant."
Expand All @@ -161,5 +166,24 @@ msgstr "Le prix le plus élevé accepté est %1$s%2$s. Veuillez entrer un nouvea
#~ msgstr "Visitez le forum de support client"

#: pmpro-variable-pricing.php:479
=======
#: pmpro-variable-pricing.php:360
#~ msgid "The lowest accepted price is %1$s%2$s. Please enter a new amount."
#~ msgstr "Le prix accepté le plus bas est %1$s%2$s. Veuillez entrer un nouveau montant."

#: pmpro-variable-pricing.php:479
#~ msgid "View Documentation"
#~ msgstr "Afficher la documentation"

#: pmpro-variable-pricing.php:479
#~ msgid "Docs"
#~ msgstr "Documentation"

#: pmpro-variable-pricing.php:480
#~ msgid "Visit Customer Support Forum"
#~ msgstr "Visitez le forum de support client"

#: pmpro-variable-pricing.php:480
>>>>>>> dev
#~ msgid "Support"
#~ msgstr "Support"
32 changes: 28 additions & 4 deletions languages/pmpro-variable-pricing.pot
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Copyright (C) 2023 Paid Memberships Pro
# Copyright (C) 2024 Paid Memberships Pro
# This file is distributed under the same license as the Paid Memberships Pro - Variable Pricing Add On plugin.
msgid ""
msgstr ""
"Project-Id-Version: Paid Memberships Pro - Variable Pricing Add On 0.4.5\n"
"Project-Id-Version: Paid Memberships Pro - Variable Pricing Add On 0.4.6\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"Last-Translator: Paid Memberships Pro <[email protected]>\n"
"Language-Team: Paid Memberships Pro <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-02-01T07:15:50+00:00\n"
"POT-Creation-Date: 2024-01-04T17:07:31+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
"X-Generator: WP-CLI 2.9.0\n"
"X-Domain: pmpro-variable-pricing\n"

#. Plugin Name of the plugin
Expand Down Expand Up @@ -115,6 +115,7 @@ msgstr ""
msgid "Your price:"
msgstr ""

<<<<<<< HEAD
#: pmpro-variable-pricing.php:359
msgid "The lowest accepted price is %1$s%2$s. Please enter a new amount."
msgstr ""
Expand All @@ -136,5 +137,28 @@ msgid "Visit Customer Support Forum"
msgstr ""

#: pmpro-variable-pricing.php:479
=======
#: pmpro-variable-pricing.php:360
msgid "The lowest accepted price is %1$s%2$s. Please enter a new amount."
msgstr ""

#: pmpro-variable-pricing.php:368
msgid "The highest accepted price is %1$s%2$s. Please enter a new amount."
msgstr ""

#: pmpro-variable-pricing.php:479
msgid "View Documentation"
msgstr ""

#: pmpro-variable-pricing.php:479
msgid "Docs"
msgstr ""

#: pmpro-variable-pricing.php:480
msgid "Visit Customer Support Forum"
msgstr ""

#: pmpro-variable-pricing.php:480
>>>>>>> dev
msgid "Support"
msgstr ""
19 changes: 10 additions & 9 deletions pmpro-variable-pricing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Paid Memberships Pro - Variable Pricing Add On
* Plugin URI: https://www.paidmembershipspro.com/add-ons/variable-pricing-add-on/
* Description: Allow customers to set their own price when checking out for your membership levels.
* Version: 0.4.5
* Version: 0.4.6
* Author: Paid Memberships Pro
* Author URI: https://www.paidmembershipspro.com
* Text Domain: pmpro-variable-pricing
Expand All @@ -20,7 +20,7 @@
- Set price is the "suggested price"
*/

define( 'PMPROVP_VERSION', '0.4.4' );
define( 'PMPROVP_VERSION', '0.4.6' );

/*
Load plugin textdomain.
Expand All @@ -40,10 +40,10 @@ function pmprovp_get_settings( $level_id ) {
'max_price' => '',
'suggested_price' => '',
);
$settings = get_option( "pmprovp_{$level_id}", $defaults );
$settings = array_merge( $defaults, $settings ); // make sure newly added settings have defaults appended

return $settings;
$existing_settings = empty( $level_id ) ? array() : get_option( "pmprovp_{$level_id}", array() );

return array_merge( $defaults, $existing_settings );
}

/*
Expand All @@ -66,7 +66,7 @@ function pmprovp_pmpro_membership_level_after_other_settings() {
$suggested_price = '';
}
?>
<h3 class="topborder"><?php esc_html_e( 'Variable Pricing', 'pmpro-variable-pricing' ); ?></h3>
<h2 class="topborder"><?php esc_html_e( 'Variable Pricing', 'pmpro-variable-pricing' ); ?></h2>
<p><?php esc_html_e( 'If variable pricing is enabled, users will be able to set their own price at checkout. That price will override any initial payment and billing amount values you set on this level. You can set the minimum, maxium, and suggested price for this level.', 'pmpro-variable-pricing' ); ?></p>

<table>
Expand Down Expand Up @@ -342,7 +342,8 @@ function pmprovp_pmpro_registration_checks( $continue ) {
// was a price passed in?
if ( isset( $_REQUEST['price'] ) ) {
// get values
$level_id = intval( $_REQUEST['level'] );
$level = pmpro_getLevelAtCheckout();
$level_id = empty( $level->id ) ? null : intval( $level->id );
$vpfields = pmprovp_get_settings( $level_id );

// Bail if the Variable Pricing is not set for this level.
Expand Down Expand Up @@ -423,12 +424,12 @@ function pmprovp_load_scripts() {
}

// Bail if PMPro is not loaded.
if ( ! function_exists( 'pmpro_getOption' ) ) {
if ( ! function_exists( 'pmpro_getGateway' ) ) {
return;
}

if ( empty( $gateway ) ) {
$gateway = pmpro_getOption( 'gateway' );
$gateway = get_option( 'pmpro_gateway' );
}

wp_register_script( 'pmprovp', plugins_url( 'javascript/pmpro-variable-pricing.js', __FILE__ ), array( 'jquery' ), PMPROVP_VERSION, true );
Expand Down
11 changes: 8 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=== Paid Memberships Pro - Variable Pricing Add On ===
Contributors: strangerstudios
Tags: paid memberships pro, pmpro, membership, donate, donations, charity, charities
Requires at least: 4.0
Tested up to: 5.4
Stable tag: .4.4
Requires at least: 5.2
Tested up to: 6.4
Stable tag: 0.4.6

Allow customers to set their own price when checking out for your membership levels.

Expand All @@ -23,6 +23,11 @@ This plugin requires Paid Memberships Pro.
Please post it in the issues section of GitHub and we'll fix it as soon as we can. Thanks for helping. https://github.com/strangerstudios/pmpro-variable-pricing/issues

== Changelog ==
= 0.4.6 - 2024-01-04 =
* ENHANCEMENT: Updating `<h3>` tags to `<h2>` tags for better accessibility. #44 (@ipokkel)
* BUG FIX: Fixed PHP warning if an empty level ID is passed to `pmprovp_get_settings()`. #43 (@dparker1005)
* REFACTOR: No longer pulling the checkout level from the `$_REQUEST` variable. #43 (@dparker1005)
* REFACTOR: Now using `get_option()` instead of `pmpro_getOption()`. #42 (@JarrydLong)

= 0.4.5 - 2023-01-30 =
* ENHANCEMENT: Improved translation logic within the plugin and translated some missing strings.
Expand Down

0 comments on commit 753338d

Please sign in to comment.