Plugin Directory

Changeset 3411540


Ignore:
Timestamp:
12/05/2025 12:01:13 AM (4 months ago)
Author:
asanaplugins
Message:

Update to version 6.13.0 from GitHub

Location:
easy-product-bundles-for-woocommerce
Files:
12 deleted
48 edited
1 copied

Legend:

Unmodified
Added
Removed
  • easy-product-bundles-for-woocommerce/tags/6.13.0/easy-product-bundles.php

    r3406359 r3411540  
    77 * Description: Create product bundles in WooCommerce easily
    88 * Tags: woocommerce, product bundles, bundled products
    9  * Version: 6.12.3
     9 * Version: 6.13.0
    1010 * Author: Product Bundles Team
    1111 * Author URI: https://www.asanaplugins.com/
     
    1414 * Domain Path: /languages
    1515 * WC requires at least: 3.0
    16  * WC tested up to: 10.3.5
     16 * WC tested up to: 10.3.6
    1717 *
    1818 * Copyright 2025 Asana Plugins (https://www.asanaplugins.com/)
     
    2525// Plugin version.
    2626if ( ! defined( 'ASNP_WEPB_VERSION' ) ) {
    27     define( 'ASNP_WEPB_VERSION', '6.12.3' );
     27    define( 'ASNP_WEPB_VERSION', '6.13.0' );
    2828}
    2929
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-ar-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    196196            "Change the button label shown for bundle products in the shop page.": [
    197197                "غيّر تسمية الزر المعروضة لمنتجات الحزمة في صفحة المتجر."
    198             ]
     198            ],
     199            "None": [ "لا شيء" ]
    199200        }
    200201    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-bg_BG-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    211211            "Change the button label shown for bundle products in the shop page.": [
    212212                "Променете етикета на бутона, показан за пакетни продукти в страницата на магазина."
    213             ]
     213            ],
     214            "None": [ "Няма" ]
    214215        }
    215216    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-da_DK-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    199199            "Change the button label shown for bundle products in the shop page.": [
    200200                "Ændr knapetiketten, der vises for pakkeprodukter på butikssiden."
    201             ]
     201            ],
     202            "None": [ "Ingen" ]
    202203        }
    203204    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-de_DE.po

    r3393297 r3411540  
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/easy-product-bundles-for-woocommerce\n"
    77"POT-Creation-Date: 2025-09-09T20:02:22+00:00\n"
    8 "PO-Revision-Date: 2025-10-03 15:24+0330\n"
     8"PO-Revision-Date: 2025-12-04 23:32+0330\n"
    99"Last-Translator: \n"
    1010"Language-Team: \n"
     
    353353msgstr "Nach den Produkt Meta"
    354354
    355 #: assets/js/admin/admin/index.js:2
     355#: assets/js/admin/admin/index.js:2 assets/js/admin/product/index.js:2
    356356msgid "None"
    357357msgstr "Keine"
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-es_ES.po

    r3393297 r3411540  
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/easy-product-bundles-for-woocommerce\n"
    77"POT-Creation-Date: 2025-09-10T21:42:35+00:00\n"
    8 "PO-Revision-Date: 2025-10-03 15:22+0330\n"
     8"PO-Revision-Date: 2025-12-04 23:36+0330\n"
    99"Last-Translator: \n"
    1010"Language-Team: \n"
     
    362362msgstr "Después de los metadatos del producto"
    363363
    364 #: assets/js/admin/admin/index.js:2
     364#: assets/js/admin/admin/index.js:2 assets/js/admin/product/index.js:2
    365365msgid "None"
    366366msgstr "Ninguno"
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-fa_IR-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    202202            "Change the button label shown for bundle products in the shop page.": [
    203203                "برچسب دکمه نمایش داده‌شده برای محصولات بسته در صفحه فروشگاه را تغییر دهید."
    204             ]
     204            ],
     205            "None": [ "هیچکدام" ]
    205206        }
    206207    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-fr_FR.po

    r3393297 r3411540  
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/easy-product-bundles-for-woocommerce\n"
    77"POT-Creation-Date: 2025-09-09T20:02:22+00:00\n"
    8 "PO-Revision-Date: 2025-10-03 15:23+0330\n"
     8"PO-Revision-Date: 2025-12-04 23:31+0330\n"
    99"Last-Translator: \n"
    1010"Language-Team: \n"
     
    364364msgstr "Après les méta du produit"
    365365
    366 #: assets/js/admin/admin/index.js:2
     366#: assets/js/admin/admin/index.js:2 assets/js/admin/product/index.js:2
    367367msgid "None"
    368368msgstr "Aucun"
     
    14581458msgid "This option allows you to show or hide the product search field in the popup window."
    14591459msgstr "Cette option vous permet d’afficher ou de masquer le champ de recherche de produit dans la fenêtre contextuelle."
    1460 
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-he_IL-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    191191            "Change the button label shown for bundle products in the shop page.": [
    192192                "שנה את תווית הכפתור המוצגת עבור מוצרי חבילה בדף החנות."
    193             ]
     193            ],
     194            "None": [ "אין" ]
    194195        }
    195196    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-hi_IN-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    195195            "Change the button label shown for bundle products in the shop page.": [
    196196                "शॉप पेज पर बंडल उत्पादों के लिए दिखाए जाने वाले बटन लेबल को बदलें।"
    197             ]
     197            ],
     198            "None": [ "कोई नहीं" ]
    198199        }
    199200    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-it_IT-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    210210            "Change the button label shown for bundle products in the shop page.": [
    211211                "Modifica l'etichetta del pulsante mostrata per i prodotti pacchetto nella pagina del negozio."
    212             ]
     212            ],
     213            "None": [ "Nessuno" ]
    213214        }
    214215    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-ja-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    195195            "Change the button label shown for bundle products in the shop page.": [
    196196                "ショップページで表示されるバンドル商品のボタンラベルを変更します。"
    197             ]
     197            ],
     198            "None": [ "なし" ]
    198199        }
    199200    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-nl_NL-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    207207            "Change the button label shown for bundle products in the shop page.": [
    208208                "Wijzig het knoplabel dat wordt weergegeven voor bundelproducten op de winkelpagina."
    209             ]
     209            ],
     210            "None": [ "Geen" ]
    210211        }
    211212    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-pl_PL-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    202202            "Change the button label shown for bundle products in the shop page.": [
    203203                "Zmień etykietę przycisku wyświetlaną dla produktów pakietowych na stronie sklepu."
    204             ]
     204            ],
     205            "None": [ "Żaden" ]
    205206        }
    206207    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-pt_PT-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    202202            "Change the button label shown for bundle products in the shop page.": [
    203203                "Altere a etiqueta do botão exibida para produtos em pacote na página da loja."
    204             ]
     204            ],
     205            "None": [ "Nenhum" ]
    205206        }
    206207    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-ru_RU-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    210210            "Change the button label shown for bundle products in the shop page.": [
    211211                "Измените подпись кнопки, отображаемую для комплектных товаров на странице магазина."
    212             ]
     212            ],
     213            "None": [ "Никакой" ]
    213214        }
    214215    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-tr_TR-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    205205            "Change the button label shown for bundle products in the shop page.": [
    206206                "Mağaza sayfasında paket ürünleri için gösterilen düğme etiketini değiştir."
    207             ]
     207            ],
     208            "None": [ "Hiçbiri" ]
    208209        }
    209210    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/languages/asnp-easy-product-bundles-zh_CN-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    184184            "Change the button label shown for bundle products in the shop page.": [
    185185                "更改商店页面中显示的套餐产品按钮标签。"
    186             ]
     186            ],
     187            "None": [ "无" ]
    187188        }
    188189    }
  • easy-product-bundles-for-woocommerce/tags/6.13.0/readme.txt

    r3406359 r3411540  
    44Tags: woocommerce product bundle, woocommerce bundle, product bundle woocommerce, composite product, wpc product bundles for woocommerce, yith woocommerce product bundles, woocommerce product bundles free, wpc product bundles, yith product bundles, custom product boxes woocommerce, woocommerce bundle plugin, woocommerce composite products, woocommerce, wordpress, ecommerce
    55Requires at least: 5.0
    6 Tested up to: 6.8
     6Tested up to: 6.9
    77Requires PHP: 5.6
    8 Stable tag: 6.12.3
     8Stable tag: 6.13.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    216216== Changelog ==
    217217
     218= 6.13.0 =
     219* New: Introduced a None option for discount types.
     220* Ensured compatibility with WordPress version 6.9
     221* Ensured compatibility with WooCommerce version 10.3.6
     222
    218223= 6.12.3 =
    219224* Fix: Resolved an issue that occurred when creating bundles with a large number of items.
  • easy-product-bundles-for-woocommerce/tags/6.13.0/src/Admin/ProductBundle.php

    r3406359 r3411540  
    188188            'query_relation' => 'OR',
    189189            'edit_quantity' => 'false',
    190             'discount_type' => 'percentage',
     190            'discount_type' => 'none',
    191191            'discount' => '',
    192192            'product' => '',
  • easy-product-bundles-for-woocommerce/tags/6.13.0/src/Helpers.php

    r3378492 r3411540  
    4646    if ( $product->get_image_id() ) {
    4747        $image = wp_get_attachment_image_src( $product->get_image_id(), $size );
    48         $src   = ! empty( $image ) && ! empty( $image[0] ) ? $image[0] : '';
     48        $src = ! empty( $image ) && ! empty( $image[0] ) ? $image[0] : '';
    4949    } elseif ( $product->get_parent_id() ) {
    5050        $parent_product = wc_get_product( $product->get_parent_id() );
     
    5656    if ( empty( $src ) && $placeholder ) {
    5757        $image = wc_placeholder_img_src( $size );
    58         $src   = ! empty( $image ) && ! empty( $image[0] ) ? $image[0] : '';
     58        $src = ! empty( $image ) && ! empty( $image[0] ) ? $image[0] : '';
    5959    }
    6060
     
    7474    if (
    7575        ! empty( $item['discount_type'] ) &&
     76        'none' !== $item['discount_type'] &&
    7677        isset( $item['discount'] ) &&
    7778        '' !== $item['discount'] &&
     
    171172
    172173    $regular_price = '' !== $product->get_regular_price() ? wc_get_price_to_display( $product, [ 'price' => $product->get_regular_price() ] ) : '';
    173     $sale_price    = '' !== $product->get_sale_price() && $product->is_on_sale() ? $product->get_sale_price() : '';
     174    $sale_price = '' !== $product->get_sale_price() && $product->is_on_sale() ? $product->get_sale_price() : '';
    174175    if (
    175176        ! empty( $item['discount_type'] ) &&
     177        'none' !== $item['discount_type'] &&
    176178        isset( $item['discount'] ) &&
    177179        '' !== $item['discount'] &&
     
    196198        [
    197199            'regular_price' => $regular_price,
    198             'sale_price'    => $sale_price,
     200            'sale_price' => $sale_price,
    199201            'display_price' => $display_price,
    200202        ],
     
    211213
    212214    $data = array(
    213         'id'          => $product->get_id(),
    214         'image'       => get_product_image_src( $product ),
     215        'id' => $product->get_id(),
     216        'image' => get_product_image_src( $product ),
    215217        'is_variable' => $product->is_type( 'variable' ) ? 'true' : 'false',
    216218        'is_in_stock' => $product->is_in_stock() ? 'true' : 'false',
    217         'link'        => $product->get_permalink(),
    218         'max_qty'     => 0 < $product->get_max_purchase_quantity() ? $product->get_max_purchase_quantity() : '',
    219         'min_qty'     => $product->get_min_purchase_quantity(),
     219        'link' => $product->get_permalink(),
     220        'max_qty' => 0 < $product->get_max_purchase_quantity() ? $product->get_max_purchase_quantity() : '',
     221        'min_qty' => $product->get_min_purchase_quantity(),
    220222    );
    221223
     
    267269
    268270    $variation = is_numeric( $variation ) ? wc_get_product( $variation ) : $variation;
    269     $variable  = is_null( $variable ) ? $variation->get_parent_id() : $variable;
    270     $variable  = is_numeric( $variable ) ? wc_get_product( $variable ) : $variable;
     271    $variable = is_null( $variable ) ? $variation->get_parent_id() : $variable;
     272    $variable = is_numeric( $variable ) ? wc_get_product( $variable ) : $variable;
    271273    if ( $variable->get_id() !== $variation->get_parent_id() ) {
    272274        return array();
    273275    }
    274276
    275     $products             = [];
     277    $products = [];
    276278    $variation_attributes = $variation->get_variation_attributes( false );
    277     $any_attributes       = get_any_value_attributes( $variation_attributes );
    278     $extra_data           = [ 'attributes' => [] ];
     279    $any_attributes = get_any_value_attributes( $variation_attributes );
     280    $extra_data = [ 'attributes' => [] ];
    279281    if ( empty( $any_attributes ) ) {
    280282        if ( ! empty( $variation_attributes ) ) {
     
    283285                    [
    284286                        'attribute' => $key,
    285                         'value'     => $attribute,
    286                         'by'        => 'slug'
     287                        'value' => $attribute,
     288                        'by' => 'slug'
    287289                    ]
    288290                );
     
    301303                ! empty( $attributes[ $any_attributes[ $i ] ]['is_variation'] )
    302304            ) {
    303                 $any_values[]         = $attributes[ $any_attributes[ $i ] ]['options'];
     305                $any_values[] = $attributes[ $any_attributes[ $i ] ]['options'];
    304306                $any_attributes[ $i ] = $attributes[ $any_attributes[ $i ] ]['name'];
    305307            }
     
    321323                    [
    322324                        'attribute' => $key,
    323                         'value'     => $attribute,
    324                         'by'        => 'slug'
     325                        'value' => $attribute,
     326                        'by' => 'slug'
    325327                    ]
    326328                );
     
    335337                        [
    336338                            'attribute' => $any_attributes[ $j ],
    337                             'value'     => $any_values[ $i ][ $j ],
    338                             'by'        => 'id'
     339                            'value' => $any_values[ $i ][ $j ],
     340                            'by' => 'id'
    339341                        ]
    340342                    );
     
    347349                    [
    348350                        'attribute' => $any_attributes[0],
    349                         'value'     => $any_values[ $i ],
    350                         'by'        => 'id'
     351                        'value' => $any_values[ $i ],
     352                        'by' => 'id'
    351353                    ]
    352354                );
     
    367369        apply_filters( 'asnp_wepb_get_variation_attribute_options_args', $args ),
    368370        array(
    369             'options'   => false,
     371            'options' => false,
    370372            'attribute' => false,
    371             'product'   => false,
     373            'product' => false,
    372374        )
    373375    );
    374376
    375     $options   = $args['options'];
    376     $product   = $args['product'];
     377    $options = $args['options'];
     378    $product = $args['product'];
    377379    $attribute = $args['attribute'];
    378380
    379381    if ( empty( $options ) && ! empty( $product ) && ! empty( $attribute ) ) {
    380382        $attributes = $product->get_variation_attributes();
    381         $options    = $attributes[ $attribute ];
     383        $options = $attributes[ $attribute ];
    382384    }
    383385
     
    398400                if ( in_array( $term->slug, $options, true ) ) {
    399401                    $select_options[] = [
    400                         'name'  => sanitize_text_field( apply_filters( 'woocommerce_variation_option_name', $term->name, $term, $attribute, $product ) ),
     402                        'name' => sanitize_text_field( apply_filters( 'woocommerce_variation_option_name', $term->name, $term, $attribute, $product ) ),
    401403                        'value' => esc_attr( $term->slug ),
    402404                    ];
     
    407409                // This handles < 2.4.0 bw compatibility where text attributes were not sanitized.
    408410                $select_options[] = [
    409                     'name'  => sanitize_text_field( apply_filters( 'woocommerce_variation_option_name', $option, null, $attribute, $product ) ),
     411                    'name' => sanitize_text_field( apply_filters( 'woocommerce_variation_option_name', $option, null, $attribute, $product ) ),
    410412                    'value' => esc_attr( $option ),
    411413                ];
     
    451453    }
    452454
    453     $defaults = ['variation'];
    454     $types    = array_merge( array_keys( wc_get_product_types() ) );
     455    $defaults = [ 'variation' ];
     456    $types = array_merge( array_keys( wc_get_product_types() ) );
    455457    if ( empty( $types ) ) {
    456458        if ( ! empty( $excludes ) ) {
     
    523525        if ( ! is_wp_error( $term ) && is_object( $term ) && $term->term_id ) {
    524526            return [
    525                 'name'  => $args['attribute'],
    526                 'id'    => $args['attribute'],
     527                'name' => $args['attribute'],
     528                'id' => $args['attribute'],
    527529                'label' => $term->name,
    528530                'value' => $term->slug,
     
    533535
    534536    return [
    535         'name'  => $args['attribute'],
    536         'id'    => $args['attribute'],
     537        'name' => $args['attribute'],
     538        'id' => $args['attribute'],
    537539        'label' => $args['value'],
    538540        'value' => $args['value'],
     
    541543
    542544function combinations( $arrays, $i = 0 ) {
    543     if ( ! isset( $arrays[$i] ) ) {
    544         return array();
    545     }
    546     if ( $i == count( $arrays ) - 1 ) {
    547         return $arrays[$i];
    548     }
    549 
    550     // get combinations from subsequent arrays
    551     $tmp = combinations( $arrays, $i + 1 );
    552 
    553     $result = array();
    554 
    555     // concat each array from tmp with each element from $arrays[$i]
    556     foreach ( $arrays[ $i ] as $v ) {
    557         foreach ( $tmp as $t ) {
    558             $result[] = is_array( $t ) ?
    559                 array_merge( array( $v ), $t ) :
    560                 array( $v, $t );
    561         }
    562     }
    563 
    564     return $result;
     545    if ( ! isset( $arrays[ $i ] ) ) {
     546        return array();
     547    }
     548    if ( $i == count( $arrays ) - 1 ) {
     549        return $arrays[ $i ];
     550    }
     551
     552    // get combinations from subsequent arrays
     553    $tmp = combinations( $arrays, $i + 1 );
     554
     555    $result = array();
     556
     557    // concat each array from tmp with each element from $arrays[$i]
     558    foreach ( $arrays[ $i ] as $v ) {
     559        foreach ( $tmp as $t ) {
     560            $result[] = is_array( $t ) ?
     561                array_merge( array( $v ), $t ) :
     562                array( $v, $t );
     563        }
     564    }
     565
     566    return $result;
    565567}
    566568
     
    572574    if ( is_json( $items ) ) {
    573575        $items = json_decode( $items, true );
    574         return array_map( function( $item ) {
     576        return array_map( function ( $item ) {
    575577            return isset( $item['id'] ) ? $item['id'] : 0;
    576578        }, $items );
     
    579581    $items = is_string( $items ) ? explode( ',', $items ) : $items;
    580582
    581     return array_map( function( $item ) {
     583    return array_map( function ( $item ) {
    582584        $item = explode( ':', $item );
    583585        if ( 1 < count( $item ) && is_numeric( $item[0] ) ) {
     
    595597    if ( is_json( $items ) ) {
    596598        $items = json_decode( $items, true );
    597         return array_map( function( $item ) {
     599        return array_map( function ( $item ) {
    598600            return isset( $item['qty'] ) ? absint( $item['qty'] ) : 0;
    599601        }, $items );
     
    602604    $items = is_string( $items ) ? explode( ',', $items ) : $items;
    603605
    604     return array_map( function( $item ) {
     606    return array_map( function ( $item ) {
    605607        $item = explode( ':', $item );
    606608        if ( 1 < count( $item ) && is_numeric( $item[1] ) ) {
     
    618620    if ( is_json( $items ) ) {
    619621        $items = json_decode( $items, true );
    620         return array_map( function( $item ) {
     622        return array_map( function ( $item ) {
    621623            $attributes = [];
    622624            if ( ! empty( $item['attributes'] ) ) {
     
    642644    if ( 2 < count( $item ) ) {
    643645        $attributes = [];
    644         array_map( function( $value ) use ( &$attributes ) {
     646        array_map( function ( $value ) use ( &$attributes ) {
    645647            $value = explode( '=', $value );
    646648            if ( 1 < count( $value ) ) {
     
    668670        ( ! isset( $args['is_fixed_price'] ) || ! $args['is_fixed_price'] ) &&
    669671        ! empty( $args['discount_type'] ) &&
     672        'none' !== $args['discount_type'] &&
    670673        isset( $args['discount'] ) &&
    671674        '' !== $args['discount'] &&
     
    759762    }
    760763
    761     $model = get_plugin()->container()->get( SimpleBundleItemsModel::class );
     764    $model = get_plugin()->container()->get( SimpleBundleItemsModel::class);
    762765    $items = $model->get_bundle( $product->get_id() );
    763766    if ( empty( $items ) ) {
    764         $quantities       = get_quantities_from_bundle_items( $default_products );
     767        $quantities = get_quantities_from_bundle_items( $default_products );
    765768        $default_products = get_product_ids_from_bundle_items( $default_products );
    766769        if ( count( $default_products ) === count( $quantities ) ) {
    767770            for ( $i = 0; $i < count( $default_products ); $i++ ) {
    768771                $model->add( [
    769                     'bundle_id'  => $product->get_id(),
     772                    'bundle_id' => $product->get_id(),
    770773                    'product_id' => (int) $default_products[ $i ],
    771                     'quantity'   => (int) $quantities[ $i ],
     774                    'quantity' => (int) $quantities[ $i ],
    772775                ] );
    773776            }
     
    785788
    786789    $handles = array(
    787         'react'        => array( '17.0.2', array() ),
    788         'react-dom'    => array( '17.0.2', array( 'react' ) ),
    789         'wp-i18n'      => array( '6.0', array() ),
    790         'wp-hooks'     => array( '6.0', array() ),
     790        'react' => array( '17.0.2', array() ),
     791        'react-dom' => array( '17.0.2', array( 'react' ) ),
     792        'wp-i18n' => array( '6.0', array() ),
     793        'wp-hooks' => array( '6.0', array() ),
    791794        'wp-api-fetch' => array( '6.0', array() ),
    792795    );
     
    812815function added_product_bundle_type() {
    813816    $ids = Products\get_products( [
    814         'type'   => Plugin::PRODUCT_TYPE,
     817        'type' => Plugin::PRODUCT_TYPE,
    815818        'return' => 'ids',
    816819    ] );
     
    874877function is_json( $string ) {
    875878    // Check if the string is empty or not a string
    876     if ( ! is_string( $string ) || empty( trim( $string ) ) ) {
    877         return false;
    878     }
    879 
    880     // Check if string starts with either { or [
    881     if ( ! in_array( $string[0], [ '{', '[' ] ) ) {
    882         return false;
    883     }
    884 
    885     // Attempt to decode
    886     json_decode( $string );
    887 
    888     return ( json_last_error() === JSON_ERROR_NONE );
     879    if ( ! is_string( $string ) || empty( trim( $string ) ) ) {
     880        return false;
     881    }
     882
     883    // Check if string starts with either { or [
     884    if ( ! in_array( $string[0], [ '{', '[' ] ) ) {
     885        return false;
     886    }
     887
     888    // Attempt to decode
     889    json_decode( $string );
     890
     891    return ( json_last_error() === JSON_ERROR_NONE );
    889892}
    890893
     
    899902
    900903    $items = explode( ',', $items );
    901     $items = array_map( function( $item ) {
     904    $items = array_map( function ( $item ) {
    902905        $item = explode( ':', $item );
    903906        if ( 3 === count( $item ) ) {
    904907            $attributes = explode( '&', $item[2] );
    905             $attributes = array_reduce( $attributes, function( $carry, $attribute ) {
     908            $attributes = array_reduce( $attributes, function ( $carry, $attribute ) {
    906909                $attribute = explode( '=', $attribute );
    907910                $carry[ $attribute[0] ] = $attribute[1];
     
    910913
    911914            return [
    912                 'id'         => absint( $item[0] ),
    913                 'qty'        => ! empty( $item[1] ) ? absint( $item[1] ) : 0,
     915                'id' => absint( $item[0] ),
     916                'qty' => ! empty( $item[1] ) ? absint( $item[1] ) : 0,
    914917                'attributes' => $attributes,
    915918            ];
    916919        }
    917920        return [
    918             'id'  => absint( $item[0] ),
     921            'id' => absint( $item[0] ),
    919922            'qty' => ! empty( $item[1] ) ? absint( $item[1] ) : 0,
    920923        ];
  • easy-product-bundles-for-woocommerce/trunk/easy-product-bundles.php

    r3406359 r3411540  
    77 * Description: Create product bundles in WooCommerce easily
    88 * Tags: woocommerce, product bundles, bundled products
    9  * Version: 6.12.3
     9 * Version: 6.13.0
    1010 * Author: Product Bundles Team
    1111 * Author URI: https://www.asanaplugins.com/
     
    1414 * Domain Path: /languages
    1515 * WC requires at least: 3.0
    16  * WC tested up to: 10.3.5
     16 * WC tested up to: 10.3.6
    1717 *
    1818 * Copyright 2025 Asana Plugins (https://www.asanaplugins.com/)
     
    2525// Plugin version.
    2626if ( ! defined( 'ASNP_WEPB_VERSION' ) ) {
    27     define( 'ASNP_WEPB_VERSION', '6.12.3' );
     27    define( 'ASNP_WEPB_VERSION', '6.13.0' );
    2828}
    2929
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-ar-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    196196            "Change the button label shown for bundle products in the shop page.": [
    197197                "غيّر تسمية الزر المعروضة لمنتجات الحزمة في صفحة المتجر."
    198             ]
     198            ],
     199            "None": [ "لا شيء" ]
    199200        }
    200201    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-bg_BG-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    211211            "Change the button label shown for bundle products in the shop page.": [
    212212                "Променете етикета на бутона, показан за пакетни продукти в страницата на магазина."
    213             ]
     213            ],
     214            "None": [ "Няма" ]
    214215        }
    215216    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-da_DK-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    199199            "Change the button label shown for bundle products in the shop page.": [
    200200                "Ændr knapetiketten, der vises for pakkeprodukter på butikssiden."
    201             ]
     201            ],
     202            "None": [ "Ingen" ]
    202203        }
    203204    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-de_DE.po

    r3393297 r3411540  
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/easy-product-bundles-for-woocommerce\n"
    77"POT-Creation-Date: 2025-09-09T20:02:22+00:00\n"
    8 "PO-Revision-Date: 2025-10-03 15:24+0330\n"
     8"PO-Revision-Date: 2025-12-04 23:32+0330\n"
    99"Last-Translator: \n"
    1010"Language-Team: \n"
     
    353353msgstr "Nach den Produkt Meta"
    354354
    355 #: assets/js/admin/admin/index.js:2
     355#: assets/js/admin/admin/index.js:2 assets/js/admin/product/index.js:2
    356356msgid "None"
    357357msgstr "Keine"
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-es_ES.po

    r3393297 r3411540  
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/easy-product-bundles-for-woocommerce\n"
    77"POT-Creation-Date: 2025-09-10T21:42:35+00:00\n"
    8 "PO-Revision-Date: 2025-10-03 15:22+0330\n"
     8"PO-Revision-Date: 2025-12-04 23:36+0330\n"
    99"Last-Translator: \n"
    1010"Language-Team: \n"
     
    362362msgstr "Después de los metadatos del producto"
    363363
    364 #: assets/js/admin/admin/index.js:2
     364#: assets/js/admin/admin/index.js:2 assets/js/admin/product/index.js:2
    365365msgid "None"
    366366msgstr "Ninguno"
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-fa_IR-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    202202            "Change the button label shown for bundle products in the shop page.": [
    203203                "برچسب دکمه نمایش داده‌شده برای محصولات بسته در صفحه فروشگاه را تغییر دهید."
    204             ]
     204            ],
     205            "None": [ "هیچکدام" ]
    205206        }
    206207    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-fr_FR.po

    r3393297 r3411540  
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/easy-product-bundles-for-woocommerce\n"
    77"POT-Creation-Date: 2025-09-09T20:02:22+00:00\n"
    8 "PO-Revision-Date: 2025-10-03 15:23+0330\n"
     8"PO-Revision-Date: 2025-12-04 23:31+0330\n"
    99"Last-Translator: \n"
    1010"Language-Team: \n"
     
    364364msgstr "Après les méta du produit"
    365365
    366 #: assets/js/admin/admin/index.js:2
     366#: assets/js/admin/admin/index.js:2 assets/js/admin/product/index.js:2
    367367msgid "None"
    368368msgstr "Aucun"
     
    14581458msgid "This option allows you to show or hide the product search field in the popup window."
    14591459msgstr "Cette option vous permet d’afficher ou de masquer le champ de recherche de produit dans la fenêtre contextuelle."
    1460 
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-he_IL-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    191191            "Change the button label shown for bundle products in the shop page.": [
    192192                "שנה את תווית הכפתור המוצגת עבור מוצרי חבילה בדף החנות."
    193             ]
     193            ],
     194            "None": [ "אין" ]
    194195        }
    195196    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-hi_IN-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    195195            "Change the button label shown for bundle products in the shop page.": [
    196196                "शॉप पेज पर बंडल उत्पादों के लिए दिखाए जाने वाले बटन लेबल को बदलें।"
    197             ]
     197            ],
     198            "None": [ "कोई नहीं" ]
    198199        }
    199200    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-it_IT-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    210210            "Change the button label shown for bundle products in the shop page.": [
    211211                "Modifica l'etichetta del pulsante mostrata per i prodotti pacchetto nella pagina del negozio."
    212             ]
     212            ],
     213            "None": [ "Nessuno" ]
    213214        }
    214215    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-ja-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    195195            "Change the button label shown for bundle products in the shop page.": [
    196196                "ショップページで表示されるバンドル商品のボタンラベルを変更します。"
    197             ]
     197            ],
     198            "None": [ "なし" ]
    198199        }
    199200    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-nl_NL-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    207207            "Change the button label shown for bundle products in the shop page.": [
    208208                "Wijzig het knoplabel dat wordt weergegeven voor bundelproducten op de winkelpagina."
    209             ]
     209            ],
     210            "None": [ "Geen" ]
    210211        }
    211212    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-pl_PL-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    202202            "Change the button label shown for bundle products in the shop page.": [
    203203                "Zmień etykietę przycisku wyświetlaną dla produktów pakietowych na stronie sklepu."
    204             ]
     204            ],
     205            "None": [ "Żaden" ]
    205206        }
    206207    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-pt_PT-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    202202            "Change the button label shown for bundle products in the shop page.": [
    203203                "Altere a etiqueta do botão exibida para produtos em pacote na página da loja."
    204             ]
     204            ],
     205            "None": [ "Nenhum" ]
    205206        }
    206207    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-ru_RU-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    210210            "Change the button label shown for bundle products in the shop page.": [
    211211                "Измените подпись кнопки, отображаемую для комплектных товаров на странице магазина."
    212             ]
     212            ],
     213            "None": [ "Никакой" ]
    213214        }
    214215    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-tr_TR-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    205205            "Change the button label shown for bundle products in the shop page.": [
    206206                "Mağaza sayfasında paket ürünleri için gösterilen düğme etiketini değiştir."
    207             ]
     207            ],
     208            "None": [ "Hiçbiri" ]
    208209        }
    209210    }
  • easy-product-bundles-for-woocommerce/trunk/languages/asnp-easy-product-bundles-zh_CN-4ce3ef1d11b207f3bd5f8d6dd391062e.json

    r3362820 r3411540  
    184184            "Change the button label shown for bundle products in the shop page.": [
    185185                "更改商店页面中显示的套餐产品按钮标签。"
    186             ]
     186            ],
     187            "None": [ "无" ]
    187188        }
    188189    }
  • easy-product-bundles-for-woocommerce/trunk/readme.txt

    r3406359 r3411540  
    44Tags: woocommerce product bundle, woocommerce bundle, product bundle woocommerce, composite product, wpc product bundles for woocommerce, yith woocommerce product bundles, woocommerce product bundles free, wpc product bundles, yith product bundles, custom product boxes woocommerce, woocommerce bundle plugin, woocommerce composite products, woocommerce, wordpress, ecommerce
    55Requires at least: 5.0
    6 Tested up to: 6.8
     6Tested up to: 6.9
    77Requires PHP: 5.6
    8 Stable tag: 6.12.3
     8Stable tag: 6.13.0
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    216216== Changelog ==
    217217
     218= 6.13.0 =
     219* New: Introduced a None option for discount types.
     220* Ensured compatibility with WordPress version 6.9
     221* Ensured compatibility with WooCommerce version 10.3.6
     222
    218223= 6.12.3 =
    219224* Fix: Resolved an issue that occurred when creating bundles with a large number of items.
  • easy-product-bundles-for-woocommerce/trunk/src/Admin/ProductBundle.php

    r3406359 r3411540  
    188188            'query_relation' => 'OR',
    189189            'edit_quantity' => 'false',
    190             'discount_type' => 'percentage',
     190            'discount_type' => 'none',
    191191            'discount' => '',
    192192            'product' => '',
  • easy-product-bundles-for-woocommerce/trunk/src/Helpers.php

    r3378492 r3411540  
    4646    if ( $product->get_image_id() ) {
    4747        $image = wp_get_attachment_image_src( $product->get_image_id(), $size );
    48         $src   = ! empty( $image ) && ! empty( $image[0] ) ? $image[0] : '';
     48        $src = ! empty( $image ) && ! empty( $image[0] ) ? $image[0] : '';
    4949    } elseif ( $product->get_parent_id() ) {
    5050        $parent_product = wc_get_product( $product->get_parent_id() );
     
    5656    if ( empty( $src ) && $placeholder ) {
    5757        $image = wc_placeholder_img_src( $size );
    58         $src   = ! empty( $image ) && ! empty( $image[0] ) ? $image[0] : '';
     58        $src = ! empty( $image ) && ! empty( $image[0] ) ? $image[0] : '';
    5959    }
    6060
     
    7474    if (
    7575        ! empty( $item['discount_type'] ) &&
     76        'none' !== $item['discount_type'] &&
    7677        isset( $item['discount'] ) &&
    7778        '' !== $item['discount'] &&
     
    171172
    172173    $regular_price = '' !== $product->get_regular_price() ? wc_get_price_to_display( $product, [ 'price' => $product->get_regular_price() ] ) : '';
    173     $sale_price    = '' !== $product->get_sale_price() && $product->is_on_sale() ? $product->get_sale_price() : '';
     174    $sale_price = '' !== $product->get_sale_price() && $product->is_on_sale() ? $product->get_sale_price() : '';
    174175    if (
    175176        ! empty( $item['discount_type'] ) &&
     177        'none' !== $item['discount_type'] &&
    176178        isset( $item['discount'] ) &&
    177179        '' !== $item['discount'] &&
     
    196198        [
    197199            'regular_price' => $regular_price,
    198             'sale_price'    => $sale_price,
     200            'sale_price' => $sale_price,
    199201            'display_price' => $display_price,
    200202        ],
     
    211213
    212214    $data = array(
    213         'id'          => $product->get_id(),
    214         'image'       => get_product_image_src( $product ),
     215        'id' => $product->get_id(),
     216        'image' => get_product_image_src( $product ),
    215217        'is_variable' => $product->is_type( 'variable' ) ? 'true' : 'false',
    216218        'is_in_stock' => $product->is_in_stock() ? 'true' : 'false',
    217         'link'        => $product->get_permalink(),
    218         'max_qty'     => 0 < $product->get_max_purchase_quantity() ? $product->get_max_purchase_quantity() : '',
    219         'min_qty'     => $product->get_min_purchase_quantity(),
     219        'link' => $product->get_permalink(),
     220        'max_qty' => 0 < $product->get_max_purchase_quantity() ? $product->get_max_purchase_quantity() : '',
     221        'min_qty' => $product->get_min_purchase_quantity(),
    220222    );
    221223
     
    267269
    268270    $variation = is_numeric( $variation ) ? wc_get_product( $variation ) : $variation;
    269     $variable  = is_null( $variable ) ? $variation->get_parent_id() : $variable;
    270     $variable  = is_numeric( $variable ) ? wc_get_product( $variable ) : $variable;
     271    $variable = is_null( $variable ) ? $variation->get_parent_id() : $variable;
     272    $variable = is_numeric( $variable ) ? wc_get_product( $variable ) : $variable;
    271273    if ( $variable->get_id() !== $variation->get_parent_id() ) {
    272274        return array();
    273275    }
    274276
    275     $products             = [];
     277    $products = [];
    276278    $variation_attributes = $variation->get_variation_attributes( false );
    277     $any_attributes       = get_any_value_attributes( $variation_attributes );
    278     $extra_data           = [ 'attributes' => [] ];
     279    $any_attributes = get_any_value_attributes( $variation_attributes );
     280    $extra_data = [ 'attributes' => [] ];
    279281    if ( empty( $any_attributes ) ) {
    280282        if ( ! empty( $variation_attributes ) ) {
     
    283285                    [
    284286                        'attribute' => $key,
    285                         'value'     => $attribute,
    286                         'by'        => 'slug'
     287                        'value' => $attribute,
     288                        'by' => 'slug'
    287289                    ]
    288290                );
     
    301303                ! empty( $attributes[ $any_attributes[ $i ] ]['is_variation'] )
    302304            ) {
    303                 $any_values[]         = $attributes[ $any_attributes[ $i ] ]['options'];
     305                $any_values[] = $attributes[ $any_attributes[ $i ] ]['options'];
    304306                $any_attributes[ $i ] = $attributes[ $any_attributes[ $i ] ]['name'];
    305307            }
     
    321323                    [
    322324                        'attribute' => $key,
    323                         'value'     => $attribute,
    324                         'by'        => 'slug'
     325                        'value' => $attribute,
     326                        'by' => 'slug'
    325327                    ]
    326328                );
     
    335337                        [
    336338                            'attribute' => $any_attributes[ $j ],
    337                             'value'     => $any_values[ $i ][ $j ],
    338                             'by'        => 'id'
     339                            'value' => $any_values[ $i ][ $j ],
     340                            'by' => 'id'
    339341                        ]
    340342                    );
     
    347349                    [
    348350                        'attribute' => $any_attributes[0],
    349                         'value'     => $any_values[ $i ],
    350                         'by'        => 'id'
     351                        'value' => $any_values[ $i ],
     352                        'by' => 'id'
    351353                    ]
    352354                );
     
    367369        apply_filters( 'asnp_wepb_get_variation_attribute_options_args', $args ),
    368370        array(
    369             'options'   => false,
     371            'options' => false,
    370372            'attribute' => false,
    371             'product'   => false,
     373            'product' => false,
    372374        )
    373375    );
    374376
    375     $options   = $args['options'];
    376     $product   = $args['product'];
     377    $options = $args['options'];
     378    $product = $args['product'];
    377379    $attribute = $args['attribute'];
    378380
    379381    if ( empty( $options ) && ! empty( $product ) && ! empty( $attribute ) ) {
    380382        $attributes = $product->get_variation_attributes();
    381         $options    = $attributes[ $attribute ];
     383        $options = $attributes[ $attribute ];
    382384    }
    383385
     
    398400                if ( in_array( $term->slug, $options, true ) ) {
    399401                    $select_options[] = [
    400                         'name'  => sanitize_text_field( apply_filters( 'woocommerce_variation_option_name', $term->name, $term, $attribute, $product ) ),
     402                        'name' => sanitize_text_field( apply_filters( 'woocommerce_variation_option_name', $term->name, $term, $attribute, $product ) ),
    401403                        'value' => esc_attr( $term->slug ),
    402404                    ];
     
    407409                // This handles < 2.4.0 bw compatibility where text attributes were not sanitized.
    408410                $select_options[] = [
    409                     'name'  => sanitize_text_field( apply_filters( 'woocommerce_variation_option_name', $option, null, $attribute, $product ) ),
     411                    'name' => sanitize_text_field( apply_filters( 'woocommerce_variation_option_name', $option, null, $attribute, $product ) ),
    410412                    'value' => esc_attr( $option ),
    411413                ];
     
    451453    }
    452454
    453     $defaults = ['variation'];
    454     $types    = array_merge( array_keys( wc_get_product_types() ) );
     455    $defaults = [ 'variation' ];
     456    $types = array_merge( array_keys( wc_get_product_types() ) );
    455457    if ( empty( $types ) ) {
    456458        if ( ! empty( $excludes ) ) {
     
    523525        if ( ! is_wp_error( $term ) && is_object( $term ) && $term->term_id ) {
    524526            return [
    525                 'name'  => $args['attribute'],
    526                 'id'    => $args['attribute'],
     527                'name' => $args['attribute'],
     528                'id' => $args['attribute'],
    527529                'label' => $term->name,
    528530                'value' => $term->slug,
     
    533535
    534536    return [
    535         'name'  => $args['attribute'],
    536         'id'    => $args['attribute'],
     537        'name' => $args['attribute'],
     538        'id' => $args['attribute'],
    537539        'label' => $args['value'],
    538540        'value' => $args['value'],
     
    541543
    542544function combinations( $arrays, $i = 0 ) {
    543     if ( ! isset( $arrays[$i] ) ) {
    544         return array();
    545     }
    546     if ( $i == count( $arrays ) - 1 ) {
    547         return $arrays[$i];
    548     }
    549 
    550     // get combinations from subsequent arrays
    551     $tmp = combinations( $arrays, $i + 1 );
    552 
    553     $result = array();
    554 
    555     // concat each array from tmp with each element from $arrays[$i]
    556     foreach ( $arrays[ $i ] as $v ) {
    557         foreach ( $tmp as $t ) {
    558             $result[] = is_array( $t ) ?
    559                 array_merge( array( $v ), $t ) :
    560                 array( $v, $t );
    561         }
    562     }
    563 
    564     return $result;
     545    if ( ! isset( $arrays[ $i ] ) ) {
     546        return array();
     547    }
     548    if ( $i == count( $arrays ) - 1 ) {
     549        return $arrays[ $i ];
     550    }
     551
     552    // get combinations from subsequent arrays
     553    $tmp = combinations( $arrays, $i + 1 );
     554
     555    $result = array();
     556
     557    // concat each array from tmp with each element from $arrays[$i]
     558    foreach ( $arrays[ $i ] as $v ) {
     559        foreach ( $tmp as $t ) {
     560            $result[] = is_array( $t ) ?
     561                array_merge( array( $v ), $t ) :
     562                array( $v, $t );
     563        }
     564    }
     565
     566    return $result;
    565567}
    566568
     
    572574    if ( is_json( $items ) ) {
    573575        $items = json_decode( $items, true );
    574         return array_map( function( $item ) {
     576        return array_map( function ( $item ) {
    575577            return isset( $item['id'] ) ? $item['id'] : 0;
    576578        }, $items );
     
    579581    $items = is_string( $items ) ? explode( ',', $items ) : $items;
    580582
    581     return array_map( function( $item ) {
     583    return array_map( function ( $item ) {
    582584        $item = explode( ':', $item );
    583585        if ( 1 < count( $item ) && is_numeric( $item[0] ) ) {
     
    595597    if ( is_json( $items ) ) {
    596598        $items = json_decode( $items, true );
    597         return array_map( function( $item ) {
     599        return array_map( function ( $item ) {
    598600            return isset( $item['qty'] ) ? absint( $item['qty'] ) : 0;
    599601        }, $items );
     
    602604    $items = is_string( $items ) ? explode( ',', $items ) : $items;
    603605
    604     return array_map( function( $item ) {
     606    return array_map( function ( $item ) {
    605607        $item = explode( ':', $item );
    606608        if ( 1 < count( $item ) && is_numeric( $item[1] ) ) {
     
    618620    if ( is_json( $items ) ) {
    619621        $items = json_decode( $items, true );
    620         return array_map( function( $item ) {
     622        return array_map( function ( $item ) {
    621623            $attributes = [];
    622624            if ( ! empty( $item['attributes'] ) ) {
     
    642644    if ( 2 < count( $item ) ) {
    643645        $attributes = [];
    644         array_map( function( $value ) use ( &$attributes ) {
     646        array_map( function ( $value ) use ( &$attributes ) {
    645647            $value = explode( '=', $value );
    646648            if ( 1 < count( $value ) ) {
     
    668670        ( ! isset( $args['is_fixed_price'] ) || ! $args['is_fixed_price'] ) &&
    669671        ! empty( $args['discount_type'] ) &&
     672        'none' !== $args['discount_type'] &&
    670673        isset( $args['discount'] ) &&
    671674        '' !== $args['discount'] &&
     
    759762    }
    760763
    761     $model = get_plugin()->container()->get( SimpleBundleItemsModel::class );
     764    $model = get_plugin()->container()->get( SimpleBundleItemsModel::class);
    762765    $items = $model->get_bundle( $product->get_id() );
    763766    if ( empty( $items ) ) {
    764         $quantities       = get_quantities_from_bundle_items( $default_products );
     767        $quantities = get_quantities_from_bundle_items( $default_products );
    765768        $default_products = get_product_ids_from_bundle_items( $default_products );
    766769        if ( count( $default_products ) === count( $quantities ) ) {
    767770            for ( $i = 0; $i < count( $default_products ); $i++ ) {
    768771                $model->add( [
    769                     'bundle_id'  => $product->get_id(),
     772                    'bundle_id' => $product->get_id(),
    770773                    'product_id' => (int) $default_products[ $i ],
    771                     'quantity'   => (int) $quantities[ $i ],
     774                    'quantity' => (int) $quantities[ $i ],
    772775                ] );
    773776            }
     
    785788
    786789    $handles = array(
    787         'react'        => array( '17.0.2', array() ),
    788         'react-dom'    => array( '17.0.2', array( 'react' ) ),
    789         'wp-i18n'      => array( '6.0', array() ),
    790         'wp-hooks'     => array( '6.0', array() ),
     790        'react' => array( '17.0.2', array() ),
     791        'react-dom' => array( '17.0.2', array( 'react' ) ),
     792        'wp-i18n' => array( '6.0', array() ),
     793        'wp-hooks' => array( '6.0', array() ),
    791794        'wp-api-fetch' => array( '6.0', array() ),
    792795    );
     
    812815function added_product_bundle_type() {
    813816    $ids = Products\get_products( [
    814         'type'   => Plugin::PRODUCT_TYPE,
     817        'type' => Plugin::PRODUCT_TYPE,
    815818        'return' => 'ids',
    816819    ] );
     
    874877function is_json( $string ) {
    875878    // Check if the string is empty or not a string
    876     if ( ! is_string( $string ) || empty( trim( $string ) ) ) {
    877         return false;
    878     }
    879 
    880     // Check if string starts with either { or [
    881     if ( ! in_array( $string[0], [ '{', '[' ] ) ) {
    882         return false;
    883     }
    884 
    885     // Attempt to decode
    886     json_decode( $string );
    887 
    888     return ( json_last_error() === JSON_ERROR_NONE );
     879    if ( ! is_string( $string ) || empty( trim( $string ) ) ) {
     880        return false;
     881    }
     882
     883    // Check if string starts with either { or [
     884    if ( ! in_array( $string[0], [ '{', '[' ] ) ) {
     885        return false;
     886    }
     887
     888    // Attempt to decode
     889    json_decode( $string );
     890
     891    return ( json_last_error() === JSON_ERROR_NONE );
    889892}
    890893
     
    899902
    900903    $items = explode( ',', $items );
    901     $items = array_map( function( $item ) {
     904    $items = array_map( function ( $item ) {
    902905        $item = explode( ':', $item );
    903906        if ( 3 === count( $item ) ) {
    904907            $attributes = explode( '&', $item[2] );
    905             $attributes = array_reduce( $attributes, function( $carry, $attribute ) {
     908            $attributes = array_reduce( $attributes, function ( $carry, $attribute ) {
    906909                $attribute = explode( '=', $attribute );
    907910                $carry[ $attribute[0] ] = $attribute[1];
     
    910913
    911914            return [
    912                 'id'         => absint( $item[0] ),
    913                 'qty'        => ! empty( $item[1] ) ? absint( $item[1] ) : 0,
     915                'id' => absint( $item[0] ),
     916                'qty' => ! empty( $item[1] ) ? absint( $item[1] ) : 0,
    914917                'attributes' => $attributes,
    915918            ];
    916919        }
    917920        return [
    918             'id'  => absint( $item[0] ),
     921            'id' => absint( $item[0] ),
    919922            'qty' => ! empty( $item[1] ) ? absint( $item[1] ) : 0,
    920923        ];
Note: See TracChangeset for help on using the changeset viewer.