Plugin Directory

Changeset 3318369


Ignore:
Timestamp:
06/26/2025 04:23:36 PM (9 months ago)
Author:
wpxteam
Message:

v1.7.3: * Update: Script for decimal values when used hide-trailing-zeros-on-prices. * Update: Compatibility with Fast Cart for WooCommerce plugin's Popup feature. * Compatibility: WooCommerce 9.9 & WordPress 6.8.

Location:
product-variant-table-for-woocommerce
Files:
51 added
8 edited

Legend:

Unmodified
Added
Removed
  • product-variant-table-for-woocommerce/trunk/inc/admin/class_pvtfw_settings.php

    r3247960 r3318369  
    5757            if ( ! current_user_can( 'manage_options' ) ) {
    5858                return;
    59             }
    60             // Checking nonce of option page form submission
    61             if ( isset($_POST['action']) && !wp_verify_nonce( sanitize_key( wp_unslash( 'action', 'action' ) ) ) ){
    62                 wp_die();
    6359            }
    6460           
  • product-variant-table-for-woocommerce/trunk/inc/frontend/class_pvtfw_cart.php

    r3212688 r3318369  
    5656                        quantity: qty,
    5757           
    58                         variation_id: variant_id,
    59 
    60                         pvt_security: '<?php echo esc_attr( wp_create_nonce( 'pvtfw-single-cart-nonce' ) ); ?>'
     58                        variation_id: variant_id
    6159                    };
    6260           
     
    161159            if ($passed_validation && WC()->cart->add_to_cart($product_id, $quantity, $variation_id) && 'publish' === $product_status) {
    162160       
    163                 do_action('pvtfw_woocommerce_ajax_added_to_cart', $product_id);
    164        
    165                     if ('yes' === get_option('pvtfw_woocommerce_cart_redirect_after_add')) {
    166        
    167                         return wc_add_to_cart_message(array($product_id => $quantity), true);
    168                     }
    169        
    170                     wc_add_to_cart_message([ $variation_id => $quantity ], true);
    171                     WC_AJAX::get_refreshed_fragments();
     161                do_action('woocommerce_ajax_added_to_cart', $product_id);
     162       
     163                if ('yes' === get_option('pvtfw_woocommerce_cart_redirect_after_add')) {
     164   
     165                    return wc_add_to_cart_message(array($product_id => $quantity), true);
     166                }
     167   
     168                wc_add_to_cart_message([ $variation_id => $quantity ], true);
     169
     170                WC_AJAX::get_refreshed_fragments();
    172171       
    173172            }
     
    185184                // echo wp_send_json($data);
    186185                wc_add_to_cart_message(  $product_id,  $quantity ,  $return = false );
    187                 WC_AJAX::get_refreshed_fragments(); 
    188        
    189             }
     186                WC_AJAX::get_refreshed_fragments();
     187       
     188            } 
    190189       
    191190            wp_die();
     
    202201            $cartNotice = PVTFW_COMMON::pvtfw_get_options()->cartNotice;
    203202
    204                 $all_notices  = WC()->session->get( 'wc_notices', array() );
    205            
    206            
    207                 $notice_types = apply_filters( 'woocommerce_notice_types', array( 'error', 'success', 'notice' ) );
    208 
    209                 if($cartNotice == 'on'):
    210                     ob_start();
    211                     foreach ( $notice_types as $notice_type ) {
    212                         if ( wc_notice_count( $notice_type ) > 0 ) {
    213                             wc_get_template( "notices/{$notice_type}.php", array(
    214                                 'notices' => array_filter( $all_notices[ $notice_type ] ),
    215                             ) );
    216                         }
     203            $all_notices  = WC()->session->get( 'wc_notices', array() );
     204       
     205       
     206            $notice_types = apply_filters( 'woocommerce_notice_types', array( 'error', 'success', 'notice' ) );
     207
     208            if($cartNotice == 'on'):
     209                ob_start();
     210                foreach ( $notice_types as $notice_type ) {
     211                    if ( wc_notice_count( $notice_type ) > 0 ) {
     212                        wc_get_template( "notices/{$notice_type}.php", array(
     213                            'notices' => array_filter( $all_notices[ $notice_type ] ),
     214                        ) );
    217215                    }
    218                     $fragments['notices_html'] = ob_get_clean();
    219 
    220                 endif;
    221 
    222                 wc_clear_notices();
    223 
    224                 return $fragments;
     216                }
     217                $fragments['notices_html'] = ob_get_clean();
     218
     219            endif;
     220
     221            wc_clear_notices();
     222
     223            return $fragments;
    225224        }
    226225
  • product-variant-table-for-woocommerce/trunk/inc/frontend/class_pvtfw_print_table.php

    r3238050 r3318369  
    7070                        <?php echo esc_html( apply_filters('pvtfw_variant_table_varaints_heading', __('Available Options', 'product-variant-table-for-woocommerce')) ); ?>
    7171                    </h2>
    72                     <?php
    73                         // Hook to display anything after the table heading
    74                         do_action('pvtfw_variation_table_heading_after');
    75                     ?>
    7672                </div>
    7773
     
    7975
    8076                // Hook to display anything before the table
    81                 do_action('pvtfw_variation_table_before');
     77                do_action('pvtfw_variation_table_before', $product);
    8278
    8379                // Scrollable classes adding
     
    10096                     *
    10197                     */
    102                     do_action('pvtfw_before_table_block');
     98                    do_action('pvtfw_before_table_block', $product);
    10399
    104100                    ?>
    105101                    <div class="pvtfw_variant_table_block <?php echo esc_attr( apply_filters('pvtfw_table_container_class', $classes, $scrollableTableX) ); ?>">
     102
    106103                        <table class="variant">
    107104                            <thead>
     
    143140                     *
    144141                     */
    145                     do_action('pvtfw_after_table_block');
     142                    do_action('pvtfw_after_table_block', $product);
    146143
    147144                    ?>
     
    151148                <?php
    152149                        // Hook to display anything after the table
    153                         do_action('pvtfw_variation_table_after');
     150                        do_action('pvtfw_variation_table_after', $product);
    154151
    155152                    }
     
    217214
    218215                    // Hook to display anything before the table
    219                     do_action('pvtfw_variation_table_before');
     216                    do_action('pvtfw_variation_table_before', $get_product);
    220217
    221218                    // Scrollable classes adding
     
    240237                             *
    241238                             */
    242                             do_action('pvtfw_before_table_block');
     239                            do_action('pvtfw_before_table_block', $get_product);
    243240
    244241                        ?>
     
    284281                         *
    285282                         */
    286                         do_action('pvtfw_after_table_block');
     283                        do_action('pvtfw_after_table_block', $get_product);
    287284
    288285                        ?>
     
    293290                    <?php
    294291                    // Hook to display anything after the table
    295                     do_action('pvtfw_variation_table_after');
     292                    do_action('pvtfw_variation_table_after', $get_product);
    296293
    297294                   
  • product-variant-table-for-woocommerce/trunk/languages/product-variant-table-for-woocommerce.pot

    r3247960 r3318369  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: PVT - Product Variation Table for WooCommerce 1.7.2\n"
     5"Project-Id-Version: PVT - Product Variation Table for WooCommerce 1.7.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/product-variant-table-for-woocommerce\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-02-27T05:07:47+00:00\n"
     12"POT-Creation-Date: 2025-06-26T12:34:30+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    155155
    156156#: inc/admin/class_pvtfw_form.php:251
    157 #: inc/admin/class_pvtfw_settings.php:119
     157#: inc/admin/class_pvtfw_settings.php:115
    158158msgid "Are you sure to reset?"
    159159msgstr ""
     
    189189msgstr ""
    190190
    191 #: inc/admin/class_pvtfw_form.php:327
    192 #: inc/admin/class_pvtfw_form.php:355
     191#: inc/admin/class_pvtfw_form.php:334
     192#: inc/admin/class_pvtfw_form.php:374
    193193msgid "Security check"
    194194msgstr ""
     
    202202msgstr ""
    203203
    204 #: inc/admin/class_pvtfw_settings.php:85
     204#: inc/admin/class_pvtfw_settings.php:81
    205205#: product-variant-table-for-woocommerce.php:416
    206206msgid "Settings"
    207207msgstr ""
    208208
    209 #: inc/admin/class_pvtfw_settings.php:87
     209#: inc/admin/class_pvtfw_settings.php:83
    210210msgid "Layout"
    211211msgstr ""
    212212
    213 #: inc/admin/class_pvtfw_settings.php:118
     213#: inc/admin/class_pvtfw_settings.php:114
    214214msgid "Save Settings"
    215215msgstr ""
    216216
    217 #: inc/admin/class_pvtfw_settings.php:119
     217#: inc/admin/class_pvtfw_settings.php:115
    218218msgid "Reset All"
    219219msgstr ""
     
    317317
    318318#: inc/frontend/class_pvtfw_print_table.php:70
    319 #: inc/frontend/class_pvtfw_print_table.php:208
     319#: inc/frontend/class_pvtfw_print_table.php:205
    320320msgid "Available Options"
    321321msgstr ""
  • product-variant-table-for-woocommerce/trunk/product-variant-table-for-woocommerce.php

    r3247960 r3318369  
    88Text Domain: product-variant-table-for-woocommerce
    99Domain Path: /languages
    10 Version: 1.7.2
     10Version: 1.7.3
    1111Requires at least: 4.7.0
    1212Requires PHP: 5.6.20
    1313WC requires at least: 3.0.0
    14 WC tested up to: 9.7
     14WC tested up to: 9.9
    1515License: GPLv2 or later
    1616License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3333 */
    3434
    35 define("PVTFW_VARIANT_TABLE_VERSION", '1.7.2');
     35define("PVTFW_VARIANT_TABLE_VERSION", '1.7.3');
    3636define("PVTFW_REQUIRED_PRO_VERSION", '1.7.0');
    3737define("PVTFW_DIR", plugin_dir_path(__FILE__) );
  • product-variant-table-for-woocommerce/trunk/public/css/pvtfw_table_breakdown.css

    r3245229 r3318369  
    2929        width: auto;
    3030    }
    31     .pvtfw_variant_table_block table.variant thead tr:not(.fancySearchRow) {
     31    .pvtfw_variant_table_block table.variant thead tr:not(.fancytablesearch) {
    3232        display: none;
    3333    }
  • product-variant-table-for-woocommerce/trunk/public/js/pvtfw_frontend.js

    r3238050 r3318369  
    2121    });
    2222
     23    // If the pre_info.pre_installed returns falsey value(false, null, undefined, 0, NaN, or an empty string).
     24    // For example: false
    2325    if( !pre_info.pre_installed ){
    2426
     
    2628
    2729      $('table.variant')
    28       .on('click', 'th:not(.fancySearchRow th)', function () {
     30      .on('click', 'tr:not(.fancytablesearch, .fancytablecolumnsearch) th:not(.fancytablepagination)', function () {
    2931        var index = $(this).index(),
    3032            rows = [],
     
    8486          // Checking Decimal Separator, if found then remove the decimal separator
    8587          if( aValue.includes(pre_info.decimal_sep) || bValue.includes(pre_info.decimal_sep) ){
    86             aValue = aValue.replace(pre_info.decimal_sep,'');
    87             bValue = bValue.replace(pre_info.decimal_sep,'');
     88            // Forcefully, replacing the decimal separator by `.` to compare values later
     89            // @added: 1.7.3
     90            // @note: It will help to compare the numeric value when forcefully removed trailing zeros on prices
     91            // @see: https://woocommerce.com/document/hide-trailing-zeros-on-prices/
     92            aValue = aValue.replace(pre_info.decimal_sep,'.');
     93            bValue = bValue.replace(pre_info.decimal_sep,'.');
    8894          }
    8995          // Checking Thousand Separator, if found then remove the thousand separator
     
    144150       */
    145151
    146       $inputs.change(function () {
     152      $inputs.on( 'change', function () {
    147153        var $this = $(this);
    148154        var $minusBtn = $this.siblings(".qty-count--minus");
     
    176182      });
    177183
    178       $countBtn.click(function () {
     184      $countBtn.on( 'click', function () {
    179185        var operator = this.dataset.action;
    180186        var $this = $(this);
  • product-variant-table-for-woocommerce/trunk/readme.txt

    r3247960 r3318369  
    33Tags: woocommerce, variations, table, variations table, woocommerce variable
    44Requires at least: 4.7.0
    5 Tested up to: 6.7
     5Tested up to: 6.8
    66Requires PHP: 5.6.20
    7 Stable tag: 1.7.2
     7Stable tag: 1.7.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    179179== Changelog ==
    180180
    181 = 1.7.2 [27-02-2025] Thursday =
    182 * Security: Checked codebase.
    183 * Compatibility: WooCommerce 9.7.
     181= 1.7.3 [26-06-2025] Thursday =
     182* Update: Script for decimal values when used `hide-trailing-zeros-on-prices`.
     183* Update: Compatibility with `Fast Cart for WooCommerce` plugin's `Popup` feature.
     184* Compatibility: WooCommerce 9.9 & WordPress 6.8.
     185
    184186
    185187[See changelog for all versions.](https://github.com/WPXtension/product-variation-table-for-woocommerce/blob/main/changelog-free.md)
Note: See TracChangeset for help on using the changeset viewer.