Showing with 28 additions and 17 deletions.
  1. +5 −0 CHANGELOG.md
  2. +8 −10 inc/woocommerce.php
  3. +3 −3 js/admin/ppom-admin.js
  4. +1 −1 package.json
  5. +9 −1 readme.txt
  6. +2 −2 woocommerce-product-addon.php
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### [Version 33.0.4](https://github.com/Codeinwp/woocommerce-product-addon/compare/v33.0.3...v33.0.4) (2024-10-07)

- Fixed an issue where the max checked option was not enforcing the selection limit, allowing users to select more options than specified.
- Fixed an issue where conditional logic based on checkbox selections was not functioning, preventing fields from being displayed correctly based on user choices.

##### [Version 33.0.3](https://github.com/Codeinwp/woocommerce-product-addon/compare/v33.0.2...v33.0.3) (2024-10-04)

- Fixed a PHP warning when saving a Font Picker meta field in the backend
Expand Down
18 changes: 8 additions & 10 deletions inc/woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,19 @@ function ppom_check_validation( $product_id, $post_data, $passed = true ) {
continue;
}

if ( ! isset( $field['required'] ) || 'on' !== $field['required'] ) {
continue;
}

$passed = apply_filters( 'ppom_before_fields_validation', $passed, $field, $post_data, $product_id );

if (
empty( $field['data_name'] ) &&
empty( $field['required'] ) &&
empty( $field['min_checked'] ) &&
empty( $field['max_checked'] )
empty( $field['data_name'] ) ||
(
( ! isset( $field['required'] ) || 'on' !== $field['required'] ) &&
empty( $field['min_checked'] ) &&
empty( $field['max_checked'] )
)
) {
continue;
}

$passed = apply_filters( 'ppom_before_fields_validation', $passed, $field, $post_data, $product_id );

$data_name = sanitize_key( $field['data_name'] );

$title = isset( $field['title'] ) ? $field['title'] : '';
Expand Down
6 changes: 3 additions & 3 deletions js/admin/ppom-admin.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// @ts-check
"use strict";

const FIELD_COMPATIBLE_WITH_SELECT_OPTIONS = [ 'select', 'radio', 'switcher', 'image','conditional_meta'];
const FIELD_COMPATIBLE_WITH_SELECT_OPTIONS = [ 'select', 'radio', 'switcher', 'image', 'conditional_meta' ];
const OPERATOR_COMPARISON_VALUE_FIELD_TYPE = {
'select': FIELD_COMPATIBLE_WITH_SELECT_OPTIONS,
'select': [...FIELD_COMPATIBLE_WITH_SELECT_OPTIONS, 'checkbox'],
}
const COMPARISON_VALUE_CAN_USE_SELECT = [ 'is', 'not', 'greater than', 'less than' ];
const HIDE_COMPARISON_INPUT_FIELD = ['any', 'empty', 'odd-number', 'even-number'];
const FIELDS_COMPATIBLE_WITH_TEXT = [ 'text', 'textarea', 'date', 'email' ]
const FIELDS_COMPATIBLE_WITH_NUMBERS = [ ...FIELD_COMPATIBLE_WITH_SELECT_OPTIONS, 'number' ];
const OPERATORS_FIELD_COMPATIBILITY = {
'is': [...FIELD_COMPATIBLE_WITH_SELECT_OPTIONS, ...FIELDS_COMPATIBLE_WITH_TEXT, ...FIELDS_COMPATIBLE_WITH_NUMBERS, 'checkbox',],
'is': [...FIELD_COMPATIBLE_WITH_SELECT_OPTIONS, ...FIELDS_COMPATIBLE_WITH_TEXT, ...FIELDS_COMPATIBLE_WITH_NUMBERS, 'checkbox'],
'not': [...FIELD_COMPATIBLE_WITH_SELECT_OPTIONS, ...FIELDS_COMPATIBLE_WITH_TEXT, ...FIELDS_COMPATIBLE_WITH_NUMBERS, 'checkbox'],
'greater than': FIELDS_COMPATIBLE_WITH_NUMBERS,
'less than': FIELDS_COMPATIBLE_WITH_NUMBERS,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "woocommerce-product-addon",
"version": "33.0.3",
"version": "33.0.4",
"description": "PPOM for WooCommerce",
"main": "index.js",
"repository": "https://github.com/Codeinwp/woocommerce-product-addon",
Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: themeisle
Tags: woocommerce product addons, woocommerce product options, woocommerce product fields, woocommerce product, product addons
Requires at least: 3.5
Tested up to: 6.6
Stable tag: 33.0.3
Stable tag: 33.0.4
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Requires PHP: 7.2
Expand Down Expand Up @@ -251,6 +251,14 @@ PPOM is an open-source project, and we welcome contributors to be part of our vi

== Changelog ==

##### [Version 33.0.4](https://github.com/Codeinwp/woocommerce-product-addon/compare/v33.0.3...v33.0.4) (2024-10-07)

- Fixed an issue where the max checked option was not enforcing the selection limit, allowing users to select more options than specified.
- Fixed an issue where conditional logic based on checkbox selections was not functioning, preventing fields from being displayed correctly based on user choices.




##### [Version 33.0.3](https://github.com/Codeinwp/woocommerce-product-addon/compare/v33.0.2...v33.0.3) (2024-10-04)

- Fixed a PHP warning when saving a Font Picker meta field in the backend
Expand Down
4 changes: 2 additions & 2 deletions woocommerce-product-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: PPOM for WooCommerce
* Plugin URI: https://themeisle.com/plugins/ppom-pro/
* Description: PPOM (Personalized Product Meta Manager) plugin allow WooCommerce Store Admin to create unlimited input fields and files to attach with Product Pages.
* Version: 33.0.3
* Version: 33.0.4
* Author: Themeisle
* Text Domain: woocommerce-product-addon
* Domain Path: /languages
Expand All @@ -27,7 +27,7 @@
define( 'PPOM_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
define( 'PPOM_WP_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __DIR__ ) ) );
define( 'PPOM_BASENAME', basename( PPOM_WP_PLUGIN_DIR ) );
define( 'PPOM_VERSION', '33.0.3' );
define( 'PPOM_VERSION', '33.0.4' );
define( 'PPOM_DB_VERSION', '32.0.0' );
define( 'PPOM_PRODUCT_META_KEY', '_product_meta_id' );
define( 'PPOM_TABLE_META', 'nm_personalized' );
Expand Down