Skip to content

Commit

Permalink
Version 1.6.1 - Maintenance release 🚧 (#23)
Browse files Browse the repository at this point in the history
* fix: Error when additional terms deactivated

* Generated

* Add new version changelog

* feat: Show the terms acceptance on the order page

* Load Order class

* fix: Remove unused imports

* fix: Add default value to the notice field

* fix: Unify saving terms acceptance

* feat: Display terms acceptance status

* Bump plugin version

* fix: Ensure page content runs through the_content filter

* Update changelog

* fix: Update post-meta
  • Loading branch information
mahdiyazdani authored Aug 15, 2023
1 parent fac56ac commit 446d1ef
Show file tree
Hide file tree
Showing 13 changed files with 230 additions and 92 deletions.
7 changes: 5 additions & 2 deletions assets/js/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@
},
component: withInstanceId( ( { instanceId, checkoutExtensionData } ) => {
const data = getSetting( '_woo_additional_terms_data', '' );
const { setExtensionData } = checkoutExtensionData;

// Bail early if the checkbox label is empty.
if ( ! data?.checkbox_label ) {
useEffect( () => {
setExtensionData( '_woo_additional_terms', 'data', '' );
}, [] );
return null;
}

const { checkbox_label, is_required, display_action, page_content, error_message } = data;
const validationErrorId = `_woo_additional_terms_data_${ instanceId }`;
const { setExtensionData } = checkoutExtensionData;
const [ checked, setChecked ] = useState( false );
const { setValidationErrors, clearValidationError } = useDispatch( VALIDATION_STORE_KEY );
const error = useSelect( ( select ) =>
Expand All @@ -39,7 +42,7 @@
const hasError = !! ( error?.message && ! error?.hidden );

useEffect( () => {
setExtensionData( '_woo_additional_terms', 'wat_checkbox', checked );
setExtensionData( '_woo_additional_terms', 'data', checked ? 'yes' : 'no' );

if ( ! is_required ) {
return;
Expand Down
2 changes: 1 addition & 1 deletion assets/js/minified/checkout.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 24 additions & 17 deletions languages/woo-additional-terms.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPL-3.0.
msgid ""
msgstr ""
"Project-Id-Version: Woo Additional Terms 1.6.0\n"
"Project-Id-Version: Woo Additional Terms 1.6.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-additional-terms\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[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-07-25T16:05:35+00:00\n"
"POT-Creation-Date: 2023-08-11T09:10:47+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.8.1\n"
"X-Domain: woo-additional-terms\n"
Expand All @@ -24,7 +24,7 @@ msgid "https://mypreview.one/woo-additional-terms"
msgstr ""

#. Description of the plugin
msgid "Add additional terms and conditions checkbox to your WooCommerce checkout page."
msgid "Improve your checkout process by adding an extra checkbox for terms and conditions. Keep track of acceptance to ensure transparency and security."
msgstr ""

#. Author of the plugin
Expand Down Expand Up @@ -142,38 +142,43 @@ msgctxt "settings field placeholder"
msgid "I have read and agree to the website {{additional-terms}}"
msgstr ""

#: src/Settings/Sections/General.php:87
msgctxt "settings field default"
msgid "I have read and agree to the website {{additional-terms}}"
msgstr ""

#. translators: 1: Open paragraph tag, 2: Terms smart tag, 3: Close paragraph tag.
#: src/Settings/Sections/General.php:99
#: src/Settings/Sections/General.php:100
msgctxt "settings field description"
msgid "%1$sUse the %2$s smart tag in the Terms Text to automatically display the linked terms page title in your checkbox label.%3$s"
msgstr ""

#: src/Settings/Sections/General.php:106
#: src/Settings/Sections/General.php:107
msgctxt "settings field name"
msgid "Required"
msgstr ""

#: src/Settings/Sections/General.php:107
#: src/Settings/Sections/General.php:108
msgctxt "settings field description"
msgid "Enable this to make the additional terms checkbox required."
msgstr ""

#: src/Settings/Sections/General.php:113
#: src/Settings/Sections/General.php:114
msgctxt "settings field name"
msgid "Error Message"
msgstr ""

#: src/Settings/Sections/General.php:114
#: src/Settings/Sections/General.php:115
msgctxt "settings field description"
msgid "Add an error message to show if the customer does not accept the additional terms."
msgstr ""

#: src/Settings/Sections/General.php:115
#: src/Settings/Sections/General.php:116
msgctxt "settings field placeholder"
msgid "Please accept the additional terms to continue."
msgstr ""

#: src/Settings/Sections/General.php:116
#: src/Settings/Sections/General.php:117
msgctxt "settings field default"
msgid "Please accept the additional terms to continue."
msgstr ""
Expand All @@ -188,23 +193,21 @@ msgctxt "settings tab"
msgid "General"
msgstr ""

#: src/WooCommerce/Block/Block.php:91
#: src/WooCommerce/Checkout.php:201
#: src/WooCommerce/Block/Block.php:120
msgid "Customer accepted the additional terms."
msgstr ""

#: src/WooCommerce/Block/Block.php:98
#: src/WooCommerce/Checkout.php:208
#: src/WooCommerce/Block/Block.php:121
msgid "Customer did not accept the additional terms."
msgstr ""

#: src/WooCommerce/Block/Block.php:150
#: src/WooCommerce/Checkout.php:168
#: src/WooCommerce/Block/Block.php:177
#: src/WooCommerce/Checkout.php:173
msgid "Please accept the additional terms to continue."
msgstr ""

#. translators: %s: Render the type of the variable.
#: src/WooCommerce/Block/Block.php:182
#: src/WooCommerce/Block/Block.php:209
msgid "Value of field %s was posted with incorrect data type."
msgstr ""

Expand Down Expand Up @@ -244,6 +247,10 @@ msgctxt "admin notice"
msgid "I already did!"
msgstr ""

#: templates/order/terms-acceptance.php:24
msgid "Additional terms and conditions:"
msgstr ""

#: templates/sidebar/docs.php:16
msgctxt "upsell"
msgid "Learn Settings"
Expand Down
74 changes: 40 additions & 34 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Contributors: mahdiyazdani, mypreview, gookaani
Tags: terms and conditions, I agree, age verification, terms of service, custom terms, woocommerce plugin, GDPR, terms conditions for woocommerce
Donate link: https://mypreview.one/woo-additional-terms
Requires at least: 5.0
Tested up to: 6.2
Tested up to: 6.3
Requires PHP: 7.4
Stable tag: 1.6.0
Stable tag: 1.6.1
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.txt

Expand Down Expand Up @@ -123,6 +123,13 @@ Yes, it does. The [Woo Additional Terms PRO](https://mypreview.one/woo-additiona
5. Additional terms and condition checkbox on the WooCommerce checkout block page.

== Changelog ==
= 1.6.1 =
* Prevented checkout error in the checkout block when additional terms & conditions are deactivated.
* Enhanced display of additional terms acceptance below the billing address.
* Ensured compatibility with the "WooCommerce PayPal Payments" plugin.
* Verified compatibility with WordPress version 6.3.
* Verified compatibility with WooCommerce version 8.0.

= 1.6.0 =
* Added: Ability to define the status of the additional terms checkbox.
* Added: Customization option to choose how the terms page is displayed (modal, embed, or new tab).
Expand All @@ -131,78 +138,77 @@ Yes, it does. The [Woo Additional Terms PRO](https://mypreview.one/woo-additiona
* Improved: Optimized the underlying code structure for better performance and maintainability.

= 1.5.2 =
* Compatibility with WordPress 6.2
* Compatibility with WooCommerce 7.5
* Compatibility with WordPress 6.2.
* Compatibility with WooCommerce 7.5.

= 1.5.1 =
* Update font-size for the checkout block
* Compatibility with WooCommerce 7.4
* Updated font-size for the checkout block.
* Compatibility with WooCommerce 7.4.

= 1.5.0 =
* Compatibility with WooCommerce Checkout block
* Compatibility with WooCommerce 7.3
* Compatibility with WooCommerce Checkout block.
* Compatibility with WooCommerce 7.3.

= 1.4.1 =
* Improved logic in displaying admin-notices.
* Improved logic in displaying admin notices.

= 1.4.0 =
* Compatibility with WooCommerce 7.2
* Compatibility with WooCommerce 7.2.

= 1.3.6 =
* Compatibility with WordPress 6.1
* Compatibility with WooCommerce 7.0
* Compatibility with WordPress 6.1.
* Compatibility with WooCommerce 7.0.

= 1.3.5 =
* Compatibility with WordPress 6.0
* Compatibility with WooCommerce 6.9
* Compatibility with WordPress 6.0.
* Compatibility with WooCommerce 6.9.

= 1.3.4 =
* Compatibility with WordPress 5.6
* Compatibility with WooCommerce 4.8
* Compatibility with WordPress 5.6.
* Compatibility with WooCommerce 4.8.

= 1.3.3 =
* Multiple code standards improvements.
* Compatibility with WordPress 5.5
* Compatibility with WooCommerce 4.4
* Compatibility with WordPress 5.5.
* Compatibility with WooCommerce 4.4.

= 1.3.2 =
* Compatibility with WooCommerce 4.3
* Compatibility with WooCommerce 4.3.

= 1.3.1 =
* Display the acceptance of terms & conditions on the order edit page.

= 1.3.0 =
* Additional terms content can now open up on the page when the link is clicked, and customers can review without leaving checkout.
* Compatibility with WooCommerce 4.2.0
* Additional terms content can now open up on the page when the link is clicked, allowing customers to review without leaving checkout.
* Compatibility with WooCommerce 4.2.0.

= 1.2.2 =
* Added language configuration file to support WPML/Polylang.
* Compatibility with WordPress 5.4.1
* Compatibility with WooCommerce 4.1.1
* Compatibility with WordPress 5.4.1.
* Compatibility with WooCommerce 4.1.1.

= 1.2.1 =
* Multiple code standards improvements.
* Compatibility with WordPress 5.4.0
* Compatibility with WooCommerce 4.0.1
* Compatibility with WordPress 5.4.0.
* Compatibility with WooCommerce 4.0.1.

= 1.2.0 =
* Updated language file.
* Refactored and re-organized underlying code in plugin settings page/ controls.
* Compatibility with WordPress 5.3.1
* Compatibility with WooCommerce 3.8.1
* Refactored and re-organized underlying code in plugin settings page/controls.
* Compatibility with WordPress 5.3.1.
* Compatibility with WooCommerce 3.8.1.

= 1.1.0 =
* Compatible with WordPress 4.9.6
* Compatible with WordPress 3.4.2

= 1.0.3 =
* Compatible with WordPress 4.9.6.
* Compatible with WooCommerce 3.4.2.

= 1.0.2 =
* Compatible with WordPress 4.7.0
* Compatible with WordPress 2.6.9
* Compatible with WordPress 4.7.0.
* Compatible with WooCommerce 2.6.9.

= 1.0.1 =
* Added screenshots.

= 1.0.0 =
* Initial release.

Loading

0 comments on commit 446d1ef

Please sign in to comment.