Skip to content

Commit 446d1ef

Browse files
authored
Version 1.6.1 - Maintenance release 🚧 (#23)
* 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
1 parent fac56ac commit 446d1ef

File tree

13 files changed

+230
-92
lines changed

13 files changed

+230
-92
lines changed

assets/js/checkout.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@
2222
},
2323
component: withInstanceId( ( { instanceId, checkoutExtensionData } ) => {
2424
const data = getSetting( '_woo_additional_terms_data', '' );
25+
const { setExtensionData } = checkoutExtensionData;
2526

2627
// Bail early if the checkbox label is empty.
2728
if ( ! data?.checkbox_label ) {
29+
useEffect( () => {
30+
setExtensionData( '_woo_additional_terms', 'data', '' );
31+
}, [] );
2832
return null;
2933
}
3034

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

4144
useEffect( () => {
42-
setExtensionData( '_woo_additional_terms', 'wat_checkbox', checked );
45+
setExtensionData( '_woo_additional_terms', 'data', checked ? 'yes' : 'no' );
4346

4447
if ( ! is_required ) {
4548
return;

assets/js/minified/checkout.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/woo-additional-terms.pot

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# This file is distributed under the GPL-3.0.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Woo Additional Terms 1.6.0\n"
5+
"Project-Id-Version: Woo Additional Terms 1.6.1\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-additional-terms\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <[email protected]>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2023-07-25T16:05:35+00:00\n"
12+
"POT-Creation-Date: 2023-08-11T09:10:47+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.8.1\n"
1515
"X-Domain: woo-additional-terms\n"
@@ -24,7 +24,7 @@ msgid "https://mypreview.one/woo-additional-terms"
2424
msgstr ""
2525

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

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

145+
#: src/Settings/Sections/General.php:87
146+
msgctxt "settings field default"
147+
msgid "I have read and agree to the website {{additional-terms}}"
148+
msgstr ""
149+
145150
#. translators: 1: Open paragraph tag, 2: Terms smart tag, 3: Close paragraph tag.
146-
#: src/Settings/Sections/General.php:99
151+
#: src/Settings/Sections/General.php:100
147152
msgctxt "settings field description"
148153
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"
149154
msgstr ""
150155

151-
#: src/Settings/Sections/General.php:106
156+
#: src/Settings/Sections/General.php:107
152157
msgctxt "settings field name"
153158
msgid "Required"
154159
msgstr ""
155160

156-
#: src/Settings/Sections/General.php:107
161+
#: src/Settings/Sections/General.php:108
157162
msgctxt "settings field description"
158163
msgid "Enable this to make the additional terms checkbox required."
159164
msgstr ""
160165

161-
#: src/Settings/Sections/General.php:113
166+
#: src/Settings/Sections/General.php:114
162167
msgctxt "settings field name"
163168
msgid "Error Message"
164169
msgstr ""
165170

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

171-
#: src/Settings/Sections/General.php:115
176+
#: src/Settings/Sections/General.php:116
172177
msgctxt "settings field placeholder"
173178
msgid "Please accept the additional terms to continue."
174179
msgstr ""
175180

176-
#: src/Settings/Sections/General.php:116
181+
#: src/Settings/Sections/General.php:117
177182
msgctxt "settings field default"
178183
msgid "Please accept the additional terms to continue."
179184
msgstr ""
@@ -188,23 +193,21 @@ msgctxt "settings tab"
188193
msgid "General"
189194
msgstr ""
190195

191-
#: src/WooCommerce/Block/Block.php:91
192-
#: src/WooCommerce/Checkout.php:201
196+
#: src/WooCommerce/Block/Block.php:120
193197
msgid "Customer accepted the additional terms."
194198
msgstr ""
195199

196-
#: src/WooCommerce/Block/Block.php:98
197-
#: src/WooCommerce/Checkout.php:208
200+
#: src/WooCommerce/Block/Block.php:121
198201
msgid "Customer did not accept the additional terms."
199202
msgstr ""
200203

201-
#: src/WooCommerce/Block/Block.php:150
202-
#: src/WooCommerce/Checkout.php:168
204+
#: src/WooCommerce/Block/Block.php:177
205+
#: src/WooCommerce/Checkout.php:173
203206
msgid "Please accept the additional terms to continue."
204207
msgstr ""
205208

206209
#. translators: %s: Render the type of the variable.
207-
#: src/WooCommerce/Block/Block.php:182
210+
#: src/WooCommerce/Block/Block.php:209
208211
msgid "Value of field %s was posted with incorrect data type."
209212
msgstr ""
210213

@@ -244,6 +247,10 @@ msgctxt "admin notice"
244247
msgid "I already did!"
245248
msgstr ""
246249

250+
#: templates/order/terms-acceptance.php:24
251+
msgid "Additional terms and conditions:"
252+
msgstr ""
253+
247254
#: templates/sidebar/docs.php:16
248255
msgctxt "upsell"
249256
msgid "Learn Settings"

readme.txt

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Contributors: mahdiyazdani, mypreview, gookaani
33
Tags: terms and conditions, I agree, age verification, terms of service, custom terms, woocommerce plugin, GDPR, terms conditions for woocommerce
44
Donate link: https://mypreview.one/woo-additional-terms
55
Requires at least: 5.0
6-
Tested up to: 6.2
6+
Tested up to: 6.3
77
Requires PHP: 7.4
8-
Stable tag: 1.6.0
8+
Stable tag: 1.6.1
99
License: GPLv3 or later
1010
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
1111

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

125125
== Changelog ==
126+
= 1.6.1 =
127+
* Prevented checkout error in the checkout block when additional terms & conditions are deactivated.
128+
* Enhanced display of additional terms acceptance below the billing address.
129+
* Ensured compatibility with the "WooCommerce PayPal Payments" plugin.
130+
* Verified compatibility with WordPress version 6.3.
131+
* Verified compatibility with WooCommerce version 8.0.
132+
126133
= 1.6.0 =
127134
* Added: Ability to define the status of the additional terms checkbox.
128135
* Added: Customization option to choose how the terms page is displayed (modal, embed, or new tab).
@@ -131,78 +138,77 @@ Yes, it does. The [Woo Additional Terms PRO](https://mypreview.one/woo-additiona
131138
* Improved: Optimized the underlying code structure for better performance and maintainability.
132139

133140
= 1.5.2 =
134-
* Compatibility with WordPress 6.2
135-
* Compatibility with WooCommerce 7.5
141+
* Compatibility with WordPress 6.2.
142+
* Compatibility with WooCommerce 7.5.
136143

137144
= 1.5.1 =
138-
* Update font-size for the checkout block
139-
* Compatibility with WooCommerce 7.4
145+
* Updated font-size for the checkout block.
146+
* Compatibility with WooCommerce 7.4.
140147

141148
= 1.5.0 =
142-
* Compatibility with WooCommerce Checkout block
143-
* Compatibility with WooCommerce 7.3
149+
* Compatibility with WooCommerce Checkout block.
150+
* Compatibility with WooCommerce 7.3.
144151

145152
= 1.4.1 =
146-
* Improved logic in displaying admin-notices.
153+
* Improved logic in displaying admin notices.
147154

148155
= 1.4.0 =
149-
* Compatibility with WooCommerce 7.2
156+
* Compatibility with WooCommerce 7.2.
150157

151158
= 1.3.6 =
152-
* Compatibility with WordPress 6.1
153-
* Compatibility with WooCommerce 7.0
159+
* Compatibility with WordPress 6.1.
160+
* Compatibility with WooCommerce 7.0.
154161

155162
= 1.3.5 =
156-
* Compatibility with WordPress 6.0
157-
* Compatibility with WooCommerce 6.9
163+
* Compatibility with WordPress 6.0.
164+
* Compatibility with WooCommerce 6.9.
158165

159166
= 1.3.4 =
160-
* Compatibility with WordPress 5.6
161-
* Compatibility with WooCommerce 4.8
167+
* Compatibility with WordPress 5.6.
168+
* Compatibility with WooCommerce 4.8.
162169

163170
= 1.3.3 =
164171
* Multiple code standards improvements.
165-
* Compatibility with WordPress 5.5
166-
* Compatibility with WooCommerce 4.4
172+
* Compatibility with WordPress 5.5.
173+
* Compatibility with WooCommerce 4.4.
167174

168175
= 1.3.2 =
169-
* Compatibility with WooCommerce 4.3
176+
* Compatibility with WooCommerce 4.3.
170177

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

174181
= 1.3.0 =
175-
* Additional terms content can now open up on the page when the link is clicked, and customers can review without leaving checkout.
176-
* Compatibility with WooCommerce 4.2.0
182+
* Additional terms content can now open up on the page when the link is clicked, allowing customers to review without leaving checkout.
183+
* Compatibility with WooCommerce 4.2.0.
177184

178185
= 1.2.2 =
179186
* Added language configuration file to support WPML/Polylang.
180-
* Compatibility with WordPress 5.4.1
181-
* Compatibility with WooCommerce 4.1.1
187+
* Compatibility with WordPress 5.4.1.
188+
* Compatibility with WooCommerce 4.1.1.
182189

183190
= 1.2.1 =
184191
* Multiple code standards improvements.
185-
* Compatibility with WordPress 5.4.0
186-
* Compatibility with WooCommerce 4.0.1
192+
* Compatibility with WordPress 5.4.0.
193+
* Compatibility with WooCommerce 4.0.1.
187194

188195
= 1.2.0 =
189196
* Updated language file.
190-
* Refactored and re-organized underlying code in plugin settings page/ controls.
191-
* Compatibility with WordPress 5.3.1
192-
* Compatibility with WooCommerce 3.8.1
197+
* Refactored and re-organized underlying code in plugin settings page/controls.
198+
* Compatibility with WordPress 5.3.1.
199+
* Compatibility with WooCommerce 3.8.1.
193200

194201
= 1.1.0 =
195-
* Compatible with WordPress 4.9.6
196-
* Compatible with WordPress 3.4.2
197-
198-
= 1.0.3 =
202+
* Compatible with WordPress 4.9.6.
203+
* Compatible with WooCommerce 3.4.2.
199204

200205
= 1.0.2 =
201-
* Compatible with WordPress 4.7.0
202-
* Compatible with WordPress 2.6.9
206+
* Compatible with WordPress 4.7.0.
207+
* Compatible with WooCommerce 2.6.9.
203208

204209
= 1.0.1 =
205210
* Added screenshots.
206211

207212
= 1.0.0 =
208213
* Initial release.
214+

0 commit comments

Comments
 (0)