Plugin Directory

Changeset 3837744


Ignore:
Timestamp:
12/01/2026 01:28:29 PM (36 hours ago)
Author:
codersaiful
Message:

Update to version 6.1.6 from GitHub

Location:
woo-product-table
Files:
16 added
68 edited
1 copied

Legend:

Unmodified
Added
Removed
  • woo-product-table/tags/6.1.6/admin/action-hook.php

    r3522314 r3837744  
    181181                    <div class="wpt-form-info">
    182182                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/customize-add-to-card-icon/') ?>
     183                        <p><?php esc_html_e( 'Choose how the Add to Cart icon is displayed on button: no icon, icon only, left or right.', 'woo-product-table' ); ?></p>
    183184                    </div>
    184185                </td>
    … …  
    240241                    <div class="wpt-form-info">
    241242                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/floating-cart-options/'); ?>
     243                        <p><?php esc_html_e( 'Display a sticky floating cart button on your product table page.', 'woo-product-table' ); ?></p>
    242244                    </div>
    243245                </td>
    … …  
    258260                    <div class="wpt-form-info">
    259261                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/floating-cart-options/') ?>
     262                        <p><?php esc_html_e( 'Set the background color for the floating cart button or bar.', 'woo-product-table' ); ?></p>
    260263                    </div>
    261264                </td>
    … …  
    281284                    <div class="wpt-form-info">
    282285                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/floating-cart-options/'); ?>
     286                        <p><?php esc_html_e( 'Choose floating cart position on screen (e.g. Bottom Right, Top Left).', 'woo-product-table' ); ?></p>
    283287                    </div>
    284288                </td>
    … …  
    298302                    <div class="wpt-form-info">
    299303                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/floating-cart-options/'); ?>
     304                        <p><?php esc_html_e( 'Set floating cart button diameter size in pixels. Default is 70.', 'woo-product-table' ); ?></p>
    300305                    </div>
    301306                </td>
    … …  
    446451                    <div class="wpt-form-info">
    447452                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/show-product-in-new-same-tab/'); ?>
     453                        <p><?php esc_html_e( 'Choose whether clicking a product title or thumbnail opens in a new tab or same tab.', 'woo-product-table' ); ?></p>
    448454                    </div>
    449455                </td>
    … …  
    468474                    <div class="wpt-form-info">
    469475                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/disable-categories-tag-link/'); ?>
     476                        <p><?php esc_html_e( 'Enable or disable clickable links on category and tag terms inside table cells.', 'woo-product-table' ); ?></p>
    470477                    </div>
    471478                </td>
    … …  
    510517                    <div class="wpt-form-info">
    511518                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/disable-enable-add-to-cart-popup-notice/'); ?>
     519                        <p><?php esc_html_e( 'Show or hide popup confirmation message when adding products to cart.', 'woo-product-table' ); ?></p>
    512520                    </div>
    513521                </td>
    … …  
    572580                        </div>
    573581                        <div class="form-field col-lg-6">
    574                             <select name="<?php echo esc_attr( $field_name ); ?>[query_by_url]" id="wpt_table_instant_search_filter" class="wpt_fullwidth ua_input" >
     582                            <select name="<?php echo esc_attr( $field_name ); ?>[query_by_url]" id="wpt_table_query_by_url" class="wpt_fullwidth ua_input" >
    575583                                <?php wpt_default_option( $page ) ?>
    576584                                <option value="0" <?php wpt_selected( 'query_by_url', '0', $current_config_value ); ?>><?php esc_html_e( 'Off', 'woo-product-table' ); ?></option>
    … …  
    583591                    <div class="wpt-form-info">
    584592                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/how-to-show-hide-query-url/'); ?>
     593                        <p><?php esc_html_e( 'Allow filtering or sorting table data directly using URL query parameters.', 'woo-product-table' ); ?></p>
    585594                    </div>
    586595                </td>
    … …  
    603612                <td>
    604613                    <div class="wpt-form-info">
    605                        
     614                        <p><?php esc_html_e( 'Calculate cart quantities per unique product or across all item variations.', 'woo-product-table' ); ?></p>
    606615                    </div>
    607616                </td>
    … …  
    15101519                <div class="wpt-form-info">
    15111520                    <?php wpt_doc_link('https://wooproducttable.com/doc/advance-uses/sort-table-column/') ?>
     1521                    <p><?php esc_html_e( 'Allow visitors to sort table columns alphabetically or numerically on frontend.', 'woo-product-table' ); ?></p>
    15121522                </div>
    15131523            </td>
  • woo-product-table/tags/6.1.6/admin/admin-enqueue.php

    r3522314 r3837744  
    3737       
    3838       
    39         wp_enqueue_style( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/css/admin.css', array('select2'), WPT_DEV_VERSION, 'all' );
     39        $admin_css_file = WPT_Product_Table::getPath( 'BASE_DIR' ) . 'assets/css/admin.css';
     40        $admin_css_ver  = file_exists( $admin_css_file ) ? filemtime( $admin_css_file ) : WPT_DEV_VERSION;
     41        wp_enqueue_style( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/css/admin.css', array('select2'), $admin_css_ver, 'all' );
    4042
    4143        wpt_admin_notice_css_file_load();
    … …  
    9395        //wp_enqueue_script( 'select2-wpt' );
    9496
    95         wp_enqueue_script( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/js/admin.js', array( 'jquery','select2-wpt' ), WPT_DEV_VERSION, true );
     97        $admin_js_file = WPT_Product_Table::getPath( 'BASE_DIR' ) . 'assets/js/admin.js';
     98        $admin_js_ver = file_exists( $admin_js_file ) ? filemtime( $admin_js_file ) : WPT_DEV_VERSION;
     99        wp_enqueue_script( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/js/admin.js', array( 'jquery','select2-wpt' ), $admin_js_ver, true );
    96100       
    97101        $ajax_url = admin_url( 'admin-ajax.php' );
  • woo-product-table/tags/6.1.6/admin/class-codeastrology-expert-services.php

    r3772120 r3837744  
    249249                private static function render_review_page( $context ) {
    250250                        $links = self::get_contact_links( $context, 'free-store-review-page' );
     251
     252                        if ( ! empty( $context['key'] ) && $context['key'] === 'product-table-for-woocommerce' ) {
     253                                if ( empty( $GLOBALS['wpt_topbar_rendered'] ) ) {
     254                                        $wpt_topbar = defined( 'WPT_BASE_DIR' ) ? WPT_BASE_DIR . 'admin/page/topbar.php' : '';
     255                                        if ( $wpt_topbar && file_exists( $wpt_topbar ) ) {
     256                                                include $wpt_topbar;
     257                                        }
     258                                }
     259                        }
    251260                        ?>
    252261                        <div class="wrap caes-page caes-review-page">
  • woo-product-table/tags/6.1.6/admin/duplicate.php

    r3522314 r3837744  
    129129        if(isset( $actions['inline hide-if-no-js'] )) unset($actions['inline hide-if-no-js']);
    130130        if (current_user_can('edit_posts') ) {
    131                 $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?action=wpt_duplicate_as_draft&post=' . $post->ID, basename(__FILE__), 'duplicate_nonce' ) . '" title="Duplicate this Product Table" rel="permalink"><i class="wpt-table"></i> Duplicate</a>';
     131                $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?action=wpt_duplicate_as_draft&post=' . $post->ID, basename(__FILE__), 'duplicate_nonce' ) . '" title="Duplicate this Product Table" rel="permalink"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: -2px;" aria-hidden="true"><rect x="8" y="8" width="13" height="13" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/><path d="M14.5 11.5v6"/><path d="M11.5 14.5h6"/></svg> Duplicate</a>';
    132132        }
    133133        return $actions;
  • woo-product-table/tags/6.1.6/admin/functions.php

    r3522314 r3837744  
    6565}
    6666
    67 /**
    68  * Remove empty Array value from an Multi-dimensional Array
    69  * I have taken help from a stackoverflow tips.
    70  *
    71  * @param array $array Obviously should be an Array
    72  * @return array
    73  *
    74  * @link https://stackoverflow.com/questions/9895130/recursively-remove-empty-elements-and-subarrays-from-a-multi-dimensional-array
    75  *
    76  */
    77 function wpt_remove_empty_value_from_array($array)
    78 {
    79 
    80 
    81     if (! is_array($array)) return $array;
    82 
    83     foreach ($array as $key => &$value) {
    84         if (! is_bool($value) && empty($value)) {
    85             unset($array[$key]);
    86         } else {
    87             if (is_array($value)) {
    88                 $value = wpt_remove_empty_value_from_array($value);
    89                 if (! is_bool($value) && empty($value)) {
    90                     unset($array[$key]);
    91                 }
    92             }
    93         }
    94     }
    95 
    96     return $array;
    97 }
     67// wpt_remove_empty_value_from_array() is defined in includes/live-preview.php.
    9868
    9969
    … …  
    177147}
    178148//add_filter( 'wpto_admin_tab_array', 'wpt_admin_responsive_tab' );
    179 
    180 if (!function_exists('wpt_admin_responsive_tab_save')) {
    181     /**
    182      * Save Responsive Tab Data
    183      * @since 5.0.3.0
    184      * @param array $save_tab_array
    185      * @return array
    186      */
    187     function wpt_admin_responsive_tab_save($save_tab_array)
    188     {
    189         $save_tab_array['responsive'] = 'responsive';
    190         return $save_tab_array;
    191     }
    192 }
    193 add_filter('wpto_save_tab_array', 'wpt_admin_responsive_tab_save');
    194149
    195150if (!function_exists('wpt_column_style_for_all')) {
    … …  
    292247                    <br><label>Toggle Text</label>
    293248                    <input style="display: inline;" type="text" class="" name="column_settings[check][toggle_label]" value="">
    294                     <p>To show Hide Column or as Item inside Column, Check it.</p>
     249                    <p><?php echo esc_html__( 'Enable this to show or hide inner items when clicked.', 'woo-product-table' ); ?></p>
    295250                </div>
    296251            <?php } ?>
    … …  
    328283    }
    329284}
    330 
    331 if (!function_exists('wpt_data_manipulation_on_save')) {
    332 
    333     /**
    334      * Args Manipulation from Basic Tab
    335      * Used Filter:
    336      * $tab_data = apply_filters( 'wpto_tab_data_on_save', $tab_data, $tab, $post_id, $save_tab_array );
    337      * @since 2.8.3.5
    338      *
    339      * @param array $tab_data Data of current saving tab
    340      * @param string $tab Current saving tab name
    341      * @param int $post_id Current post ID
    342      * @param array $save_tab_array Array of all saving tabs
    343      * @return array
    344      */
    345     function wpt_data_manipulation_on_save($tab_data, $tab, $post_id, $save_tab_array)
    346     {
    347 
    348         if ('basics' == $tab && is_array($tab_data)) {
    349 
    350             /**
    351              * Query Relation for Taxonomy added
    352              * @version 2.8.3.5
    353              */
    354             $query_relation = ! isset($tab_data['query_relation']) ? 'IN' : $tab_data['query_relation'];
    355             $query_relation = $tab_data['query_relation'] ?? 'IN';
    356 
    357             $data = isset($tab_data['data']) ? $tab_data['data'] : false;
    358             $terms_string = 'terms';
    359             $terms = isset($data[$terms_string]) ? $data[$terms_string] : false;
    360             if (is_array($terms)) {
    361                 foreach ($terms as $term_key => $term_ids) {
    362                     $term_key_IN = $term_key . '_' . $query_relation; //IN
    363                     $tab_data['args']['tax_query'][$term_key_IN] = array(
    364                         'taxonomy'      => $term_key,
    365                         'field'         => 'id',
    366                         'terms'         => $term_ids, //Array of Term's IDs
    367                         'operator'      => 'IN' //$query_relation,//
    368                     );
    369                 }
    370             }
    371         }
    372         //        if( 'column_settings' == $tab && is_array( $tab_data ) ){
    373         //            foreach( $tab_data as $per_key => $per_data ){
    374         //                if( !empty( $per_key ) && is_array( $per_data ) ){
    375         //                    $tab_data[$per_key]['style_str'] = isset( $per_data['style'] ) && is_array( $per_data['style'] ) ? wpt_convert_style_from_arr( $per_data['style'] ) : '';
    376         //                }
    377         //            }
    378         //        }
    379 
    380         return $tab_data;
    381     }
    382 }
    383 add_filter('wpto_tab_data_on_save', 'wpt_data_manipulation_on_save', 10, 4);
    384285
    385286if (! function_exists('wpt_add_tabs')) {
  • woo-product-table/tags/6.1.6/admin/menu_plugin_setting_link.php

    r3522314 r3837744  
    1515            $wpt_links[] = '<a class="wpt-wp-plugin-list-link" href="https://wooproducttable.com/pricing/?utm_source=Product+Table+Dashboard&utm_medium=Free+Version&utm_content=Get+Pro" title="' . esc_attr__( 'Many awesome features is waiting for you', 'woo-product-table' ) . '" target="_blank">'.esc_html__( 'Get Premium','woo-product-table' ).'</a>';
    1616        }
     17        $wpt_links[] = '<a href="' . admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-dashboard' ) . '" title="' . esc_attr__( 'Dashboard', 'woo-product-table' ) . '"><strong>' . esc_html__( 'Dashboard', 'woo-product-table' ).'</strong></a>';
    1718        $wpt_links[] = '<a href="' . admin_url( 'post-new.php?post_type=wpt_product_table' ) . '" title="' . esc_attr__( 'Add Table', 'woo-product-table' ) . '">' . esc_html__( 'Create Table', 'woo-product-table' ).'</a>';
    18         $wpt_links[] = '<a href="' . admin_url( 'edit.php?post_type=wpt_product_table&page=woo-product-table-config' ) . '" title="' . esc_attr__( 'Table Settings', 'woo-product-table' ) . '">' . esc_html__( 'Table Settings', 'woo-product-table' ) . '</a>';
     19        $wpt_links[] = '<a href="' . admin_url( 'edit.php?post_type=wpt_product_table&page=woo-product-table-config' ) . '" title="' . esc_attr__( 'Table Settings', 'woo-product-table' ) . '">' . esc_html__( 'Settings', 'woo-product-table' ) . '</a>';
    1920        // $wpt_links[] = '<a href="https://codeastrology.com/my-support/?utm_source=Product+Table+Dashboard&utm_medium=Free+Version" title="' . esc_attr__( 'CodeAstrology Support', 'woo-product-table' ) . '" target="_blank">'.esc_html__( 'Support','woo-product-table' ).'</a>';
    2021
    … …  
    3839
    3940    if( $browse_plugins ){
    40         return $browse_plugins;//As $res
     41        return wpt_sort_priority_plugins( $browse_plugins );
    4142    }
    4243   
    … …  
    9495    }
    9596   
     97    return wpt_sort_priority_plugins( $res );
     98}
     99
     100/**
     101 * Sort plugins so priority plugins appear at the top in requested order.
     102 *
     103 * @param object $res
     104 * @return object
     105 */
     106function wpt_sort_priority_plugins( $res ) {
     107    if ( empty( $res ) || empty( $res->plugins ) || ! is_array( $res->plugins ) ) {
     108        return $res;
     109    }
     110
     111    $priority_slugs = [
     112        'woo-product-table',
     113        'woo-min-max-quantity-step-control-single',
     114        'wc-quantity-plus-minus-button',
     115        'product-sync-master-sheet',
     116        'sheet-to-wp-table-for-google-sheet',
     117        'woo-add-to-cart-text-change',
     118        'ultraaddons-elementor-lite',
     119        'ca-quick-view',
     120        'anywhere-elementor-template',
     121    ];
     122
     123    $plugin_map = [];
     124    $others     = [];
     125    foreach ( $res->plugins as $plugin ) {
     126        $slug = is_object( $plugin ) ? ( $plugin->slug ?? '' ) : ( $plugin['slug'] ?? '' );
     127        if ( $slug ) {
     128            $plugin_map[ $slug ] = $plugin;
     129        } else {
     130            $others[] = $plugin;
     131        }
     132    }
     133
     134    $sorted = [];
     135    foreach ( $priority_slugs as $slug ) {
     136        if ( isset( $plugin_map[ $slug ] ) ) {
     137            $sorted[] = $plugin_map[ $slug ];
     138            unset( $plugin_map[ $slug ] );
     139        }
     140    }
     141
     142    $res->plugins = array_merge( $sorted, array_values( $plugin_map ), $others );
    96143    return $res;
    97144}
  • woo-product-table/tags/6.1.6/admin/page-loader.php

    r3772120 r3837744  
    2424        require_once $this->base_dir . 'admin/class-codeastrology-expert-services.php';
    2525        require_once $this->base_dir . 'admin/handle/class-sale-notice.php';
     26        require_once $this->base_dir . 'admin/handle/class-dashboard.php';
     27
     28        $dashboard_handler = new \WOO_PRODUCT_TABLE\Admin\Handle\Dashboard_Handler();
     29        $dashboard_handler->run();
    2630
    2731        $this->is_pro = defined( 'WPT_PRO_DEV_VERSION' );
    … …  
    9599        //has come from admin/menu_plugin_settings_link.php file
    96100        add_action( 'admin_menu', [$this, 'admin_menu'], 2 );
     101        add_action( 'admin_menu', [$this, 'reorder_admin_menu'], 999 );
    97102        add_filter('admin_body_class', [$this, 'body_class']);
    98103        add_action( 'admin_enqueue_scripts', [$this, 'admin_enqueue_scripts'] );
     104        add_action( 'load-edit.php', [$this, 'load_all_tables_page'] );
     105        add_action( 'edit_form_top', [$this, 'render_post_edit_topbar'] );
     106        add_action( 'current_screen', [$this, 'setup_store_audit_topbar'] );
     107        add_action( 'wpt_product_table_page_wpt-free-store-audit', [$this, 'render_audit_topbar'], 1 );
     108        add_action( 'woo-product-table_page_wpt-free-store-audit', [$this, 'render_audit_topbar'], 1 );
    99109
    100110        if ( class_exists( '\WOO_PRODUCT_TABLE\Admin\Appseros\Src\Client' ) ) {
    … …  
    105115    }
    106116
     117    public function dashboard_page_render()
     118    {
     119        include $this->page_folder_dir . 'dashboard.php';
     120    }
     121
     122    public function templates_page_render()
     123    {
     124        include $this->page_folder_dir . 'templates-library.php';
     125    }
     126
     127    public function ecosystem_page_render()
     128    {
     129        include $this->page_folder_dir . 'ecosystem.php';
     130    }
     131
     132    public function load_all_tables_page()
     133    {
     134        global $typenow, $title;
     135        if ( $typenow === 'wpt_product_table' && empty( $_GET['page'] ) ) {
     136            $post_type_object = get_post_type_object( 'wpt_product_table' );
     137            $title = $post_type_object && isset( $post_type_object->labels->name ) ? $post_type_object->labels->name : __( 'Product Tables', 'woo-product-table' );
     138            require_once ABSPATH . 'wp-admin/admin-header.php';
     139            include $this->page_folder_dir . 'all-tables.php';
     140            require_once ABSPATH . 'wp-admin/admin-footer.php';
     141            exit;
     142        }
     143    }
     144
     145    public function render_post_edit_topbar( $post )
     146    {
     147        if ( isset( $post->post_type ) && $post->post_type === 'wpt_product_table' ) {
     148            include $this->topbar_file;
     149        }
     150    }
     151
     152    public function setup_store_audit_topbar( $current_screen )
     153    {
     154        if ( ! is_admin() || empty( $current_screen ) ) {
     155            return;
     156        }
     157
     158        $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
     159        if ( $page !== 'wpt-free-store-audit' ) {
     160            return;
     161        }
     162
     163        global $title;
     164        if ( empty( $title ) ) {
     165            $title = __( 'Free Store Audit', 'woo-product-table' );
     166        }
     167
     168        if ( ! empty( $current_screen->id ) ) {
     169            add_action( $current_screen->id, [$this, 'render_audit_topbar'], 1 );
     170        }
     171    }
     172
     173    public function render_audit_topbar()
     174    {
     175        if ( ! empty( $GLOBALS['wpt_topbar_rendered'] ) ) {
     176            return;
     177        }
     178        $GLOBALS['wpt_topbar_rendered'] = true;
     179
     180        $this->topbar_sub_title = __( 'Get a free expert audit for your WooCommerce store', 'woo-product-table' );
     181        if ( ! empty( $this->topbar_file ) && file_exists( $this->topbar_file ) ) {
     182            include $this->topbar_file;
     183        }
     184    }
     185
    107186    public function configure_page_render()
    108187    {
    … …  
    113192        include $this->page_folder_dir . 'configure.php';
    114193    }
     194
    115195    public function admin_menu()
    116196    {
    117197        $proString = $this->is_pro ? esc_html__( ' Pro', 'woo-product-table' ) : '';
    118         add_submenu_page( $this->main_slug, esc_html__( 'Table Settings ', 'woo-product-table' ) . $proString,  esc_html__( 'Table Settings', 'woo-product-table' ), WPT_CAPABILITY, 'woo-product-table-config', [$this, 'configure_page_render'] );
    119        
     198
     199        // 1. Dashboard (The Main Hub)
     200        add_submenu_page(
     201            $this->main_slug,
     202            esc_html__( 'Dashboard', 'woo-product-table' ),
     203            esc_html__( 'Dashboard', 'woo-product-table' ),
     204            WPT_CAPABILITY,
     205            'wpt-dashboard',
     206            [$this, 'dashboard_page_render'],
     207            1
     208        );
     209
     210        // 2. Starter Templates
     211        add_submenu_page(
     212            $this->main_slug,
     213            esc_html__( 'Templates', 'woo-product-table' ),
     214            esc_html__( 'Templates', 'woo-product-table' ),
     215            WPT_CAPABILITY,
     216            'wpt-templates',
     217            [$this, 'templates_page_render']
     218        );
     219
     220        // 3. Table Settings
     221        add_submenu_page(
     222            $this->main_slug,
     223            esc_html__( 'Table Settings ', 'woo-product-table' ) . $proString,
     224            esc_html__( 'Table Settings', 'woo-product-table' ),
     225            WPT_CAPABILITY,
     226            'woo-product-table-config',
     227            [$this, 'configure_page_render']
     228        );
     229
     230        // 4. Addons & Tools
     231        add_submenu_page(
     232            $this->main_slug,
     233            esc_html__( 'Addons & Tools', 'woo-product-table' ),
     234            esc_html__( 'Addons & Tools', 'woo-product-table' ),
     235            WPT_CAPABILITY,
     236            'wpt-ecosystem',
     237            [$this, 'ecosystem_page_render']
     238        );
    120239
    121240        if (class_exists('\PSSG_Sync_Sheet\App\Handle\Quick_Table')) {
    … …  
    123242        }
    124243       
    125        
     244        // Browse Plugins (legacy route preserved)
    126245        add_submenu_page( $this->main_slug, esc_html__( 'Browse Plugins', 'woo-product-table' ),  esc_html__( 'Browse Plugins', 'woo-product-table' ), WPT_CAPABILITY, 'wpt-browse-plugins', [$this, 'browse_plugins_html'] );
     246
    127247        if( ! $this->is_pro ){
    128248            //Get Premium link
    129             add_submenu_page( $this->main_slug, esc_html__( 'Get Premium', 'woo-product-table' ),  esc_html__( 'Get Premium', 'woo-product-table' ), 'read', 'https://wooproducttable.com/pricing/' );
    130             // add_submenu_page( $this->main_slug, esc_html__( 'Addons', 'woo-product-table' ),  esc_html__( 'Addons', 'woo-product-table' ), WPT_CAPABILITY, 'woo-product-table-addons-list', [$this, 'addons_list_html'] );
    131             // add_submenu_page( $this->main_slug, esc_html__( 'Tutorials', 'woo-product-table' ),  esc_html__( 'Tutorials', 'woo-product-table' ), WPT_CAPABILITY, 'woo-product-table-tutorial-page', [$this, 'html_tutorial_page'] );
    132         }
     249            add_submenu_page( $this->main_slug, esc_html__( 'Get Premium', 'woo-product-table' ),  esc_html__( 'Get Premium', 'woo-product-table' ), 'read', 'https://wooproducttable.com/pricing/?utm_source=admin_menu&utm_medium=menu_item&utm_campaign=get_premium' );
     250        }
     251    }
     252
     253    /**
     254     * Reorder submenus into a clean, intuitive hierarchy.
     255     * Puts Dashboard as the first item so clicking the main menu opens the Dashboard!
     256     * Cleans up repetitive promotional submenus from the left sidebar so it stays focused and uncluttered.
     257     */
     258    public function reorder_admin_menu()
     259    {
     260        // Prevent PHP 8.1+ strip_tags(null) deprecation notice in admin-header.php
     261        // for submenus removed from sidebar but accessed directly via URL/topbar
     262        global $title;
     263        $current_page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
     264        if ( empty( $title ) ) {
     265            if ( $current_page === 'wpt-free-store-audit' ) {
     266                $title = __( 'Free Store Audit', 'woo-product-table' );
     267            } elseif ( $current_page === 'wpt-browse-plugins' ) {
     268                $title = __( 'Browse Plugins', 'woo-product-table' );
     269            }
     270        }
     271
     272        // Remove individual duplicate / promotional items from the left sidebar
     273        // (They are already integrated cleanly inside "Addons & Tools", Dashboard, and the topbar)
     274        remove_submenu_page( $this->main_slug, 'wpt-free-store-audit' );
     275        remove_submenu_page( $this->main_slug, 'wpt-browse-plugins' );
     276
     277        global $submenu;
     278        if ( ! isset( $submenu[$this->main_slug] ) || ! is_array( $submenu[$this->main_slug] ) ) {
     279            return;
     280        }
     281
     282        $menu_items = $submenu[$this->main_slug];
     283        $ordered = [];
     284
     285        // Desired clean, focused order
     286        $priority_slugs = [
     287            'wpt-dashboard',
     288            'edit.php?post_type=wpt_product_table',
     289            'post-new.php?post_type=wpt_product_table',
     290            'wpt-templates',
     291            'woo-product-table-config',
     292            'wpt-ecosystem',
     293            'wpt-product-quick-edit',
     294            'woo-product-table-license',
     295        ];
     296
     297        foreach ( $priority_slugs as $slug ) {
     298            foreach ( $menu_items as $key => $item ) {
     299                if ( isset( $item[2] ) && $item[2] === $slug ) {
     300                    $ordered[] = $item;
     301                    unset( $menu_items[$key] );
     302                    break;
     303                }
     304            }
     305        }
     306
     307        // Append remaining items (like Get Premium for free version or custom items)
     308        foreach ( $menu_items as $item ) {
     309            if ( isset( $item[2] ) && is_string( $item[2] ) && $item[2] !== '' ) {
     310                $ordered[] = $item;
     311            }
     312        }
     313
     314        $submenu[$this->main_slug] = $ordered;
    133315    }
    134316
    … …  
    137319        global $current_screen;
    138320
    139        
    140321        $s_id = isset( $current_screen->id ) ? $current_screen->id : '';
     322        $current_page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
    141323       
    142324        if( $s_id == 'edit-wpt_product_table' || $s_id == 'wpt_product_table' ){
    143             // $classes .= ' wp-default-content-wrapper ';
    144         }else if( strpos( $s_id, $this->plugin_prefix ) !== false ){
     325            $classes .= ' wpt-zero-body wpt-edit-table-page ';
     326        }else if( strpos( $s_id, $this->plugin_prefix ) !== false || strpos( $s_id, 'wpt_product_table' ) !== false || strpos( $s_id, 'wpt-free-store-audit' ) !== false ){
    145327            $classes .= ' wpt-zero-body ';
    146328        }
    147329       
    148        
     330        if ( $current_page === 'wpt-browse-plugins' ) {
     331            $classes .= ' plugin-install-php wpt-browse-plugins-body ';
     332        }
     333
    149334        return $classes;
    150335
    151336    }
     337
    152338    public function admin_enqueue_scripts()
    153339    {
    … …  
    155341
    156342        $s_id = isset( $current_screen->id ) ? $current_screen->id : '';
    157         if( strpos( $s_id, $this->plugin_prefix ) === false ) return;
     343        if( strpos( $s_id, $this->plugin_prefix ) === false && strpos( $s_id, 'wpt_product_table' ) === false && strpos( $s_id, 'wpt-free-store-audit' ) === false ) return;
    158344
    159345        add_filter('admin_footer_text',[$this, 'admin_footer_text']);
    160346
    161 
    162347        $this->live_chat_script();
    163348
    164         wp_register_style( $this->plugin_prefix . '-new-admin', $this->base_url . 'assets/css/new-admin.css', false, $this->dev_version );
     349        $new_admin_css_file = $this->base_dir . 'assets/css/new-admin.css';
     350        $new_admin_css_ver  = file_exists( $new_admin_css_file ) ? filemtime( $new_admin_css_file ) : $this->dev_version;
     351        wp_register_style( $this->plugin_prefix . '-new-admin', $this->base_url . 'assets/css/new-admin.css', false, $new_admin_css_ver );
    165352        wp_enqueue_style( $this->plugin_prefix . '-new-admin' );
    166     }
    167 
     353
     354        $js_ver  = file_exists( $this->base_dir . 'assets/js/wpt-dashboard.js' ) ? filemtime( $this->base_dir . 'assets/js/wpt-dashboard.js' ) : $this->dev_version;
     355        $css_ver = file_exists( $this->base_dir . 'assets/css/wpt-dashboard.css' ) ? filemtime( $this->base_dir . 'assets/css/wpt-dashboard.css' ) : $this->dev_version;
     356
     357        // Enqueue modern clean dashboard styles and script (dependent on wpt-admin so it always overrides)
     358        wp_register_style( 'wpt-modern-dashboard', $this->base_url . 'assets/css/wpt-dashboard.css', [ 'wpt-admin', $this->plugin_prefix . '-new-admin' ], $css_ver );
     359        wp_enqueue_style( 'wpt-modern-dashboard' );
     360
     361        wp_register_script( 'wpt-modern-dashboard-js', $this->base_url . 'assets/js/wpt-dashboard.js', [ 'jquery' ], $js_ver, true );
     362        wp_localize_script( 'wpt-modern-dashboard-js', 'wpt_dashboard_obj', [
     363            'ajax_url'      => admin_url( 'admin-ajax.php' ),
     364            'nonce'         => wp_create_nonce( 'wpt_dashboard_nonce' ),
     365            'tables_url'    => admin_url( 'edit.php?post_type=wpt_product_table' ),
     366            'dashboard_url' => admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-dashboard' ),
     367            'templates_url' => admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-templates' ),
     368            'ecosystem_url' => admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-ecosystem' ),
     369        ] );
     370        wp_enqueue_script( 'wpt-modern-dashboard-js' );
     371
     372        $current_page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
     373        if ( $current_page === 'wpt-browse-plugins' ) {
     374            wp_enqueue_script( 'plugin-install' );
     375            wp_enqueue_script( 'updates' );
     376            add_thickbox();
     377        }
     378    }
    168379
    169380    /**
    … …  
    196407        <?php
    197408    }
     409
    198410    public function admin_footer_text($text)
    199411    {
    … …  
    208420        return '<span id="footer-thankyou" class="wpt-footer-thankyou">' . wp_kses_post( $text ) . '</span>';
    209421    }
     422
    210423    public function browse_plugins_html()
    211424    {
    212         //In future, I will make it like min max plugin - which I already did
    213         // add_filter( 'plugins_api_result', [$this, 'plugins_api_result'], 1, 3 );
    214425        $this->topbar_sub_title = __( 'Browse our Plugins','woo-product-table' );
    215426        include $this->topbar_file;
    … …  
    243454        include $this->page_folder_dir . 'addons-list.php';
    244455    }
     456
    245457    public function html_tutorial_page()
    246458    {
    247         //In future, I will make it like min max plugin - which I already did
    248         // add_filter( 'plugins_api_result', [$this, 'plugins_api_result'], 1, 3 );
    249459        $this->topbar_sub_title = __( 'Tutorial','woo-product-table' );
    250460        include $this->topbar_file;
    … …  
    260470        include $this->topbar_file;
    261471        include $this->page_folder_dir . 'product-bulk-edit.php';
    262        
    263472    }
    264473
    … …  
    280489        $this->license_data = get_option($this->license_data_key);
    281490
    282        
    283491        add_action( 'admin_notices', [$this, 'license_activation_message'] );
    284492
    285         /**
    286          * Actually if not found lisen data, we will return null here
    287          *
    288          * @since 3.4.3.0
    289          * @author Saiful Islam <codersaiful@gmail.com>
    290          */
    291493        if( empty( $this->license_status ) || empty( $this->license_data ) ) return;
    292494       
    … …  
    295497        if('lifetime' == $expires) return;
    296498        $exp_timestamp = strtotime($expires);
    297         /**
    298          * keno ami ei timestamp niyechi.
    299          * asole expire a zodi faka ase, tahole ta 1 jan, 1970 as strtotime er output.
    300          *
    301          * ar jehetu amora 2010 er por kaj suru korechi. tai sei expire date ba ager date asar kOnO karonoi nai.
    302          * tai zodi 2012 er kom timestamp ase amora return null kore debo.
    303          * za already diyechi: if( $exp_timestamp < $year2010_timestamp ) return; by this line. niche follow korun.
    304          */
     499
    305500        $year2010_timestamp = strtotime('2023-09-08 23:59:59');
    306501        if( $exp_timestamp < $year2010_timestamp ) return;
    307502
    308         //ekhon amora bortoman date er sathe tulona korbo
    309503        if($exp_timestamp < time()){
    310 
    311504            $this->exp_timestamp = $exp_timestamp;
    312505
    … …  
    316509                update_option( $this->license_status_key, $this->invalid_status );
    317510                update_option( $this->license_data_key, $this->license_data );
    318 
    319                
    320511            }
    321512            add_action( 'admin_notices', [$this, 'renew_license_notice'] );
    322513        }
    323        
    324514    }
    325515
    326516    public function license_activation_message()
    327517    {
    328 
    329518        global $current_screen;
    330519        if(strpos($current_screen->id, 'woo-product-table-license') !== false) return;
    … …  
    345534                <img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-license-brand-logo">
    346535                    Your License of <strong>Woo Product Table pro</strong> is <span style="color: #d00;font-weight:bold;">Invalid/Inactive</span>
    347                     %1$s <a href="%2$s">%3$s</a>
     536                    %1$s <a href="%2$s"><?php echo esc_html( $link_label ); ?></a>
    348537                </div>
    349538            </div>
    … …  
    353542        }
    354543    }
     544
    355545    public function renew_license_notice()
    356546    {
    357 
    358547        if(empty($this->item_id)) return;
    359548        $wpt_logo = WPT_ASSETS_URL . 'images/logo.png';
    … …  
    368557            <img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-license-brand-logo">
    369558                Your License of <strong>Woo Product Table pro</strong> has been expired at <span style="color: #d00;font-weight:bold;"><?php echo esc_html( $expired_date ); ?></span>
    370                 %1$s <a href="%2$s" target="_blank">%3$s</a>
     559                %1$s <a href="<?php echo esc_url( $link ); ?>" target="_blank"><?php echo esc_html( $link_label ); ?></a>
    371560            </div>
    372561        </div>
    … …  
    375564        printf( wp_kses_post( $full_message ), esc_html( $message ), esc_url( $link ), esc_html( $link_label ) );   
    376565    }
    377 
    378    
    379566}
  • woo-product-table/tags/6.1.6/admin/page/browse-plugins.php

    r3522314 r3837744  
    1 <div class="wrap wpt_wrap wpt-content">
     1<div class="wrap wpt_wrap wpt-content wpt-browse-plugins-page">
    22    <h1 class="wp-heading "></h1>
    33    <div class="fieldwrap">
  • woo-product-table/tags/6.1.6/admin/page/configure.php

    r3645101 r3837744  
    3939           
    4040            <div class="wpt-configure-form-header">
    41                 <div class="wpt-configure-tab-wrapper wpt-temp-menu-wrapper wpt-section-panel no-background"></div>
    42                 <input type="text" id="wpt-setting-search-input" class="wpt-setting-search-input" placeholder="🔍 Search settings by label/value/anything">
     41                <div class="wpt-configure-tab-wrapper wpt-temp-menu-wrapper wpt-section-panel no-background">
     42                    <a href="#wpt-configurate-main-section" class="tab-button wpt-button link-wpt-configurate-main-section"><?php esc_html_e( 'Settings', 'woo-product-table' ); ?></a>
     43                    <a href="#wpt-basic-settings" class="tab-button wpt-button link-wpt-basic-settings"><?php esc_html_e( 'Basic', 'woo-product-table' ); ?></a>
     44                    <a href="#wpt-label-settings" class="tab-button wpt-button link-wpt-label-settings"><?php esc_html_e( 'Label Text', 'woo-product-table' ); ?></a>
     45                    <a href="#wpt-all-messages-settings" class="tab-button wpt-button link-wpt-all-messages-settings"><?php esc_html_e( 'All Messages', 'woo-product-table' ); ?></a>
     46                    <a href="#show-all" class="tab-button wpt-button"><?php esc_html_e( 'Show All', 'woo-product-table' ); ?></a>
     47                </div>
     48                <input type="text" id="wpt-setting-search-input" class="wpt-setting-search-input" placeholder="<?php esc_attr_e( 'Search settings...', 'woo-product-table' ); ?>">
    4349            </div>
     50
     51            <script>
     52            (function() {
     53                var hash = window.location.hash;
     54                var saved = '';
     55                try { saved = localStorage.getItem('wpt_active_config_tab') || ''; } catch(e){}
     56                var activeTab = hash || saved || '#wpt-configurate-main-section';
     57                if (activeTab && activeTab !== '#show-all') {
     58                    var style = document.createElement('style');
     59                    style.id = 'wpt-instant-tab-css';
     60                    style.innerHTML = '#wpt-main-configuration-form div.wpt-section-panel:not(.wpt-configure-tab-wrapper):not(.wpt-full-form-submit-wrapper):not(' + activeTab + ') { display: none !important; } ' +
     61                                      '#wpt-main-configuration-form div.wpt-section-panel' + activeTab + ' { display: block !important; } ' +
     62                                      '.wpt-configure-tab-wrapper a[href="' + activeTab + '"] { background: #ffffff !important; color: #2563eb !important; font-weight: 600 !important; border: 1px solid #cbd5e1 !important; box-shadow: 0 1px 3px rgba(15,23,42,0.08) !important; }';
     63                    document.head.appendChild(style);
     64                }
     65
     66                // Restore exact scroll position after saving
     67                var savedScrollY = null;
     68                try {
     69                    savedScrollY = sessionStorage.getItem('wpt_saved_scroll_y');
     70                } catch(e) {}
     71
     72                if (savedScrollY !== null) {
     73                    if ('scrollRestoration' in history) {
     74                        history.scrollRestoration = 'manual';
     75                    }
     76                    var targetY = parseInt(savedScrollY, 10);
     77                    if (!isNaN(targetY)) {
     78                        window.scrollTo(0, targetY);
     79                        var restoreScroll = function() {
     80                            window.scrollTo(0, targetY);
     81                        };
     82                        requestAnimationFrame(restoreScroll);
     83                        setTimeout(restoreScroll, 50);
     84                        setTimeout(restoreScroll, 150);
     85                        setTimeout(restoreScroll, 300);
     86                        setTimeout(function() {
     87                            restoreScroll();
     88                            try { sessionStorage.removeItem('wpt_saved_scroll_y'); } catch(e) {}
     89                        }, 500);
     90                    }
     91                }
     92            })();
     93
     94            // Capture exact scroll position right before form submission or save button click
     95            document.addEventListener('submit', function(e) {
     96                if (e.target && e.target.id === 'wpt-main-configuration-form') {
     97                    try {
     98                        var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     99                        sessionStorage.setItem('wpt_saved_scroll_y', y);
     100                        sessionStorage.setItem('wpt_just_saved', 'true');
     101                    } catch(err) {}
     102                }
     103            }, true);
     104
     105            document.addEventListener('click', function(e) {
     106                var btn = e.target && e.target.closest ? e.target.closest('button.configure_submit, .configure_submit') : null;
     107                if (btn) {
     108                    try {
     109                        var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     110                        sessionStorage.setItem('wpt_saved_scroll_y', y);
     111                        sessionStorage.setItem('wpt_just_saved', 'true');
     112                    } catch(err) {}
     113                }
     114            }, true);
     115            </script>
     116
     117
     118
     119
    44120
    45121
    … …  
    57133                                    <div class="wpt-table-header-inside">
    58134                                        <h3><?php echo esc_html__( 'Settings', 'woo-product-table' ); ?></h3>
     135                                        <p class="wpt-section-subtitle"><?php esc_html_e( 'Configure storewide table behaviors, shop archive redirection, and display defaults.', 'woo-product-table' ); ?></p>
    59136                                    </div>
    60137
    61138                                </th>
    62139                                <th>
    63                                     <div class="wpt-table-header-right-side"></div>
     140                                    <div class="wpt-table-header-right-side">
     141                                        <span class="wpt-panel-badge"><i class="wpt-cog-alt"></i> <?php esc_html_e( 'General Preferences', 'woo-product-table' ); ?></span>
     142                                    </div>
    64143                                </th>
    65144                            </tr>
    … …  
    103182            </div>
    104183
     184        <script>
     185        (function($) {
     186            if (!$) return;
     187            if (typeof $.fn.customSelect !== 'function') {
     188                $.fn.customSelect = function (options) {
     189                    const settings = $.extend({
     190                        parentClass: '',
     191                        parentId: '',
     192                        className: ''
     193                    }, options);
     194                    return this.each(function () {
     195                        const $select = $(this);
     196                        var tagName = $select[0].tagName.toLowerCase();
     197                        if (tagName !== 'select') return;
     198
     199                        if ($select.find('option').length > 4) return;
     200                        if ($select.hasClass('wpt_select2')) return;
     201                        if ($select.hasClass('wpt_query_terms')) return;
     202                        if ($select.hasClass('wpt_table__for_variation')) return;
     203                        if ($select.hasClass('wpt_table_on_archive')) return;
     204                        if ($select.hasClass('product_includes_excludes')) return;
     205
     206                        const selectedValue = $select.val();
     207                        const name = $select.attr('name');
     208                        const id = $select.attr('id');
     209
     210                        const attributes = $select[0].attributes;
     211                        const inputAttrs = {};
     212                        var hindenInputClassName = '';
     213                        $.each(attributes, function () {
     214                            if (this.name !== 'class') {
     215                                inputAttrs[this.name] = this.value;
     216                            } else if (this.name == 'class') {
     217                                inputAttrs['backup_class'] = this.value;
     218                                hindenInputClassName = this.value;
     219                            }
     220                        });
     221
     222                        const $wrapper = $('<div class="custom-select-box-wrapper sfl-auto-gen-box"></div>');
     223                        if (settings.parentClass) {
     224                            $wrapper.addClass(settings.parentClass);
     225                        }
     226                        if (settings.parentId) {
     227                            $wrapper.attr('id', settings.parentId);
     228                        }
     229
     230                        const $hiddenInput = $('<input type="hidden">')
     231                            .addClass('custom-select-box-input')
     232                            .val(selectedValue)
     233                            .attr('name', name)
     234                            .attr('id', id)
     235                            .attr(inputAttrs);
     236
     237                        if (settings.className) {
     238                            $hiddenInput.addClass(settings.className);
     239                        }
     240                        $hiddenInput.addClass(hindenInputClassName);
     241
     242                        const $boxesContainer = $('<div class="wpt-custom-select-boxes"></div>');
     243
     244                        $select.find('option').each(function () {
     245                            const $option = $(this);
     246                            const value = $option.val();
     247                            const text = $option.text();
     248                            const isSelected = $option.is(':selected');
     249                            const isDisabled = $option.is(':disabled');
     250
     251                            const $box = $('<div class="wpt-custom-select-box"></div>')
     252                                .text(text)
     253                                .attr('data-value', value);
     254
     255                            if (isSelected) $box.addClass('active');
     256                            if (isDisabled) $box.addClass('disabled');
     257
     258                            $boxesContainer.append($box);
     259                        });
     260
     261                        const $parent = $select.parent();
     262                        const $afterSelectContent = $select.nextAll('p, span, strong, a');
     263                        const $contentWrapper = $('<div class="wpt-extra-content"></div>');
     264                        if ($afterSelectContent.length) {
     265                            $afterSelectContent.each(function () {
     266                                $contentWrapper.append($(this).detach());
     267                            });
     268                        }
     269
     270                        $wrapper.append($hiddenInput).append($boxesContainer).append($contentWrapper);
     271                        $select.replaceWith($wrapper);
     272
     273                        $boxesContainer.on('click', '.wpt-custom-select-box', function (e) {
     274                            e.preventDefault();
     275                            e.stopPropagation();
     276                            const $clicked = $(this);
     277                            if ($clicked.hasClass('disabled')) return;
     278
     279                            $boxesContainer.find('.wpt-custom-select-box').removeClass('active');
     280                            $clicked.addClass('active');
     281                            $hiddenInput.val($clicked.data('value')).trigger('change');
     282                        });
     283                    });
     284                };
     285            }
     286
     287            // Immediately convert configuration form selects before initial paint
     288            $('#wpt-main-configuration-form .wpt-form-control select, #wpt_table_footer_possition, #wpt_cf_search_box').customSelect();
     289        })(window.jQuery);
     290        </script>
    105291        </form>
    106292
  • woo-product-table/tags/6.1.6/admin/page/topbar.php

    r3522314 r3837744  
    11<?php
    2 $wpt_logo = WPT_ASSETS_URL . 'images/logo.png';
     2/**
     3 * Modern Shared Top Header & Sub-Navigation Bar
     4 *
     5 * Appears at the top of all Woo Product Table admin pages and tabs.
     6 * Matches the unified Product Table Studio design (Image 1).
     7 *
     8 * @package WOO_PRODUCT_TABLE
     9 */
    310
    4 /**
    5  * This following part actually
    6  * for our both version
    7  *
    8  * ekta en vato nd arekta amader mull site laisens er jonno.
    9  * code vato hole to WC_MMQ_PRO::$direct er value null thakbe
    10  * tokhon amra License menu ta ekhane dekhabo na.
    11  *
    12  * ********************
    13  * arekta prosno jagte pare.
    14  * ei lai sense er jonno to ekta property achei amade Page_Loader class e
    15  * tarpor o keno amra ekhane notun kore check korchi.
    16  *
    17  * asoel ei tobbar.php file ta onno class diye o , jemon \WC_MMQ_PRO\Admin\License\Init class eo
    18  * load kora hoyeche. tokhon to $this->license pabe na.
    19  * tai notun kore check korechi.
    20  */
    21 $license_direct = $pro = $license_page_slug = false;
    22 if( class_exists( '\WOO_Product_Table' ) ){
    23     $pro = true;
    24     $license_direct = property_exists( '\WOO_Product_Table','direct' ) ? \WOO_Product_Table::$direct : false;
    25     $license_page_slug = defined('WPT_EDD_LICENSE_PAGE') ? WPT_EDD_LICENSE_PAGE : false;
     11use WOO_PRODUCT_TABLE\Admin\Handle\Dashboard_Handler;
     12
     13if ( ! defined( 'ABSPATH' ) ) {
     14    exit;
    2615}
    27 global $current_screen;
    28 $lisence_page_bool = strpos( $current_screen->id, $license_page_slug );
    2916
    30 $topbar_sub_title = __( 'Manage and Settings', 'woo-product-table' );
    31 if( isset( $this->topbar_sub_title ) && ! empty( $this->topbar_sub_title ) ){
    32     $topbar_sub_title = $this->topbar_sub_title;
     17$GLOBALS['wpt_topbar_rendered'] = true;
     18
     19// 1. Get Metrics & Versions
     20$metrics = class_exists( '\WOO_PRODUCT_TABLE\Admin\Handle\Dashboard_Handler' )
     21    ? Dashboard_Handler::get_metrics()
     22    : [
     23        'plugin_version' => defined( 'WPT_DEV_VERSION' ) ? WPT_DEV_VERSION : '6.1.4.0',
     24        'is_pro'         => defined( 'WPT_PRO_DEV_VERSION' ) || class_exists( '\WOO_Product_Table' ),
     25        'pro_version'    => defined( 'WPT_PRO_DEV_VERSION' ) ? WPT_PRO_DEV_VERSION : '',
     26    ];
     27
     28$brand_logo = defined( 'WPT_BASE_URL' ) ? WPT_BASE_URL . 'assets/images/logo.png' : ( defined( 'WPT_ASSETS_URL' ) ? WPT_ASSETS_URL . 'images/logo.png' : '' );
     29
     30// 2. Navigation URLs
     31$dashboard_url  = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-dashboard' );
     32$all_tables_url = admin_url( 'edit.php?post_type=wpt_product_table' );
     33$new_table_url  = admin_url( 'post-new.php?post_type=wpt_product_table' );
     34$templates_url  = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-templates' );
     35$settings_url   = admin_url( 'edit.php?post_type=wpt_product_table&page=woo-product-table-config' );
     36$ecosystem_url  = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-ecosystem' );
     37$audit_url      = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-free-store-audit' );
     38$browse_url     = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-browse-plugins' );
     39
     40// License & Pro info
     41$license_page_slug = 'woo-product-table-license';
     42if ( defined( 'WPT_EDD_LICENSE_PAGE' ) ) {
     43    $license_page_slug = WPT_EDD_LICENSE_PAGE;
     44}
     45$license_url = admin_url( 'edit.php?post_type=wpt_product_table&page=' . $license_page_slug );
     46$doc_url     = 'https://wooproducttable.com/documentation/';
     47$pricing_url = 'https://wooproducttable.com/pricing/?utm_source=topbar&utm_medium=button&utm_campaign=get_pro';
     48
     49// 3. Determine Active Tab and Subtitle
     50global $current_screen, $pagenow;
     51$current_page      = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
     52$current_post_type = isset( $_GET['post_type'] ) ? sanitize_text_field( wp_unslash( $_GET['post_type'] ) ) : ( isset( $GLOBALS['typenow'] ) ? $GLOBALS['typenow'] : '' );
     53
     54$active_tab    = 'dashboard';
     55$page_subtitle = __( 'High-Converting Wholesale & Product Tables for WooCommerce', 'woo-product-table' );
     56
     57if ( $current_page === 'wpt-dashboard' ) {
     58    $active_tab    = 'dashboard';
     59    $page_subtitle = __( 'High-Converting Wholesale & Product Tables for WooCommerce', 'woo-product-table' );
     60} elseif ( $current_page === 'wpt-templates' ) {
     61    $active_tab    = 'templates';
     62    $page_subtitle = __( 'Browse and import pre-built, high-converting product table templates', 'woo-product-table' );
     63} elseif ( $current_page === 'woo-product-table-config' ) {
     64    $active_tab    = 'settings';
     65    $page_subtitle = __( 'Configure global table behaviors, query defaults, and UI controls', 'woo-product-table' );
     66} elseif ( $current_page === 'wpt-ecosystem' ) {
     67    $active_tab    = 'ecosystem';
     68    $page_subtitle = __( 'Extend Woo Product Table with powerful companion tools and custom services', 'woo-product-table' );
     69} elseif ( $current_page === 'wpt-free-store-audit' ) {
     70    $active_tab    = 'audit';
     71    $page_subtitle = __( 'Get a free expert audit for your WooCommerce store', 'woo-product-table' );
     72} elseif ( $current_page === 'wpt-browse-plugins' ) {
     73    $active_tab    = 'plugins';
     74    $page_subtitle = __( 'Discover helpful WordPress and WooCommerce plugins by CodeAstrology', 'woo-product-table' );
     75} elseif ( $current_page === $license_page_slug || strpos( (string) $current_page, 'license' ) !== false ) {
     76    $active_tab    = 'license';
     77    $page_subtitle = __( 'Manage your Woo Product Table Pro license and updates', 'woo-product-table' );
     78} elseif ( $current_page === 'wpt-product-quick-edit' ) {
     79    $active_tab    = 'quick-edit';
     80    $page_subtitle = __( 'Quickly edit your WooCommerce products in a bulk sheet table', 'woo-product-table' );
     81} elseif ( $pagenow === 'post-new.php' && $current_post_type === 'wpt_product_table' ) {
     82    $active_tab    = '';
     83    $page_subtitle = __( 'Create a new customized product table for your store', 'woo-product-table' );
     84} elseif ( $pagenow === 'post.php' && $current_post_type === 'wpt_product_table' ) {
     85    $active_tab    = 'all-tables';
     86    $page_subtitle = __( 'Edit table columns, query, design, conditions, and responsive settings', 'woo-product-table' );
     87} elseif ( $pagenow === 'edit.php' && $current_post_type === 'wpt_product_table' && empty( $current_page ) ) {
     88    $active_tab    = 'all-tables';
     89    $page_subtitle = __( 'Manage, edit, copy shortcodes, and scale all your store tables', 'woo-product-table' );
     90}
     91
     92if ( ! empty( $topbar_sub_title ) && is_string( $topbar_sub_title ) && $topbar_sub_title !== __( 'Manage and Settings', 'woo-product-table' ) ) {
     93    $page_subtitle = $topbar_sub_title;
    3394}
    3495?>
    35 <div class="wpt-header wpt-clearfix">
    36     <div class="container-flued">
    37         <div class="col-lg-7">
    38             <div class="wpt-logo-wrapper-area">
    39                 <div class="wpt-logo-area">
    40                     <img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-brand-logo">
    41                 </div>
    42                 <div class="wpt-main-title">
    43                     <h2 class="wpt-ntitle">
    44                         <?php echo esc_html_e("Woo Product Table", 'woo-product-table');?>
    45                     </h2>
    46                 </div>
    47                 <div class="wpt-extra-data">
    48                    
    49                     <span class="wpt-version">v<?php echo esc_html( WPT_DEV_VERSION ); ?></span>
    50                     <?php
    51                     if( wpt_is_pro() ) : ?>
    52                         <span class="wpt-pro-version-data" style="display: block;">
    53                             <span class="title-name"><?php echo esc_html_e("Premium", 'woo-product-table'); ?></span>
    54                             <span class="version-number">v<?php echo esc_html( WPT_PRO_DEV_VERSION ); ?></span>
     96
     97<!-- Sticky Top Navigation Header Group -->
     98<div class="wpt-sticky-header-wrap">
     99    <!-- 1. Modern Top Header with Free & Pro Version Display -->
     100    <header class="wpt-top-header">
     101        <div class="wpt-top-header-left">
     102            <a href="<?php echo esc_url( $dashboard_url ); ?>" style="display: flex; align-items: center; text-decoration: none;">
     103                <img src="<?php echo esc_url( $brand_logo ); ?>" alt="Woo Product Table Logo" class="wpt-brand-icon">
     104            </a>
     105            <div class="wpt-brand-meta">
     106                <div class="wpt-brand-title-row">
     107                    <h1 class="wpt-brand-title">
     108                        <a href="<?php echo esc_url( $dashboard_url ); ?>" style="text-decoration: none; color: inherit;">
     109                            <?php esc_html_e( 'Woo Product Table', 'woo-product-table' ); ?>
     110                        </a>
     111                    </h1>
     112                    <span class="wpt-badge-version" title="<?php esc_attr_e( 'Free Core Version', 'woo-product-table' ); ?>">
     113                        v<?php echo esc_html( $metrics['plugin_version'] ); ?>
     114                    </span>
     115                    <?php if ( ! empty( $metrics['is_pro'] ) ) : ?>
     116                        <span class="wpt-badge-pro" title="<?php esc_attr_e( 'Woo Product Table Pro Active', 'woo-product-table' ); ?>">
     117                            <i class="wpt-heart-filled"></i> PRO <?php echo ! empty( $metrics['pro_version'] ) ? 'v' . esc_html( $metrics['pro_version'] ) : ''; ?>
    55118                        </span>
    56119                    <?php endif; ?>
    57                    
    58120                </div>
    59                 <div class="wpt-main-title wpt-main-title-secondary">
    60                     <h2 class="wpt-ntitle"><?php echo esc_html( $topbar_sub_title );?></h2>
    61                 </div>
    62 
     121                <p class="wpt-brand-subtitle"><?php echo esc_html( $page_subtitle ); ?></p>
    63122            </div>
    64123        </div>
    65         <div class="col-lg-5">
    66             <div class="header-button-wrapper">
    67                 <?php if( ! $pro){ ?>
    68                     <a class="wpt-button reverse"
    69                         href="https://wpprincipal.xyz?demo=wpt"
    70                         title="View Pro Demo - Woo Product Table"
    71                         target="_blank">
    72                             Pro Demo
    73                     </a>
    74                     <a class="wpt-button reverse"
    75                         href="https://wooproducttable.com/pricing/"
    76                         title="Get Premium Woo Product Table - Pricing Page"
    77                         target="_blank">
    78                         <i class="wpt-heart-filled"></i>
    79                         Get Pro
    80                     </a>
    81                 <?php }else if( $license_direct && ! $lisence_page_bool ){ ?>
    82                     <a class="wpt-btn wpt-has-icon"
    83                         href="<?php echo esc_attr( admin_url( 'edit.php?post_type=wpt_product_table&page=' . $license_page_slug ) ) ?>">
    84                         <span><i class=" wpt-heart-1"></i></span>
    85                         License
    86                     </a>
    87                 <?php } ?>
    88                
    89                 <a class="wpt-button reset"
    90                     href="https://wooproducttable.com/documentation/"
    91                     target="_blank">
    92                     <i class="wpt-note"></i>Doc
     124        <div class="wpt-top-header-right">
     125            <a href="<?php echo esc_url( $new_table_url ); ?>" class="wpt-btn-main wpt-btn-primary">
     126                <span>+</span> <?php esc_html_e( 'Create New Table', 'woo-product-table' ); ?>
     127            </a>
     128            <a href="<?php echo esc_url( $doc_url ); ?>" target="_blank" class="wpt-btn-main wpt-btn-secondary">
     129                <i class="wpt-note"></i> <?php esc_html_e( 'Documentation', 'woo-product-table' ); ?>
     130            </a>
     131            <?php if ( empty( $metrics['is_pro'] ) ) : ?>
     132                <a href="<?php echo esc_url( $pricing_url ); ?>" target="_blank" class="wpt-btn-main wpt-btn-pro">
     133                    <i class="wpt-heart-filled"></i> <?php esc_html_e( 'Upgrade to Pro', 'woo-product-table' ); ?>
    93134                </a>
    94                
    95                 <!-- <button class="wpt-btn"><span><i class="wpt-cart"></i></span> Save Chabnge</button> -->
    96             </div>
     135            <?php endif; ?>
    97136        </div>
    98     </div>
     137    </header>
     138
     139    <!-- 2. Modern Sub-Navigation Bar (All Plugin Menus Hub) -->
     140    <nav class="wpt-subnav-bar">
     141        <div class="wpt-subnav-inner">
     142            <a href="<?php echo esc_url( $dashboard_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'dashboard' ? 'active' : ''; ?>" data-tab="dashboard">
     143                <i class="wpt-laptop"></i> <?php esc_html_e( 'Dashboard', 'woo-product-table' ); ?>
     144            </a>
     145            <a href="<?php echo esc_url( $all_tables_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'all-tables' ? 'active' : ''; ?>" data-tab="all-tables">
     146                <i class="wpt-table"></i> <?php esc_html_e( 'All Tables', 'woo-product-table' ); ?>
     147            </a>
     148            <a href="<?php echo esc_url( $templates_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'templates' ? 'active' : ''; ?>" data-tab="templates">
     149                <i class="wpt-table"></i> <?php esc_html_e( 'Templates', 'woo-product-table' ); ?>
     150            </a>
     151            <a href="<?php echo esc_url( $settings_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'settings' ? 'active' : ''; ?>">
     152                <i class="wpt-cog-alt"></i> <?php esc_html_e( 'Settings', 'woo-product-table' ); ?>
     153            </a>
     154            <a href="<?php echo esc_url( $ecosystem_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'ecosystem' ? 'active' : ''; ?>" data-tab="ecosystem">
     155                <i class="wpt-cart"></i> <?php esc_html_e( 'Addons & Tools', 'woo-product-table' ); ?>
     156            </a>
     157            <a href="<?php echo esc_url( $audit_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'audit' ? 'active' : ''; ?>">
     158                <i class="wpt-star-filled"></i> <?php esc_html_e( 'Store Audit', 'woo-product-table' ); ?>
     159            </a>
     160            <a href="<?php echo esc_url( $browse_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'plugins' ? 'active' : ''; ?>">
     161                <i class="wpt-arrows-cw"></i> <?php esc_html_e( 'Plugins', 'woo-product-table' ); ?>
     162            </a>
     163            <?php if ( ! empty( $metrics['is_pro'] ) ) : ?>
     164                <a href="<?php echo esc_url( $license_url ); ?>" class="wpt-subnav-link wpt-subnav-license <?php echo $active_tab === 'license' ? 'active' : ''; ?>">
     165                    <i class="wpt-heart-filled"></i> <?php esc_html_e( 'License', 'woo-product-table' ); ?>
     166                </a>
     167            <?php else : ?>
     168                <a href="<?php echo esc_url( $pricing_url ); ?>" target="_blank" class="wpt-subnav-link wpt-subnav-pro">
     169                    <i class="wpt-heart-filled"></i> <?php esc_html_e( 'Get Pro', 'woo-product-table' ); ?>
     170                </a>
     171            <?php endif; ?>
     172        </div>
     173    </nav>
    99174</div>
     175<?php if ( $current_page !== '' ) : // Core post-edit/list screens already output .wp-header-end. ?>
     176<hr class="wp-header-end">
     177<?php endif; ?>
  • woo-product-table/tags/6.1.6/admin/post_metabox.php

    r3607110 r3837744  
    1717    function wpt_shortcode_metabox(){
    1818
    19         add_meta_box( 'wpt_shortcode_metabox_id', 'Shortcode', 'wpt_shortcode_metabox_render', 'wpt_product_table', 'normal' );
    2019        add_meta_box( 'wpt_shortcode_configuration_metabox_id', 'Table Modification', 'wpt_shortcode_configuration_metabox_render', 'wpt_product_table', 'normal' ); //Added at 4.1.4
    2120        //add_meta_box( 'wpt_column_panel_metabox_id', __( 'Available Columns', 'woo-product-table' ), 'wpt_column_panel_metabox_render', 'wpt_product_table', 'side', 'low' ); //Added at 4.1.4
    … …  
    2322    }
    2423}
     24
     25if( ! function_exists( 'wpt_render_inline_shortcode_box' ) ){
     26    /**
     27     * Render Shortcode card directly beside Title field via edit_form_after_title
     28     * so Title and Shortcode sit cleanly side-by-side above Table Modification.
     29     */
     30    function wpt_render_inline_shortcode_box( $post ){
     31        if ( ! isset( $post->post_type ) || 'wpt_product_table' !== $post->post_type ) {
     32            return;
     33        }
     34        ?>
     35        <div id="wpt_shortcode_metabox_id" class="wpt-top-shortcode-card">
     36            <div class="inside">
     37                <?php wpt_shortcode_metabox_render(); ?>
     38            </div>
     39        </div>
     40        <?php
     41    }
     42}
     43add_action( 'edit_form_after_title', 'wpt_render_inline_shortcode_box' );
     44
     45if( ! function_exists( 'wpt_remove_publish_metabox' ) ){
     46    /**
     47     * Ensure default WordPress Publish metabox is always removed on product table edit screen.
     48     */
     49    function wpt_remove_publish_metabox(){
     50        remove_meta_box( 'submitdiv', 'wpt_product_table', 'side' );
     51    }
     52}
     53add_action( 'add_meta_boxes_wpt_product_table', 'wpt_remove_publish_metabox', 99 );
     54
     55if( ! function_exists( 'wpt_product_table_screen_layout_columns' ) ){
     56    /**
     57     * Restrict Product Table post edit screen to a clean single full-width column.
     58     */
     59    function wpt_product_table_screen_layout_columns( $columns ){
     60        $columns['wpt_product_table'] = 1;
     61        return $columns;
     62    }
     63}
     64add_filter( 'screen_layout_columns', 'wpt_product_table_screen_layout_columns' );
     65
     66if( ! function_exists( 'wpt_product_table_single_column_layout' ) ){
     67    /**
     68     * Force 1-column layout so no blank sidebar space remains after removing Publish box.
     69     */
     70    function wpt_product_table_single_column_layout(){
     71        return 1;
     72    }
     73}
     74add_filter( 'get_user_option_screen_layout_wpt_product_table', 'wpt_product_table_single_column_layout' );
     75
     76if( ! function_exists( 'wpt_force_publish_status_on_save' ) ){
     77    /**
     78     * Automatically publish product tables when saved via the Table Editor form
     79     * (preserving auto-draft on initial page load so default tab values still populate).
     80     */
     81    function wpt_force_publish_status_on_save( $data, $postarr ){
     82        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
     83            return $data;
     84        }
     85        if ( ! isset( $data['post_type'] ) || 'wpt_product_table' !== $data['post_type'] ) {
     86            return $data;
     87        }
     88        $nonce = sanitize_text_field( wp_unslash( $_POST['wpt_shortcode_nonce_value'] ?? '' ) );
     89        if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, plugin_basename( __FILE__ ) ) ) {
     90            return $data;
     91        }
     92
     93        $ptype = get_post_type_object( 'wpt_product_table' );
     94        if ( $ptype && isset( $ptype->cap->publish_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
     95            if ( isset( $data['post_status'] ) && in_array( $data['post_status'], array( 'auto-draft', 'draft', 'pending' ), true ) ) {
     96                $data['post_status'] = 'publish';
     97            }
     98        }
     99
     100        return $data;
     101    }
     102}
     103add_filter( 'wp_insert_post_data', 'wpt_force_publish_status_on_save', 10, 2 );
    25104
    26105if( ! function_exists( 'wpt_column_panel_metabox_render' ) ){
    … …  
    86165        global $post;
    87166        $curent_post_id = $post->ID;
    88         $post_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/',"$1", $post->post_title );
     167        $raw_title = html_entity_decode( wp_strip_all_tags( (string) $post->post_title ), ENT_QUOTES, 'UTF-8' );
     168        $post_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/', '', $raw_title );
     169        $post_title = trim( preg_replace( '/\s+/', ' ', $post_title ) );
     170        $is_published = isset( $post->post_status ) && 'publish' === $post->post_status;
    89171        ?>
     172        <div class="wpt-shortcode-card-head">
     173            <span class="wpt-shortcode-card-label">
     174                <?php esc_html_e( 'Shortcode', 'woo-product-table' ); ?>
     175                <span class="wpt-shortcode-id-pill">#<?php echo esc_html( absint( $curent_post_id ) ); ?></span>
     176            </span>
     177            <span class="wpt-shortcode-quick-links">
     178                <button type="button" id="wpt-top-preview-btn" class="wpt-shortcode-preview-btn" title="<?php esc_attr_e( 'Open Live Table Preview', 'woo-product-table' ); ?>">
     179                    <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
     180                    <span><?php esc_html_e( 'Preview', 'woo-product-table' ); ?></span>
     181                </button>
     182                <span aria-hidden="true">·</span>
     183                <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=page' ) ); ?>"><?php esc_html_e( 'Create new page', 'woo-product-table' ); ?></a>
     184                <span aria-hidden="true">·</span>
     185                <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=page' ) ); ?>"><?php esc_html_e( 'All Pages', 'woo-product-table' ); ?></a>
     186            </span>
     187        </div>
     188
    90189        <div class="wpt-shortcode-box-inside">
    91190            <input type="text" value="[Product_Table id='<?php echo esc_attr( absint( $curent_post_id ) ); ?>' name='<?php echo esc_attr( $post_title ); ?>']" class="wpt_auto_select_n_copy wpt_meta_box_shortcode mb-text-input mb-field" id="wpt_metabox_copy_content" readonly>
    92             <a  class="button button-primary wpt_copy_button_metabox" data-target_id="wpt_metabox_copy_content">Copy</a>
     191            <a class="button button-primary wpt_copy_button_metabox" data-target_id="wpt_metabox_copy_content"><?php esc_html_e( 'Copy', 'woo-product-table' ); ?></a>
    93192            <p class="wpt_metabox_copy_content"></p>
    94193        </div>
    95194
    96195        <p class="wpt-shorcode-render-box">
    97             <strong>First Publish Product Table</strong> and then
    98             copy this shortcode and paste to your desired page.
    99             You can
    100             <a href="<?php echo esc_attr( admin_url('post-new.php?post_type=page') ); ?>">
    101                 Create new page
    102             </a> or  Go to
    103             <a href="<?php echo esc_attr( admin_url('edit.php?post_type=page') ); ?>">
    104                 All Pages
    105             </a>
     196            <?php if ( ! $is_published ) : ?>
     197                <strong><?php esc_html_e( 'First Save Product Table', 'woo-product-table' ); ?></strong> <?php esc_html_e( 'and copy this shortcode to paste into any page.', 'woo-product-table' ); ?>
     198            <?php else : ?>
     199                <?php esc_html_e( 'Copy and paste this shortcode into any page or post to display the table.', 'woo-product-table' ); ?>
     200            <?php endif; ?>
    106201        </p>
    107202
    … …  
    215310
    216311
    217 if( ! function_exists( 'wpt_shortcode_configuration_metabox_save_meta' ) ){
    218 
    219     function wpt_shortcode_configuration_metabox_save_meta( $post_id, $post ) { // save the data
    220        
    221         $nonce = sanitize_text_field( wp_unslash( $_POST['wpt_shortcode_nonce_value'] ?? '' ) );
    222         if ( empty($nonce) || ! wp_verify_nonce( $nonce, plugin_basename(__FILE__) ) ) {
    223             return;
    224         }
    225        
    226 
     312if( ! function_exists( 'wpt_save_table_meta_from_request' ) ){
     313
     314    /**
     315     * Sanitize and persist Product Table metabox configuration fields from POST request.
     316     *
     317     * @param int          $post_id Product table post ID.
     318     * @param WP_Post|null $post    Post object.
     319     * @return void
     320     */
     321    function wpt_save_table_meta_from_request( $post_id, $post = null ) {
     322        $post = $post ?: get_post( $post_id );
    227323        $wpt_import_data = sanitize_text_field( wp_unslash( $_POST['wpt-import-data'] ?? '' ) );
    228324        if( ! empty( $wpt_import_data ) ){
    … …  
    237333             */
    238334            do_action( 'wpto_import_data', $wpt_import_data, $post_id );
    239             return;
    240         }
    241 
    242         /**
    243          * @Hook Filter: wpto_on_save_global_post
    244          * To change/Modify $_POST
    245          * Before Save Data on Database by update_post_meta() func
    246          * @since 6.1.0.5
    247          * @Hook_Version: 6.1.0.5
    248          */
    249 
    250         $save_tab_array = array(
    251             'column_array' => 'column_array',
    252             'column_array_tablet' => 'column_array_tablet',
    253             'column_array_mobile' => 'column_array_mobile',
    254            
    255             'enabled_column_array' => 'enabled_column_array',
    256             'enabled_column_array_tablet' => 'enabled_column_array_tablet',
    257             'enabled_column_array_mobile' => 'enabled_column_array_mobile',
    258            
    259             'column_settings' => 'column_settings',
    260             'column_settings_tablet' => 'column_settings_tablet',
    261             'column_settings_mobile' => 'column_settings_mobile',
    262            
    263             'basics' => 'basics',
    264             'table_style' => 'table_style',
    265             'conditions' => 'conditions',
    266             'mobile' => 'mobile',
    267             'search_n_filter' => 'search_n_filter',
    268             'pagination' => 'pagination',
    269             'config' => 'config',
    270         );
    271 
    272         $save_tab_array = apply_filters( 'wpto_save_tab_array', $save_tab_array, $post_id, $post );
    273 
    274         if( ! is_array( $save_tab_array ) || ( is_array( $save_tab_array ) && count( $save_tab_array ) < 1 )){
     335            if ( function_exists( 'wpt_get_live_preview_transient_key' ) ) {
     336                delete_transient( wpt_get_live_preview_transient_key( $post_id ) );
     337            }
    275338            return;
    276339        }
    … …  
    283346         */
    284347        do_action( 'wpto_on_save_post_before_update_meta', $post_id );
    285        
    286         /**
    287          * In Filter, Availabe Tabs:
    288          * tabs: column_array,column_array_tablet,column_array_mobile,enabled_column_array,
    289          * enabled_column_array_tablet,enabled_column_array_mobile,
    290          * column_settings,column_settings_tablet,column_settings_mobile,
    291          * basics,table_style,conditions,mobile,search_n_filter,pagination,config
    292          *
    293          * @since 2.9.1
    294          */
    295         $filtar_args = array(
    296             'column_array' => array(
    297                 'filter' => FILTER_CALLBACK,
    298                 'flags' => FILTER_REQUIRE_ARRAY,
    299                 'options' => 'sanitize_text_field'
    300             ),
    301             'column_array_tablet' => array(
    302                 'filter' => FILTER_CALLBACK,
    303                 'flags' => FILTER_REQUIRE_ARRAY,
    304                 'options' => 'sanitize_text_field'
    305             ),
    306             'column_array_mobile' => array(
    307                 'filter' => FILTER_CALLBACK,
    308                 'flags' => FILTER_REQUIRE_ARRAY,
    309                 'options' => 'sanitize_text_field'
    310             ),
    311             'enabled_column_array' => array(
    312                 'filter' => FILTER_CALLBACK,
    313                 'flags' => FILTER_REQUIRE_ARRAY,
    314                 'options' => 'sanitize_text_field'
    315             ),
    316             'enabled_column_array_tablet' => array(
    317                 'filter' => FILTER_CALLBACK,
    318                 'flags' => FILTER_REQUIRE_ARRAY,
    319                 'options' => 'sanitize_text_field'
    320             ),
    321             'enabled_column_array_mobile' => array(
    322                 'filter' => FILTER_CALLBACK,
    323                 'flags' => FILTER_REQUIRE_ARRAY,
    324                 'options' => 'sanitize_text_field'
    325             ),
    326             'column_settings' => array(
    327                 'filter' => FILTER_CALLBACK,
    328                 'flags' => FILTER_REQUIRE_ARRAY,
    329                 'options' => 'wp_kses_post'
    330             ),
    331             'column_settings_tablet' => array(
    332                 'filter' => FILTER_CALLBACK,
    333                 'flags' => FILTER_REQUIRE_ARRAY,
    334                 'options' => 'wp_kses_post'
    335             ),
    336             'column_settings_mobile' => array(
    337                 'filter' => FILTER_CALLBACK,
    338                 'flags' => FILTER_REQUIRE_ARRAY,
    339                 'options' => 'wp_kses_post'
    340             ),
    341             'basics' => array(
    342                 'filter' => FILTER_CALLBACK,
    343                 'flags' => FILTER_REQUIRE_ARRAY,
    344                 'options' => 'wp_kses_post'
    345             ),
    346             'table_style' => array(
    347                 'filter' => FILTER_CALLBACK,
    348                 'flags' => FILTER_REQUIRE_ARRAY,
    349                 'options' => 'wp_kses_post'
    350             ),
    351             'conditions' => array(
    352                 'filter' => FILTER_CALLBACK,
    353                 'flags' => FILTER_REQUIRE_ARRAY,
    354                 'options' => 'sanitize_text_field'
    355             ),
    356             'mobile' => array(
    357                 'filter' => FILTER_CALLBACK,
    358                 'flags' => FILTER_REQUIRE_ARRAY,
    359                 'options' => 'sanitize_text_field'
    360             ),
    361             'search_n_filter' => array(
    362                 'filter' => FILTER_CALLBACK,
    363                 'flags' => FILTER_REQUIRE_ARRAY,
    364                 'options' => 'wp_kses_post'
    365             ),
    366             'pagination' => array(
    367                 'filter' => FILTER_CALLBACK,
    368                 'flags' => FILTER_REQUIRE_ARRAY,
    369                 'options' => 'wp_kses_post'
    370             ),
    371             'config' => array(
    372                 'filter' => FILTER_CALLBACK,
    373                 'flags' => FILTER_REQUIRE_ARRAY,
    374                 'options' => 'wp_kses_post'
    375             ),
    376         );
    377         $filtar_args = apply_filters('wpt_data_save_filter_arr', $filtar_args);
    378         $submitte_data = filter_input_array( INPUT_POST, $filtar_args );
    379 
    380         $submitte_data = wpt_remove_empty_value_from_array($submitte_data);
    381 
    382         //Some special Sanitizzze
    383         $table_class = $submitte_data['basics']['table_class'] ?? '';
    384         $submitte_data['basics']['table_class'] = sanitize_html_class( $table_class );
    385         /********* Column Setting Optimizing Start here ***********/
    386 
    387         //Fixing for tablet setting
    388         if( isset( $submitte_data['column_settings_tablet'] ) && ! isset( $submitte_data['enabled_column_array_tablet'] ) ){
    389             unset( $submitte_data['column_settings_tablet'] );
    390         }
    391 
    392        
    393         //Fixing for mobile setting
    394         if( isset( $submitte_data['column_settings_mobile'] ) && ! isset( $submitte_data['enabled_column_array_mobile'] ) ){
    395             unset( $submitte_data['column_settings_mobile'] );
    396         }
    397 
    398         //Optimize for Desktop
    399         if( isset( $submitte_data['column_settings'] ) && is_array( $submitte_data['column_settings'] ) ){
    400             $total_enable_coll_arr = $submitte_data['enabled_column_array'];
    401            
    402             foreach( $submitte_data['column_settings'] as $each_settings ){
    403                 $each_settings = isset( $each_settings['items'] ) && is_array( $each_settings['items'] ) ? array_flip( $each_settings['items'] ) : array();
    404                 $total_enable_coll_arr += $each_settings;
    405             }
    406             $total_enable_coll_arr = array_keys($total_enable_coll_arr);
    407             $total_enable_coll_arr['thumb_variation'] = 'thumb_variation';
    408             $total_enable_coll_arr['title_variation'] = 'title_variation';
    409             $total_enable_coll_arr['description_off'] = 'description_off';
    410 
    411             foreach( $submitte_data['column_settings'] as $u_key => $Ueach_settings ){
    412                 if( isset( $submitte_data['column_settings'][$u_key] ) && ! in_array($u_key,$total_enable_coll_arr)){
    413                     unset( $submitte_data['column_settings'][$u_key] );
    414                 }
    415             }
    416         }
    417 
    418        
    419         //Optimize setting for Tablet
    420         if( isset( $submitte_data['enabled_column_array_tablet'] ) && isset( $submitte_data['column_settings_tablet'] ) && is_array( $submitte_data['column_settings'] ) ){
    421             $total_enable_coll_arr = $submitte_data['enabled_column_array_tablet'];
    422             foreach( $submitte_data['column_settings_tablet'] as $each_settings ){
    423                 $each_settings = isset( $each_settings['items'] ) && is_array( $each_settings['items'] ) ? array_flip( $each_settings['items'] ) : array();
    424                 $total_enable_coll_arr += $each_settings;
    425             }
    426             $total_enable_coll_arr = array_keys($total_enable_coll_arr);
    427             $total_enable_coll_arr['thumb_variation'] = 'thumb_variation';
    428             $total_enable_coll_arr['title_variation'] = 'title_variation';
    429             $total_enable_coll_arr['description_off'] = 'description_off';
    430 
    431             foreach( $submitte_data['column_settings_tablet'] as $u_key => $Ueach_settings ){
    432                 if( isset( $submitte_data['column_settings_tablet'][$u_key] ) && ! in_array($u_key,$total_enable_coll_arr)){
    433                     unset( $submitte_data['column_settings_tablet'][$u_key] );
    434                 }
    435             }
    436         }
    437         //Optimize setting for Mobile
    438         if( isset( $submitte_data['enabled_column_array_mobile'] ) && isset( $submitte_data['column_settings_mobile'] ) && is_array( $submitte_data['column_settings'] ) ){
    439             $total_enable_coll_arr = $submitte_data['enabled_column_array_mobile'];
    440             foreach( $submitte_data['column_settings_mobile'] as $each_settings ){
    441                 $each_settings = isset( $each_settings['items'] ) && is_array( $each_settings['items'] ) ? array_flip( $each_settings['items'] ) : array();
    442                 $total_enable_coll_arr += $each_settings;
    443             }
    444             $total_enable_coll_arr = array_keys($total_enable_coll_arr);
    445             $total_enable_coll_arr['thumb_variation'] = 'thumb_variation';
    446             $total_enable_coll_arr['title_variation'] = 'title_variation';
    447             $total_enable_coll_arr['description_off'] = 'description_off';
    448 
    449             foreach( $submitte_data['column_settings_mobile'] as $u_key => $Ueach_settings ){
    450                 if( isset( $submitte_data['column_settings_mobile'][$u_key] ) && ! in_array($u_key,$total_enable_coll_arr)){
    451                     unset( $submitte_data['column_settings_mobile'][$u_key] );
    452                 }
    453             }
    454         }
    455         /********* Column Setting Optimizing End here ***********/
    456 
    457 
    458 
    459 
    460 
    461         /**
    462          * @Hook wpto_table_data_on_submit
    463          * Save or change data before updated to database.
    464          *
    465          *
    466          * Submitted Tata is optimized for column setting actually
    467          * We only saving data for column setting for desktop,tablet,mobile
    468          *
    469          * @author Saiful Islam <codersaiful@gmail.com>
    470          * @since 3.1.0.1
    471          */
    472         $submitte_data = apply_filters( 'wpto_table_data_on_submit', $submitte_data, $post_id, $save_tab_array );
    473 
    474         /**
    475          * To removed empty/false value from full array
    476          * currently it's inactivated
    477          *
    478          * @since 1.0.4.1
    479          */
    480         foreach( $save_tab_array as $tab ){
    481            
    482             /**
    483              * Already Filtered using filter_input_arry/filter_var_array
    484              *
    485              * @since 2.9.1
    486              */
    487             $tab_data = isset( $submitte_data[$tab] ) ? $submitte_data[$tab] : false;
    488            
    489             /**
    490              * Hook before save tab data
    491              * @Hooked: wpt_data_manipulation_on_save at admin/functions.php
    492              */
    493             $tab_data = apply_filters( 'wpto_tab_data_on_save', $tab_data, $tab, $post_id, $save_tab_array );
    494            
    495             /**
    496              * Hook for Individual Tab data save.
    497              *
    498              * Only for customer use at this moment.
    499              */
    500             $tab_data = apply_filters( 'wpto_tab_data_on_save_' . $tab, $tab_data, $post_id, $save_tab_array );
    501             $tab_data = wpt_remove_empty_value_from_array( $tab_data );
     348
     349        if ( ! function_exists( 'wpt_parse_table_meta_from_request' ) ) {
     350            return;
     351        }
     352
     353        $parsed_meta = wpt_parse_table_meta_from_request( $post_id, $post );
     354        if ( ! is_array( $parsed_meta ) || count( $parsed_meta ) < 1 ) {
     355            return;
     356        }
     357
     358        foreach ( $parsed_meta as $tab => $tab_data ) {
    502359            update_post_meta( $post_id, $tab, $tab_data );
    503360        }
    504        
     361
    505362        /**
    506363         * @Hook Action: wpto_on_save_post
    … …  
    510367         */
    511368        do_action( 'wpto_on_save_post', $post_id );
     369
     370        if ( function_exists( 'wpt_get_live_preview_transient_key' ) ) {
     371            delete_transient( wpt_get_live_preview_transient_key( $post_id ) );
     372        }
     373    }
     374}
     375
     376if( ! function_exists( 'wpt_shortcode_configuration_metabox_save_meta' ) ){
     377
     378    function wpt_shortcode_configuration_metabox_save_meta( $post_id, $post ) { // save the data
     379        $nonce = sanitize_text_field( wp_unslash( $_POST['wpt_shortcode_nonce_value'] ?? '' ) );
     380        if ( empty($nonce) || ! wp_verify_nonce( $nonce, plugin_basename(__FILE__) ) ) {
     381            return;
     382        }
     383
     384        wpt_save_table_meta_from_request( $post_id, $post );
     385
    512386        //flash rewrite rules
    513387        flush_rewrite_rules();
    514388    }
    515389}
    516 add_action( 'save_post', 'wpt_shortcode_configuration_metabox_save_meta', 10, 2 ); //
     390add_action( 'save_post', 'wpt_shortcode_configuration_metabox_save_meta', 10, 2 ); //
     391
     392if( ! function_exists( 'wpt_render_live_preview_modal' ) ){
     393    /**
     394     * Render the Demo 1 Live Table Preview modal at root admin_footer level
     395     * on the Product Table editor screen to avoid metabox stacking issues.
     396     *
     397     * @return void
     398     */
     399    function wpt_render_live_preview_modal(){
     400        if ( ! function_exists( 'get_current_screen' ) ) {
     401            return;
     402        }
     403        $screen = get_current_screen();
     404        if ( ! $screen ) {
     405            return;
     406        }
     407        $is_table_screen = ( 'wpt_product_table' === $screen->post_type ) ||
     408                           ( strpos( $screen->id, 'wpt' ) !== false ) ||
     409                           ( strpos( $screen->id, 'woo-product-table' ) !== false );
     410        if ( ! $is_table_screen ) {
     411            return;
     412        }
     413        global $post;
     414        $table_id     = isset( $post->ID ) ? absint( $post->ID ) : absint( $_GET['post'] ?? 0 );
     415        $embed_url    = $table_id && function_exists( 'wpt_get_live_preview_url' ) ? wpt_get_live_preview_url( $table_id, true ) : '';
     416        $external_url = $table_id && function_exists( 'wpt_get_live_preview_url' ) ? wpt_get_live_preview_url( $table_id, false ) : '';
     417        $table_title  = $table_id ? get_the_title( $table_id ) : '';
     418        $clean_title  = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/', '', $table_title );
     419        $shortcode    = $table_id ? sprintf( '[Product_Table id="%d" name="%s"]', $table_id, esc_attr( $clean_title ) ) : '';
     420        ?>
     421        <div id="wpt-live-preview-backdrop" class="wpt-lp-backdrop" data-embed-url="<?php echo esc_url( $embed_url ); ?>" data-external-url="<?php echo esc_url( $external_url ); ?>" role="dialog" aria-modal="true" aria-labelledby="wpt-lp-modal-heading" hidden>
     422            <div class="wpt-lp-modal">
     423                <div class="wpt-lp-head">
     424                    <div class="wpt-lp-head-left">
     425                        <span class="wpt-lp-head-icon" aria-hidden="true">
     426                            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
     427                        </span>
     428                        <h3 id="wpt-lp-modal-heading" class="wpt-lp-title">
     429                            <?php esc_html_e( 'Live Table Preview', 'woo-product-table' ); ?>
     430                            <span id="wpt-lp-table-title" class="wpt-lp-table-name"><?php echo $table_title ? '— ' . esc_html( $table_title ) : ''; ?></span>
     431                        </h3>
     432                    </div>
     433                    <button type="button" id="wpt-lp-close-btn" class="wpt-lp-close-btn" aria-label="<?php esc_attr_e( 'Close preview', 'woo-product-table' ); ?>">
     434                        &times;
     435                    </button>
     436                </div>
     437
     438                <div class="wpt-lp-toolbar">
     439                    <div class="wpt-lp-toolbar-left">
     440                        <span id="wpt-lp-status" class="wpt-lp-status is-syncing">
     441                            <span class="wpt-lp-dot" aria-hidden="true"></span>
     442                            <span class="wpt-lp-status-text"><?php esc_html_e( 'Loading preview...', 'woo-product-table' ); ?></span>
     443                        </span>
     444                        <button type="button" id="wpt-lp-refresh-btn" class="wpt-lp-tool-btn">
     445                            <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/></svg>
     446                            <span><?php esc_html_e( 'Refresh Preview', 'woo-product-table' ); ?></span>
     447                        </button>
     448                    </div>
     449
     450                    <div class="wpt-lp-toolbar-center">
     451                        <div class="wpt-lp-shortcode-pill" id="wpt-lp-shortcode-wrap" style="<?php echo empty( $shortcode ) ? 'display:none;' : ''; ?>">
     452                            <span class="wpt-lp-shortcode-tag"><?php esc_html_e( 'Shortcode', 'woo-product-table' ); ?></span>
     453                            <code id="wpt-lp-shortcode-val" class="wpt-lp-shortcode-code" title="<?php esc_attr_e( 'Click to copy shortcode', 'woo-product-table' ); ?>"><?php echo esc_html( $shortcode ); ?></code>
     454                            <button type="button" id="wpt-lp-copy-shortcode" class="wpt-lp-copy-btn" data-shortcode="<?php echo esc_attr( $shortcode ); ?>" title="<?php esc_attr_e( 'Copy shortcode to clipboard', 'woo-product-table' ); ?>">
     455                                <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
     456                                <span class="wpt-copy-text"><?php esc_html_e( 'Copy', 'woo-product-table' ); ?></span>
     457                            </button>
     458                        </div>
     459                    </div>
     460
     461                    <div class="wpt-lp-toolbar-right">
     462                        <div class="wpt-lp-device-group" role="group" aria-label="<?php esc_attr_e( 'Preview device width', 'woo-product-table' ); ?>">
     463                            <button type="button" class="wpt-lp-device-btn active" data-device="desktop"><?php esc_html_e( 'Desktop', 'woo-product-table' ); ?></button>
     464                            <button type="button" class="wpt-lp-device-btn" data-device="tablet"><?php esc_html_e( 'Tablet', 'woo-product-table' ); ?></button>
     465                            <button type="button" class="wpt-lp-device-btn" data-device="mobile"><?php esc_html_e( 'Mobile', 'woo-product-table' ); ?></button>
     466                        </div>
     467                        <a href="<?php echo esc_url( $external_url ?: '#' ); ?>" id="wpt-lp-external-link" class="wpt-lp-tool-btn" target="_blank" rel="noopener noreferrer">
     468                            <span><?php esc_html_e( 'Open in New Tab', 'woo-product-table' ); ?> &nearr;</span>
     469                        </a>
     470                    </div>
     471                </div>
     472
     473                <div class="wpt-lp-stage">
     474                    <div id="wpt-lp-viewport" class="wpt-lp-viewport is-desktop">
     475                        <div id="wpt-lp-loading" class="wpt-lp-loading">
     476                            <span class="wpt-lp-spinner" aria-hidden="true"></span>
     477                            <span id="wpt-lp-loading-text"><?php esc_html_e( 'Rendering live table preview...', 'woo-product-table' ); ?></span>
     478                        </div>
     479                        <iframe id="wpt-lp-iframe" name="wpt_lp_iframe" class="wpt-lp-iframe" title="<?php esc_attr_e( 'Woo Product Table Live Preview', 'woo-product-table' ); ?>"></iframe>
     480                    </div>
     481                </div>
     482            </div>
     483        </div>
     484        <?php
     485    }
     486}
     487add_action( 'admin_footer', 'wpt_render_live_preview_modal' );
  • woo-product-table/tags/6.1.6/admin/post_metabox_form.php

    r3522314 r3837744  
    162162   
    163163    <div class="form_bottom form_bottom_submit_button wrapper_<?php echo esc_attr( $ajax_submit_btn ); ?> ultraaddons-button-wrapper ultraaddons-panel no-background">
    164         <button type="submit" style="display: none;"
    165                 name="wpt_post_submit"
    166                 data-title="<?php echo esc_attr( $post_title ); ?>"
    167                 class="button-primary button-primary primary button <?php echo esc_attr( $ajax_submit_btn ); ?>"
    168                 ><?php esc_html_e( 'Save Change', 'woo-product-table' );?></button>
     164        <input type="hidden" name="post_status" value="publish" />
     165        <button type="button"
     166                id="wpt-open-preview-btn"
     167                class="button wpt-preview-submit-btn">
     168            <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
     169            <span><?php esc_html_e( 'Live Preview', 'woo-product-table' ); ?></span>
     170        </button>
     171        <button type="submit"
     172                name="wpt_post_submit"
     173                id="wpt-save-table-btn"
     174                data-title="<?php echo esc_attr( $post_title ); ?>"
     175                class="button-primary button-primary primary button wpt-save-submit-btn <?php echo esc_attr( $ajax_submit_btn ); ?>">
     176            <i class="wpt-floppy" aria-hidden="true"></i>
     177            <span><?php esc_html_e( 'Save Change', 'woo-product-table' ); ?></span>
     178        </button>
    169179    </div>
    170180</div>
  • woo-product-table/tags/6.1.6/admin/tabs/config.php

    r3522314 r3837744  
    449449                            </div>
    450450                            <div class="form-field col-lg-6">
    451                                 <select saiful="config[query_by_url]" id="wpt_table_instant_search_filter" class="wpt_fullwidth ua_input">
     451                                <select saiful="config[query_by_url]" id="wpt_table_query_by_url" class="wpt_fullwidth ua_input">
    452452                                    <option value="">Default</option>
    453453                                    <option value="0">Off</option>
  • woo-product-table/tags/6.1.6/admin/tabs/inc-column/add-new-column.php

    r3522314 r3837744  
    11
    2 <!-- Add new Custom Collumn -->
    3 <div class="add_new_col_wrapper" data-device="">
    4     <div class="section ultraaddons-panel add_new_column">
    5         <h3 class="with-background dark-background slim-title"><?php echo esc_html__( 'Add New Column','woo-product-table' ); ?> <small style="color: orange; font-size: 12px;"></small></h3>
    6 
    7         <table class="ultraaddons-table">
    8             <tbody>
    9                 <tr>
    10                     <th><label class=""><?php echo esc_html__( 'Column Keyword','woo-product-table' ); ?></label></th>
    11                         <td>
    12                            <input class="and_new_column_key wpt_data_filed_atts column-keyword ua_input" type="text" placeholder="Column Keyword">
    13                         </td>
    14                 </tr>
    15                 <tr>
    16                     <th><label><?php echo esc_html__( 'Column Label','woo-product-table' ); ?></label></th>
    17                         <td>
    18                             <input class="and_new_column_label wpt_data_filed_atts column-label ua_input" type="text" placeholder="Column Label">
    19                         </td>
    20                 </tr>
    21                 <tr>
    22                     <th><label><?php echo esc_html__( 'Column Type','woo-product-table' ); ?></label></th>
    23                         <td>
    24 
     2<!-- Add new Custom Column (Demo 1: Twin Left-Rail Picker - Table-less) -->
     3<div class="add_new_col_wrapper wpt-twin-modal" data-device="">
     4    <div class="section ultraaddons-panel add_new_column wpt-twin-panel">
     5
     6        <?php
     7        $is_pro_active       = wpt_is_pro();
     8        $default_column_type = $is_pro_active ? 'custom_field' : 'taxonomy';
     9
     10        $add_new_col_type = array(
     11            'taxonomy' => __( 'Taxonomy', 'woo-product-table' ),
     12            'default'  => __( 'Type None', 'woo-product-table' ),
     13        );
     14
     15        if ( $is_pro_active ) {
     16            $add_new_col_type = array(
     17                'custom_field' => __( 'Custom Field', 'woo-product-table' ),
     18                'taxonomy'     => __( 'Taxonomy', 'woo-product-table' ),
     19                'default'      => __( 'Type None', 'woo-product-table' ),
     20            );
     21        } else {
     22            $add_new_col_type[] = __( 'Custom Field', 'woo-product-table' );
     23            $add_new_col_type[] = __( 'Blank', 'woo-product-table' );
     24            $add_new_col_type[] = __( 'Advance Custom Field', 'woo-product-table' );
     25            $add_new_col_type[] = __( 'Action Hooks', 'woo-product-table' );
     26            $add_new_col_type[] = __( 'Array type Custom Field', 'woo-product-table' );
     27            $add_new_col_type[] = __( 'Audio File Type', 'woo-product-table' );
     28            $add_new_col_type[] = __( 'All Type Content', 'woo-product-table' );
     29        }
     30
     31        $add_new_col_type = apply_filters( 'wpto_addnew_col_arr', $add_new_col_type, $columns_array, $column_settings, $post );
     32
     33        $fallback_doc_url = 'https://wooproducttable.com/docs/doc/table-options/add-new-custom-column-in-woo-product-table/';
     34
     35        $type_meta_map = array(
     36            'taxonomy'         => array(
     37                'desc'      => __( 'Display categories, tags, brands, or WooCommerce product attributes.', 'woo-product-table' ),
     38                'ph'        => 'product_brand',
     39                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/add-custom-taxonomy-as-table-column/',
     40                'doc_title' => __( 'Taxonomy', 'woo-product-table' ),
     41            ),
     42            'custom_field'     => array(
     43                'desc'      => __( 'Display any post meta or WooCommerce custom field key directly.', 'woo-product-table' ),
     44                'ph'        => '_custom_meta',
     45                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/add-new-column-using-custom-field/',
     46                'doc_title' => __( 'Custom Field', 'woo-product-table' ),
     47            ),
     48            'default'          => array(
     49                'desc'      => __( 'Empty container column where you can group multiple sub-items together.', 'woo-product-table' ),
     50                'ph'        => 'custom_group',
     51                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/select-multiple-inner-items/',
     52                'doc_title' => __( 'Type None (Inner Items)', 'woo-product-table' ),
     53            ),
     54            'acf'              => array(
     55                'desc'      => __( 'Display Advanced Custom Fields (ACF) values, download files, images, or URLs.', 'woo-product-table' ),
     56                'ph'        => 'acf_field_name',
     57                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/how-to-download-file-in-column-using-acf/',
     58                'doc_title' => __( 'ACF', 'woo-product-table' ),
     59            ),
     60            'audio'            => array(
     61                'desc'      => __( 'Play product audio tracks stored in an ACF audio field or file URL.', 'woo-product-table' ),
     62                'ph'        => 'audio_file',
     63                'doc'       => 'https://wooproducttable.com/docs/doc/tutorials/how-to-create-a-audio-table-using-woo-product-table/',
     64                'doc_title' => __( 'Audio Type', 'woo-product-table' ),
     65            ),
     66            'all_content'      => array(
     67                'desc'      => __( 'Universal rich-content column supporting shortcodes, HTML, and dynamic product tags.', 'woo-product-table' ),
     68                'ph'        => 'custom_content',
     69                'doc'       => 'https://wooproducttable.com/docs/doc/advance-uses/add-multiple-content-column/',
     70                'doc_title' => __( 'All Type Content', 'woo-product-table' ),
     71            ),
     72            'single_variation' => array(
     73                'desc'      => __( 'Display a specific WooCommerce variation attribute inside a dedicated column.', 'woo-product-table' ),
     74                'ph'        => 'attribute_pa_color',
     75                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/show-variation-name-in-a-single-column/',
     76                'doc_title' => __( 'Single Variation', 'woo-product-table' ),
     77            ),
     78            'blank'            => array(
     79                'desc'      => __( 'Empty developer column wired to WordPress action hooks for custom PHP output.', 'woo-product-table' ),
     80                'ph'        => 'custom_blank_col',
     81                'doc'       => 'https://wooproducttable.com/docs/doc/advance-uses/how-to-add-custom-column-using-action-and-filter-hooks/',
     82                'doc_title' => __( 'Blank / Hook Column', 'woo-product-table' ),
     83            ),
     84            'hook_action'      => array(
     85                'desc'      => __( 'Execute a WooCommerce or WordPress do_action hook inside every table row.', 'woo-product-table' ),
     86                'ph'        => 'custom_hook_col',
     87                'doc'       => 'https://wooproducttable.com/docs/doc/advance-uses/action-hook-column/',
     88                'doc_title' => __( 'Action Hooks', 'woo-product-table' ),
     89            ),
     90            'array'            => array(
     91                'desc'      => __( 'Extract nested values from serialized array custom fields via comma-separated keys.', 'woo-product-table' ),
     92                'ph'        => 'array_meta_col',
     93                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/add-new-column-using-custom-field/',
     94                'doc_title' => __( 'Array Custom Field', 'woo-product-table' ),
     95            ),
     96            'player-multi'     => array(
     97                'desc'      => __( 'Render a clean HTML5 audio player bar from an ACF audio file or audio URL field.', 'woo-product-table' ),
     98                'ph'        => 'audio_file',
     99                'doc'       => 'https://wooproducttable.com/docs/doc/tutorials/create-an-audio-player-table/',
     100                'doc_title' => __( 'Player 2', 'woo-product-table' ),
     101            ),
     102        );
     103
     104        $default_meta       = $type_meta_map[ $default_column_type ] ?? $type_meta_map['taxonomy'];
     105        $default_type_label = isset( $add_new_col_type[ $default_column_type ] ) ? $add_new_col_type[ $default_column_type ] : __( 'Taxonomy', 'woo-product-table' );
     106        ?>
     107
     108        <!-- Modal Header -->
     109        <div class="wpt-twin-head">
     110            <div class="wpt-twin-head-left">
     111                <span class="wpt-twin-head-icon" aria-hidden="true">
     112                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
     113                </span>
     114                <div>
     115                    <h3 class="wpt-twin-title"><?php echo esc_html__( 'Add Custom Column', 'woo-product-table' ); ?></h3>
     116                    <p class="wpt-twin-subtitle"><?php echo esc_html__( 'Pick a column type on the left, then name your column on the right', 'woo-product-table' ); ?></p>
     117                </div>
     118            </div>
     119            <button type="button" class="wpt-modal-close-btn" aria-label="<?php esc_attr_e( 'Close', 'woo-product-table' ); ?>">&times;</button>
     120        </div>
     121
     122        <!-- Twin Split Body: Left Type Rail + Right Form Workspace -->
     123        <div class="wpt-twin-split">
     124            <aside class="wpt-twin-rail" aria-label="<?php esc_attr_e( 'Column Types', 'woo-product-table' ); ?>">
     125                <div class="wpt-twin-rail-title"><?php esc_html_e( 'Column Type', 'woo-product-table' ); ?></div>
     126                <div class="custom-select-box-wrapper">
     127                    <input type="hidden" class="custom-select-box-input" id="selected_column_type" value="<?php echo esc_attr( $default_column_type ); ?>">
     128                    <?php
     129                    if ( is_array( $add_new_col_type ) && count( $add_new_col_type ) > 1 ) {
     130                        echo '<div class="wpt-custom-select-boxes">';
     131                        foreach ( $add_new_col_type as $an_key => $an_val ) {
     132                            $disable      = is_numeric( $an_key ) ? 'disabled' : '';
     133                            $active_class = ( $an_key == $default_column_type ) ? 'active' : '';
     134                            $meta         = $type_meta_map[ $an_key ] ?? array(
     135                                'desc' => __( 'Custom column data source.', 'woo-product-table' ),
     136                                'ph'   => 'custom_column',
     137                                'doc'  => $fallback_doc_url,
     138                            );
     139                            ?>
     140                            <div class="wpt-custom-select-box <?php echo esc_attr( $disable ); ?> <?php echo esc_attr( $active_class ); ?>"
     141                                 data-value="<?php echo esc_attr( $an_key ); ?>"
     142                                 data-desc="<?php echo esc_attr( $meta['desc'] ); ?>"
     143                                 data-ph="<?php echo esc_attr( $meta['ph'] ); ?>"
     144                                 data-doc="<?php echo esc_attr( $meta['doc'] ); ?>"><?php echo esc_html( $an_val ); ?></div>
     145                            <?php
     146                        }
     147                        echo '</div>';
     148                    }
     149                    ?>
     150                </div>
     151            </aside>
     152
     153            <div class="wpt-twin-workspace">
     154                <div class="wpt-twin-type-banner">
     155                    <div class="wpt-twin-banner-copy">
     156                        <strong id="wpt-twin-type-title"><?php echo esc_html( $default_type_label ); ?></strong>
     157                        <span id="wpt-twin-type-desc"><?php echo esc_html( $default_meta['desc'] ); ?></span>
     158                    </div>
     159                    <a href="<?php echo esc_url( $default_meta['doc'] ); ?>" target="_blank" rel="noopener noreferrer" id="wpt-twin-type-doc" class="wpt-twin-guide-link">
     160                        <?php esc_html_e( 'Guide', 'woo-product-table' ); ?> &rarr;
     161                    </a>
     162                </div>
     163
     164                <div class="wpt-twin-fields">
     165                    <div class="wpt-custom-field">
     166                        <label for="wpt-new-col-label"><?php echo esc_html__( 'Column Label', 'woo-product-table' ); ?></label>
     167                        <input id="wpt-new-col-label" class="and_new_column_label wpt_data_filed_atts column-label ua_input" type="text" placeholder="<?php esc_attr_e( 'e.g. Brand', 'woo-product-table' ); ?>" />
     168                        <span class="wpt-field-helper"><?php esc_html_e( 'Heading shown in the frontend table header', 'woo-product-table' ); ?></span>
     169                    </div>
     170                    <div class="wpt-custom-field">
     171                        <label for="wpt-new-col-key"><?php echo esc_html__( 'Column Keyword', 'woo-product-table' ); ?> <span class="wpt-req-mark">*</span></label>
     172                        <input id="wpt-new-col-key" class="and_new_column_key wpt_data_filed_atts column-keyword ua_input" type="text" placeholder="e.g. <?php echo esc_attr( $default_meta['ph'] ); ?>" />
     173                        <span class="wpt-field-helper"><?php esc_html_e( 'Exact taxonomy slug, meta key, or unique column identifier', 'woo-product-table' ); ?></span>
     174                    </div>
     175                </div>
     176
     177                <details class="wpt-twin-docs-accordion">
     178                    <summary><?php esc_html_e( 'All Tutorial Links', 'woo-product-table' ); ?> &#9662;</summary>
     179                    <div class="add-new-column-doc">
    25180                        <?php
    26                         $default_column_type = 'taxonomy';
    27                         if( wpt_is_pro() ){
    28                             $default_column_type = 'custom_field';
     181                        wpt_doc_link( $fallback_doc_url, __( 'Custom Column Overview', 'woo-product-table' ) );
     182                        $seen_docs = array( $fallback_doc_url => true );
     183                        foreach ( $type_meta_map as $type_meta ) {
     184                            if ( empty( $type_meta['doc'] ) || isset( $seen_docs[ $type_meta['doc'] ] ) ) {
     185                                continue;
     186                            }
     187                            $seen_docs[ $type_meta['doc'] ] = true;
     188                            wpt_doc_link( $type_meta['doc'], $type_meta['doc_title'] );
    29189                        }
    30190                        ?>
    31 
    32                             <div class="custom-select-box-wrapper">
    33                                 <input type="hidden" class="custom-select-box-input" id="selected_column_type" value="<?php echo esc_attr( $default_column_type ); ?>">
    34 
    35                             <?php
    36                                 $add_new_col_type = array(
    37                                     'taxonomy' => __( 'Taxonomy', 'woo-product-table' ),
    38                                     'default' => __( 'Type None', 'woo-product-table' ),
    39                                 );
    40                                
    41                                 if( wpt_is_pro() ){
    42                                     $add_new_col_type = array(
    43                                         'custom_field' => __( 'Custom Field', 'woo-product-table' ),
    44                                         'taxonomy' => __( 'Taxonomy', 'woo-product-table' ),
    45                                         'default' => __( 'Type None', 'woo-product-table' ),
    46                                     );
    47                                 }
    48                                 if( ! wpt_is_pro() ){
    49                                    
    50                                     $add_new_col_type[] = __( 'Custom Field', 'woo-product-table' );
    51                                     $add_new_col_type[] = __( 'Blank', 'woo-product-table' );
    52                                     $add_new_col_type[] = __( 'Advance Custom Field', 'woo-product-table' );
    53                                     $add_new_col_type[] = __( 'Action Hooks', 'woo-product-table' );
    54                                     $add_new_col_type[] = __( 'Array type Custom Field', 'woo-product-table' );
    55                                     $add_new_col_type[] = __( 'Audio File Type', 'woo-product-table' );
    56                                     $add_new_col_type[] = __( 'All Type Content', 'woo-product-table' );
    57                                 }
    58                                
    59                                 $add_new_col_type = apply_filters( 'wpto_addnew_col_arr', $add_new_col_type, $columns_array, $column_settings, $post );
    60                                 if( is_array( $add_new_col_type ) && count( $add_new_col_type ) > 1 ){
    61                                 echo '<div class="wpt-custom-select-boxes">';
    62                                 foreach($add_new_col_type as $an_key => $an_val){
    63                                     $disable = is_numeric($an_key) ? 'disabled' : '';
    64                                     // $pro = is_numeric($an_key) ? __( '(Pro)' ) : '';
    65                                     $active_class = ( $an_key == $default_column_type ) ? 'active' : '';
    66                                     ?>
    67 
    68                                     <div class="wpt-custom-select-box <?php echo esc_attr( $disable ); ?> <?php echo esc_attr( $active_class ); ?>" data-value="<?php echo esc_attr($an_key); ?>"><?php echo esc_html($an_val); ?></div>
    69                                     <?php
    70                                 }
    71                                 echo '</div>';
    72                                 }
    73                             ?> 
    74 
    75                             </div>
    76                            
    77                         </td>
    78                 </tr>
    79                 <tr>
    80                     <th><label><?php echo esc_html__( 'Tutorials','woo-product-table' ); ?></label></th>
    81                         <td class="add-new-column-doc">
    82                             <?php
    83                                 wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/add-new-column-using-custom-field/', 'Custom Field');
    84                                 wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/add-custom-taxonomy-as-table-column/', 'Taxonomy');
    85                                 wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/how-to-download-file-in-column-using-acf/', 'Advance Custom Field (ACF)');
    86                                 wpt_doc_link('#', 'Action Hooks');
    87                                 wpt_doc_link('#', 'Array Type Custom Field');
    88                                 wpt_doc_link('https://wooproducttable.com/docs/doc/tutorials/how-to-create-a-audio-table-using-woo-product-table/', 'Audio File Type');
    89                                 wpt_doc_link('#', 'All Type Content');
    90                                 wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/show-variation-name-in-a-single-column/', 'Single Variation');
    91                              ?>
    92                         </td>
    93                 </tr>
    94             </tbody>
    95         </table>
    96         <button class="wpt-btn wpt-btn-small wpt-has-icon add_new_column_button">
    97             <span><i class="wpt-plus"></i></span>
    98             <strong class="form-submit-text">
    99                 <?php esc_html_e( 'Add New Column', 'woo-product-table' );?>
    100             </strong>
    101         </button>
     191                    </div>
     192                </details>
     193            </div>
     194        </div>
     195
     196        <!-- Modal Footer -->
     197        <div class="wpt-custom-footer">
     198            <span class="wpt-custom-target-badge"><?php esc_html_e( 'Device:', 'woo-product-table' ); ?> <strong id="wpt-custom-device-label"><?php esc_html_e( 'Default', 'woo-product-table' ); ?></strong></span>
     199            <div class="wpt-custom-footer-actions">
     200                <button type="button" class="wpt-custom-cancel-btn"><?php esc_html_e( 'Cancel', 'woo-product-table' ); ?></button>
     201                <button class="wpt-btn wpt-btn-small wpt-has-icon add_new_column_button">
     202                    <span><i class="wpt-plus"></i></span>
     203                    <strong class="form-submit-text"><?php esc_html_e( 'Add New Column', 'woo-product-table' ); ?></strong>
     204                </button>
     205            </div>
     206        </div>
    102207    </div>
    103208</div>
  • woo-product-table/tags/6.1.6/admin/tabs/inc-column/available-column-list.php

    r3522314 r3837744  
    2929$available_column_array = array_merge( $enabledd_column_array, $available_column_array );
    3030$extra_character = [
    31     'action' => 'add to cart, added, cart, checkout, buy now, purchase, order',
    32     'audio_player' => 'audio, mp3, ogg, wav, music, song',
    33     'quick_qty' => 'quantity, amount, count',
    34     'variation_name' => 'variation, type, model',
    35     'viewed' => 'view, seen, observed, watched',
    36     'category' => 'category, categories, product category',
     31    'action'             => 'add to cart, added, cart, checkout, buy now, purchase, order',
     32    'audio_player'       => 'audio, mp3, ogg, wav, music, song',
     33    'quick_qty'          => 'quantity, amount, count',
     34    'variation_name'     => 'variation, type, model',
     35    'viewed'             => 'view, seen, observed, watched',
     36    'category'           => 'category, categories, product category',
    3737    'toggle_description' => 'toggle, show, hide, description, details',
    38     'stock' => 'stock, availability, in stock, out of stock, backorder, pre-order',
    39     'total' => 'total, total sales, sold, sold out',
    40     'sku' => 'sku, stock keeping unit, product code',
    41     'message' => 'message, note, comment',
    42     'short_description' => 'short description, product details, overview',
    43     'quantity' => 'quantity, amount, count, qty, minimum, maximum, min, max',
    44     'tick' => 'tick, sign, tik, yes, no, true, false',
    45     'check' => 'check,checkbox, yes, no, true, false, checked, unchecked',
    46 ];
     38    'stock'              => 'stock, availability, in stock, out of stock, backorder, pre-order',
     39    'total'              => 'total, total sales, sold, sold out',
     40    'sku'                => 'sku, stock keeping unit, product code',
     41    'message'            => 'message, note, comment',
     42    'short_description'  => 'short description, product details, overview',
     43    'quantity'           => 'quantity, amount, count, qty, minimum, maximum, min, max',
     44    'tick'               => 'tick, sign, tik, yes, no, true, false',
     45    'check'              => 'check,checkbox, yes, no, true, false, checked, unchecked',
     46];
     47
     48$column_category_map = [
     49    'tick'               => 'commerce',
     50    'check'              => 'commerce',
     51    'action'             => 'commerce',
     52    'buy_link'           => 'commerce',
     53    'price'              => 'commerce',
     54    'quantity'           => 'commerce',
     55    'quick_qty'          => 'commerce',
     56    'total'              => 'commerce',
     57    'stock'              => 'commerce',
     58    'quick'              => 'commerce',
     59    'quick_view'         => 'commerce',
     60    'quoterequest'       => 'commerce',
     61    'wishlist'           => 'commerce',
     62    'product_title'      => 'details',
     63    'sku'                => 'details',
     64    'category'           => 'details',
     65    'tags'               => 'details',
     66    'attribute'          => 'details',
     67    'variations'         => 'details',
     68    'variation_name'     => 'details',
     69    'short_description'  => 'details',
     70    'description'        => 'details',
     71    'content'            => 'details',
     72    'toggle_description' => 'details',
     73    'weight'             => 'details',
     74    'length'             => 'details',
     75    'width'              => 'details',
     76    'height'             => 'details',
     77    'rating'             => 'details',
     78    'date'               => 'details',
     79    'modified_date'      => 'details',
     80    'product_id'         => 'details',
     81    'serial_number'      => 'details',
     82    'thumbnails'         => 'media',
     83    'audio_player'       => 'media',
     84    'video'              => 'media',
     85    'message'            => 'media',
     86    'shortcode'          => 'media',
     87    'viewed'             => 'media',
     88    'blank'              => 'media',
     89];
     90
     91$column_descriptions = [
     92    'tick'               => __( 'Bulk selection checkbox', 'woo-product-table' ),
     93    'check'              => __( 'Selection checkbox column', 'woo-product-table' ),
     94    'thumbnails'         => __( 'Product image thumbnail', 'woo-product-table' ),
     95    'product_title'      => __( 'Product name & link', 'woo-product-table' ),
     96    'category'           => __( 'Assigned categories', 'woo-product-table' ),
     97    'tags'               => __( 'Product tag badges', 'woo-product-table' ),
     98    'sku'                => __( 'Unique SKU identifier', 'woo-product-table' ),
     99    'price'              => __( 'Regular & sale price', 'woo-product-table' ),
     100    'quantity'           => __( 'Quantity stepper input', 'woo-product-table' ),
     101    'quick_qty'          => __( 'Instant quantity control', 'woo-product-table' ),
     102    'total'              => __( 'Live line item total', 'woo-product-table' ),
     103    'stock'              => __( 'Inventory availability', 'woo-product-table' ),
     104    'action'             => __( 'Add to cart CTA button', 'woo-product-table' ),
     105    'buy_link'           => __( 'Direct purchase link', 'woo-product-table' ),
     106    'quick'              => __( 'Quick view popup trigger', 'woo-product-table' ),
     107    'quick_view'         => __( 'Quick view modal trigger', 'woo-product-table' ),
     108    'wishlist'           => __( 'Wishlist toggle button', 'woo-product-table' ),
     109    'quoterequest'       => __( 'Quote request action', 'woo-product-table' ),
     110    'rating'             => __( 'Star customer rating', 'woo-product-table' ),
     111    'short_description'  => __( 'Concise product summary', 'woo-product-table' ),
     112    'description'        => __( 'Full product details', 'woo-product-table' ),
     113    'content'            => __( 'Full editor content', 'woo-product-table' ),
     114    'toggle_description' => __( 'Expandable summary drawer', 'woo-product-table' ),
     115    'attribute'          => __( 'Product attributes list', 'woo-product-table' ),
     116    'variations'         => __( 'Inline variation selector', 'woo-product-table' ),
     117    'variation_name'     => __( 'Variation label & options', 'woo-product-table' ),
     118    'weight'             => __( 'Shipping weight value', 'woo-product-table' ),
     119    'length'             => __( 'Product length value', 'woo-product-table' ),
     120    'width'              => __( 'Product width value', 'woo-product-table' ),
     121    'height'             => __( 'Product height value', 'woo-product-table' ),
     122    'date'               => __( 'Publish date display', 'woo-product-table' ),
     123    'modified_date'      => __( 'Last updated date', 'woo-product-table' ),
     124    'product_id'         => __( 'Numeric WooCommerce ID', 'woo-product-table' ),
     125    'serial_number'      => __( 'Row serial counter', 'woo-product-table' ),
     126    'message'            => __( 'Shopper custom note input', 'woo-product-table' ),
     127    'shortcode'          => __( 'Embed inner shortcode', 'woo-product-table' ),
     128    'audio_player'       => __( 'Inline audio preview player', 'woo-product-table' ),
     129    'viewed'             => __( 'Product view counter', 'woo-product-table' ),
     130    'blank'              => __( 'Empty container for sub-items', 'woo-product-table' ),
     131];
     132
     133$category_svg_icons = [
     134    'commerce' => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>',
     135    'details'  => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>',
     136    'media'    => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',
     137];
     138
     139$total_preset_count = count( $available_column_array );
     140$has_pro_presets    = ! empty( $premium_column );
    47141?>
    48142<!-- Enable Active Column -->
    … …  
    59153                <strong class="form-submit-text">Custom Column</strong>
    60154            </button>
    61             <div id="wpt-dropdown-container" class="wpt-dropdown-container" style="display:none;">
    62                 <div class="wpt-dropdown-container-insider">
    63                     <input type="text" id="wpt-search" placeholder="Search column..." class="wpt-column-search-box" />
    64                     <ul id="wpt-dropdown-list" class="wpt-dropdown-list">
    65                 <?php
    66 
    67                 foreach( $available_column_array as $keyword => $title ){
    68 
    69                     $updated_title = isset( $updated_columns_array[$keyword] ) ? $updated_columns_array[$keyword] : $title;
    70 
    71                     $enabled_class = '';
    72                     if( in_array( $keyword, array_keys( $enabledd_column_array ) ) ){
    73                         $enabled_class = 'item-enabled';
    74                     }
    75 
    76                     //eta specially pro badge dekhanor jonno ebong eta js er maddhome off kore dite hobe, jodi disabled thake
    77                     $premium = in_array( $keyword, array_keys( $premium_column ) ) ? 'premium' : '';
    78                    
    79                 ?>
    80                 <li class="switch-enable-item switch-enable-item-<?php echo esc_attr( $keyword . ' ' . $enabled_class . ' ' . $premium ); ?>"
    81                     data-character ="<?php echo esc_attr( $extra_character[$keyword] ?? '' ); ?>"
    82                     title="<?php echo esc_html( "key: $keyword & title: $updated_title" ); ?>"
    83                     data-column_keyword="<?php echo esc_attr( $keyword ); ?>">
    84                         <?php echo esc_html( $updated_title ); ?><i>[<?php echo esc_html( $keyword ); ?>]</i>
    85                 </li>
    86                 <?php }
    87 
    88                 ?>
    89                     </ul>
     155            <div id="wpt-dropdown-container" class="wpt-dropdown-container wpt-spotlight-modal" style="display:none;">
     156                <div class="wpt-dropdown-container-insider wpt-spotlight-insider">
     157                    <div class="wpt-spotlight-search-hero">
     158                        <span class="wpt-spotlight-search-icon" aria-hidden="true">
     159                            <svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
     160                        </span>
     161                        <input type="text" id="wpt-search" placeholder="<?php esc_attr_e( 'Search preset columns by name, key, or feature...', 'woo-product-table' ); ?>" class="wpt-column-search-box" />
     162                        <span class="wpt-kbd-hint">ESC</span>
     163                        <button type="button" class="wpt-modal-close-btn" aria-label="<?php esc_attr_e( 'Close', 'woo-product-table' ); ?>">&times;</button>
     164                    </div>
     165
     166                    <div class="wpt-preset-active-ribbon">
     167                        <span class="wpt-active-ribbon-label"><?php esc_html_e( 'Active:', 'woo-product-table' ); ?></span>
     168                        <div class="wpt-preset-active-chips"></div>
     169                    </div>
     170
     171                    <div class="wpt-spotlight-body">
     172                        <aside class="wpt-spotlight-rail" aria-label="<?php esc_attr_e( 'Column categories', 'woo-product-table' ); ?>">
     173                            <button type="button" class="wpt-rail-btn active" data-filter="all">
     174                                <span><?php esc_html_e( 'All Columns', 'woo-product-table' ); ?></span>
     175                                <span class="wpt-rail-count"><?php echo esc_html( $total_preset_count ); ?></span>
     176                            </button>
     177                            <button type="button" class="wpt-rail-btn" data-filter="commerce">
     178                                <span><?php esc_html_e( 'Commerce', 'woo-product-table' ); ?></span>
     179                                <span class="wpt-rail-count">0</span>
     180                            </button>
     181                            <button type="button" class="wpt-rail-btn" data-filter="details">
     182                                <span><?php esc_html_e( 'Product Info', 'woo-product-table' ); ?></span>
     183                                <span class="wpt-rail-count">0</span>
     184                            </button>
     185                            <button type="button" class="wpt-rail-btn" data-filter="media">
     186                                <span><?php esc_html_e( 'Media & Extra', 'woo-product-table' ); ?></span>
     187                                <span class="wpt-rail-count">0</span>
     188                            </button>
     189                            <?php if ( $has_pro_presets ) : ?>
     190                                <button type="button" class="wpt-rail-btn wpt-rail-btn--pro" data-filter="premium">
     191                                    <span><?php esc_html_e( 'Pro Columns', 'woo-product-table' ); ?></span>
     192                                    <span class="wpt-rail-count"><?php echo esc_html( count( $premium_column ) ); ?></span>
     193                                </button>
     194                            <?php endif; ?>
     195                        </aside>
     196
     197                        <div class="wpt-spotlight-grid-wrap">
     198                            <ul id="wpt-dropdown-list" class="wpt-dropdown-list">
     199                        <?php
     200
     201                        foreach( $available_column_array as $keyword => $title ){
     202
     203                            $updated_title = isset( $updated_columns_array[$keyword] ) ? $updated_columns_array[$keyword] : $title;
     204
     205                            $enabled_class = '';
     206                            if( in_array( $keyword, array_keys( $enabledd_column_array ) ) ){
     207                                $enabled_class = 'item-enabled';
     208                            }
     209
     210                            //eta specially pro badge dekhanor jonno ebong eta js er maddhome off kore dite hobe, jodi disabled thake
     211                            $premium = in_array( $keyword, array_keys( $premium_column ) ) ? 'premium' : '';
     212                            $col_cat = $column_category_map[ $keyword ] ?? 'media';
     213                            $col_desc = $column_descriptions[ $keyword ] ?? '';
     214                            $cat_icon = $category_svg_icons[ $col_cat ] ?? $category_svg_icons['media'];
     215
     216                        ?>
     217                        <li class="switch-enable-item switch-enable-item-<?php echo esc_attr( $keyword . ' ' . $enabled_class . ' ' . $premium ); ?>"
     218                            data-category="<?php echo esc_attr( $col_cat ); ?>"
     219                            data-character="<?php echo esc_attr( $extra_character[$keyword] ?? '' ); ?>"
     220                            data-label="<?php echo esc_attr( $updated_title ); ?>"
     221                            title="<?php echo esc_attr( "key: $keyword & title: $updated_title" ); ?>"
     222                            data-column_keyword="<?php echo esc_attr( $keyword ); ?>">
     223                                <span class="wpt-preset-card-icon" aria-hidden="true"><?php echo $cat_icon; ?></span>
     224                                <span class="wpt-preset-card-body">
     225                                    <span class="wpt-preset-card-title"><?php echo esc_html( $updated_title ); ?></span>
     226                                    <span class="wpt-preset-card-sub">
     227                                        <i>[<?php echo esc_html( $keyword ); ?>]</i>
     228                                        <?php if ( ! empty( $col_desc ) ) : ?>
     229                                            <span class="wpt-preset-card-desc"><?php echo esc_html( $col_desc ); ?></span>
     230                                        <?php endif; ?>
     231                                    </span>
     232                                </span>
     233                        </li>
     234                        <?php }
     235
     236                        ?>
     237                            </ul>
     238                            <div class="wpt-preset-empty" style="display:none;">
     239                                <?php esc_html_e( 'No matching columns found. Try a different keyword or category.', 'woo-product-table' ); ?>
     240                            </div>
     241                        </div>
     242                    </div>
     243
     244                    <div class="wpt-spotlight-footer">
     245                        <span class="wpt-spotlight-summary"><?php esc_html_e( 'Click any card to add or remove columns', 'woo-product-table' ); ?></span>
     246                        <button type="button" class="wpt-modal-done-btn"><?php esc_html_e( 'Done', 'woo-product-table' ); ?></button>
     247                    </div>
    90248                </div>
    91249            </div>
  • woo-product-table/tags/6.1.6/admin/tabs/inc-column/column-list.php

    r3522314 r3837744  
    2828        }
    2929        $readOnly = ( $keyword == 'check' ? 'readonly' : false );
     30        $is_custom_col = in_array( $keyword, $additional_collumn ) ? 'wpt-custom-column-item' : '';
    3031    ?>
    31     <li class="wpt_sortable_peritem <?php echo esc_attr( $enabled_class ); ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">
     32    <li class="wpt_sortable_peritem <?php echo esc_attr( $enabled_class ); ?> <?php echo esc_attr( $is_custom_col ); ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">
    3233        <span title="<?php esc_attr_e( 'Move Handle', 'woo-product-table' );?>" class="handle"></span>
    3334        <div class="wpt_shortable_data">
    … …  
    5556            <?php } echo esc_html( $keyword ); ?>
    5657            </span>
     58           
     59           
    5760            <?php
    58            
    59             if( in_array($keyword,$additional_collumn) ){
    60             ?>
    61                 <span title='Remove this Column' onclick="return confirm('Deleting this Column\nAre you sure?');" class='wpt_column_cross'>X</span>
    62             <?php
     61            ob_start();
     62            $current_colum_settings = $column_settings[$keyword] ?? array();
     63            /**
     64             * @Hook wpto_column_basic_form global hook for All column
     65             * and it will show always automatically
     66             *
     67             * Used in free version at
     68             * wpml/admin-area.php to show Language Field based on WPML plugin.
     69             *
     70             *
     71             * @since 3.1.5.0
     72             * @author Saiful Islam <codersaiful@gmail.com>
     73             */
     74            do_action( 'wpto_column_basic_form' , $keyword, $_device_name, $current_colum_settings, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
     75
     76            /**
     77             * Adding Extra Features Based on Specific keyword
     78             *
     79             * *****************************
     80             * @HOOKED at includes/functions.php
     81             * wpto_column_setting_form_thumbnails wpt_thumbnails_column_add 10,2
     82             */
     83            do_action( 'wpto_column_setting_form_' . $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
     84            $single_extra_content = ob_get_clean();
     85            if( !empty( trim( $single_extra_content ) ) ){
     86                echo '<div class="wpt_column_setting_single_extra">' . $single_extra_content . '</div>';
    6387            }
    6488            ?>
    65            
    66            
    67             <div class="wpt_column_setting_single_extra">
    68 
    69                 <?php
    70                 $current_colum_settings = $column_settings[$keyword] ?? array();
    71                 /**
    72                  * @Hook wpto_column_basic_form global hook for All column
    73                  * and it will show always automatically
    74                  *
    75                  * Used in free version at
    76                  * wpml/admin-area.php to show Language Field based on WPML plugin.
    77                  *
    78                  *
    79                  * @since 3.1.5.0
    80                  * @author Saiful Islam <codersaiful@gmail.com>
    81                  */
    82                 do_action( 'wpto_column_basic_form' , $keyword, $_device_name, $current_colum_settings, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
    83 
    84                 /**
    85                  * Adding Extra Features Based on Specific keyword
    86                  *
    87                  * *****************************
    88                  * @HOOKED at includes/functions.php
    89                  * wpto_column_setting_form_thumbnails wpt_thumbnails_column_add 10,2
    90                  */
    91                 do_action( 'wpto_column_setting_form_' . $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ); ?>
    92             </div>
    9389            <span data-key="<?php echo esc_attr( $keyword ); ?>" class="extra_all_on_off on_now"><i class="on_off_icon"></i>Expand</span>
    94             <div class="wpt_column_setting_extra column_setting_form-default for_all extra_all_<?php echo esc_attr( $keyword ); ?>" data-wpt_column_setting_extra="extra_all_<?php echo esc_attr( $keyword ); ?>">
    95                 <?php do_action( 'wpto_column_setting_form_inside_' . $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ); ?>
    96                 <?php
    97                 /**
    98                  * Adding Extra Feature based on action hook
    99                  *
    100                  * *******************************
    101                  * @HOOKED at includes/functions.php
    102                  * wpt_column_add_extra_items 10,7
    103                  * wpt_column_tag_for_all 10,3
    104                  */
    105                
    106                 do_action( 'wpto_column_setting_form', $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ); ?>
    107                
    108             </div>
    109             <div class="wpt_column_setting_extra for_all profeatures-message">
    110                
    111             </div>
     90            <?php
     91            ob_start();
     92            do_action( 'wpto_column_setting_form_inside_' . $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
     93            /**
     94             * Adding Extra Feature based on action hook
     95             *
     96             * *******************************
     97             * @HOOKED at includes/functions.php
     98             * wpt_column_add_extra_items 10,7
     99             * wpt_column_tag_for_all 10,3
     100             */
     101            do_action( 'wpto_column_setting_form', $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
     102            $extra_content = trim( ob_get_clean() );
     103            ?>
     104            <div class="wpt_column_setting_extra column_setting_form-default for_all extra_all_<?php echo esc_attr( $keyword ); ?>" data-wpt_column_setting_extra="extra_all_<?php echo esc_attr( $keyword ); ?>"><?php echo $extra_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
    112105           
    113106
  • woo-product-table/tags/6.1.6/admin/tabs/options.php

    r3522314 r3837744  
    143143                   
    144144                <div class="custom-select-box-wrapper sfl-auto-gen-box">
     145                    <?php $pagination_val = ! empty( $meta_basics['pagination'] ) ? $meta_basics['pagination'] : 'on'; ?>
    145146                    <input type="hidden" name="basics[pagination]"
    146                      value="<?php echo esc_attr( $meta_basics['pagination'] ?? 'on' ); ?>"
     147                     value="<?php echo esc_attr( $pagination_val ); ?>"
    147148                     class="custom-select-box-input" id="wpt_table_ajax_pagination">
    148149                    <div class="wpt-custom-select-boxes">
    149                         <div class="wpt-custom-select-box <?php echo isset( $meta_basics['pagination'] ) && $meta_basics['pagination'] == 'on' ? 'active' : ''; ?>"
     150                        <div class="wpt-custom-select-box <?php echo $pagination_val === 'on' ? 'active' : ''; ?>"
    150151                        data-value="on">
    151152                            <?php esc_html_e('Number/Paging','woo-product-table');?>
    152153                        </div>
    153                         <div class="wpt-custom-select-box <?php echo isset( $meta_basics['pagination'] ) && $meta_basics['pagination'] == 'off' ? 'active' : ''; ?>"
     154                        <div class="wpt-custom-select-box <?php echo $pagination_val === 'off' ? 'active' : ''; ?>"
    154155                        data-value="off">
    155156                            <?php esc_html_e('Disable','woo-product-table');?>
    … …  
    158159                        $disabled = ! defined('WPT_PRO_DEV_VERSION') ? 'disabled' : '';
    159160                        ?>
    160                         <div class="wpt-custom-select-box <?php echo esc_attr( $disabled ); ?> <?php echo isset( $meta_basics['pagination'] ) && $meta_basics['pagination'] == 'load_more' ? 'active' : ''; ?>"
     161                        <div class="wpt-custom-select-box <?php echo esc_attr( $disabled ); ?> <?php echo $pagination_val === 'load_more' ? 'active' : ''; ?>"
    161162                        data-value="load_more">
    162163                            <?php esc_html_e('Load More','woo-product-table');?>
    163164                        </div>
    164                         <div class="wpt-custom-select-box <?php echo esc_attr( $disabled ); ?> <?php echo isset( $meta_basics['pagination'] ) && $meta_basics['pagination'] == 'infinite_scroll' ? 'active' : ''; ?>"
     165                        <div class="wpt-custom-select-box <?php echo esc_attr( $disabled ); ?> <?php echo $pagination_val === 'infinite_scroll' ? 'active' : ''; ?>"
    165166                        data-value="infinite_scroll">
    166167                            <?php esc_html_e('Infinite Scroll','woo-product-table');?>
    … …  
    444445            <tr>
    445446                <th>
    446                     <label style="display: inline;width: inherit;" class="wpt_label wpt_column_hide_unhide_tab" for="wpt_wp_force"><?php esc_html_e( 'DataTable', 'woo-product-table' );?></label>
     447                    <label style="display: inline;width: inherit;" class="wpt_label wpt_column_hide_unhide_tab" for="wpt_datatable"><?php esc_html_e( 'DataTable', 'woo-product-table' );?></label>
    447448                </th>
    448449                <td>
  • woo-product-table/tags/6.1.6/admin/tabs/query.php

    r3522314 r3837744  
    195195                        </select><span class="select2 select2-container select2-container--default select2-container--below" dir="ltr" data-select2-id="104" style="width: 1px;"><span class="selection"><span class="select2-selection select2-selection--multiple" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="-1" aria-disabled="false"><ul class="select2-selection__rendered"><li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" placeholder="" style="width: 0.75em;"></li></ul></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span><span class="select2 select2-container select2-container--default select2-container--focus select2-container--open select2-container--above" dir="ltr" data-select2-id="122" style="width: auto;"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>
    196196                        <p class="notice-for-variations" style="display: none;">Please select only variable products</p>
    197                         <p>Choose your selected product to make a table with selected product from your while store. To select multiple products at a time, Please press [CTRL + S]</p>
     197                        <p>Choose your selected product to make a table with selected product from your whole store. To select multiple products at a time, hold Ctrl (or Cmd) while clicking.</p>
    198198                    </td>
    199199                </tr>
  • woo-product-table/tags/6.1.6/admin/tabs/search_n_filter.php

    r3522314 r3837744  
    530530                        ?>
    531531                    </select>
    532 
    533                    
    534                     </p>
    535532                </td>
    536533            </tr>
  • woo-product-table/tags/6.1.6/admin/wpt_product_table_post.php

    r3522314 r3837744  
    8787
    8888        if ( 'wpt_product_table' == get_post_type() ){
    89         $default['wpt_shortcode'] = "Shortcode";
    90                 if(isset( $default['date'] )) unset($default['date']);
     89            $default['wpt_shortcode'] = __( 'Embed Shortcode (1-Click Copy)', 'woo-product-table' );
     90            if(isset( $default['date'] )) unset($default['date']);
    9191        }
    9292        return $default;
    … …  
    100100
    101101        if ($column_name == 'wpt_shortcode') {
    102             $post_title = get_the_title( $post_id );
    103             $post_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/',"$1", $post_title );
    104                         ?>
    105                         <input class='wpt_auto_select_n_copy' type='text'
    106                          value='[Product_Table id="<?php echo esc_attr( absint( $post_id ) ); ?>" name="<?php echo esc_attr( $post_title ); ?>"]' id='wpt_shotcode_content_<?php echo esc_attr( absint( $post_id ) ); ?>' readonly>
    107                          <a class="button button-primary wpt_copy_button_metabox wpt_copy_button_metabox-column" data-target_id="wpt_shotcode_content_<?php echo esc_attr( absint( $post_id ) ); ?>"><?php echo esc_html__( 'Copy','woo-product-table' ); ?></a>
    108                          <p class="wpt_shotcode_content_column wpt_shotcode_content_<?php echo esc_attr( absint( $post_id ) ); ?>"></p>
    109                         <?php
     102            $post_title  = get_the_title( $post_id );
     103            $clean_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/', '', $post_title );
     104            $shortcode   = sprintf( '[Product_Table id="%d" name="%s"]', absint( $post_id ), esc_attr( $clean_title ) );
     105            ?>
     106            <div class="wpt-shortcode-field">
     107                <code class="wpt-shortcode-text"><?php echo esc_html( $shortcode ); ?></code>
     108                <button type="button" class="wpt-copy-btn" title="<?php esc_attr_e( 'Click to Copy Shortcode', 'woo-product-table' ); ?>">
     109                    <i class="wpt-copy"></i> <?php esc_html_e( 'Copy', 'woo-product-table' ); ?>
     110                </button>
     111            </div>
     112            <input type="hidden" class="wpt_auto_select_n_copy" value="<?php echo esc_attr( $shortcode ); ?>" id="wpt_shotcode_content_<?php echo esc_attr( absint( $post_id ) ); ?>">
     113            <?php
    110114        } 
    111115    }
  • woo-product-table/tags/6.1.6/assets/css/admin.css

    r3522314 r3837744  
    14291429
    14301430tr.user_can_not_edit>td:first-child:before {
    1431     content: "Pro";
    1432     background: #ff1100;
    1433     color: white;
    1434     padding: 0px 5px;
    1435     border-radius: 4px;
    1436     z-index: 2;
    1437     font-size: 10px;
    1438     position: absolute;
    1439     right: 0;
    1440     top: 0;
    1441     border: 0 navajowhite;
    1442     left: unset;
     1431    display: none;
    14431432}
    14441433.wpt-premium-feature-in-free-version tr.user_can_not_edit>td:first-child:before{display: none;}
    … …  
    16141603}
    16151604.wpt-header.wpt-clearfix:before {display:block}
    1616 form#wpt-main-configuration-form  .float-btn.wpt-btn {
    1617     opacity: 0;
    1618     /* top: 70px; */
    1619     right: -80px;
    1620     transition: .4s all;
    1621     display: none;
    1622 }
    1623 form#wpt-main-configuration-form  #stick_on_scroll-on {
    1624     position: fixed;
    1625     bottom: unset;
    1626     right: 0;
    1627     box-shadow: 0px 10px 30px 0 #00000061;
    1628     padding: 0 2px 0 0 !important;
    1629     font-size: 16px;
    1630     font-weight: normal;
    1631     border-radius: unset;
    1632     z-index: 99999;
    1633     display: none;
    1634     top: 450px;
    1635     left: unset;
    1636     margin: 0;
    1637     opacity: 1;
    1638 }
    1639 form#wpt-main-configuration-form #stick_on_scroll-on span {
    1640     width: 60px;
    1641     padding: 16 0;
    1642     margin-right: 0;
    1643 }
    1644 form#wpt-main-configuration-form #stick_on_scroll-on span i{
    1645     font-size: 22px;
    1646 }
    1647 form#wpt-main-configuration-form #stick_on_scroll-on>strong {
    1648     font-size: 10px;
    1649     font-weight: 100;
    1650     transform: rotate(90deg);
    1651     display: inline-block;
    1652     letter-spacing: 1px;
    1653     width: 28px;
    1654     text-align: center;
    1655 }
    1656 form#wpt-main-configuration-form  #stick_on_scroll-on.stick_on_scroll-on{
    1657     display: block;
     1605form#wpt-main-configuration-form  .float-btn.wpt-btn,
     1606form#wpt-main-configuration-form  #stick_on_scroll-on,
     1607form#wpt-main-configuration-form  #stick_on_scroll-on.stick_on_scroll-on {
     1608    display: none !important;
    16581609}
    16591610
    … …  
    23322283    content: attr(title);
    23332284    position: absolute;
    2334     top: 0;
    2335     min-width: 500px;
    2336     width: 100%;
    2337     max-width: 100%;
    2338     left: 25px;
    2339     background: #007694;
    2340     border: 1px solid #007694;
    2341     padding: 5px;
    2342     box-shadow: 0px 5px 19px 0 #00000040;
    2343     border-radius: 6px;
     2285    bottom: calc(100% + 8px);
     2286    top: auto;
     2287    right: 0;
     2288    left: auto;
     2289    min-width: 240px;
     2290    width: max-content;
     2291    max-width: 340px;
     2292    white-space: normal;
     2293    background: #0f172a;
     2294    border: 1px solid #0f172a;
     2295    padding: 8px 12px;
     2296    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.22);
     2297    border-radius: 8px;
    23442298    text-align: left;
    2345     color: white;
     2299    color: #ffffff;
    23462300    display: block !important;
    2347     line-height: 16px;
    2348     font-size: 14px;
     2301    line-height: 1.45;
     2302    font-size: 12.5px;
     2303    font-weight: 400;
     2304    z-index: 9999;
     2305    pointer-events: none;
    23492306}
    23502307span.wpt-help-icon:hover {
    … …  
    24142371    align-items: center;
    24152372}
    2416 .wpt-custom-select-boxes {
    2417     display: flex;
     2373/* Modern Option Segmented Control (Pill Button Groups) */
     2374.wpt-custom-select-boxes,
     2375.sfl-auto-gen-box .wpt-custom-select-boxes {
     2376    display: inline-flex;
    24182377    flex-wrap: wrap;
    2419     gap: 8px;
    2420     justify-content: flex-start;
    2421     align-items: stretch;
    2422 }
    2423 
    2424 .wpt-custom-select-box {
    2425     padding: 9px 13px;
    2426     border: 1px solid #656565;
     2378    align-items: center;
     2379    background: #f1f5f9;
     2380    padding: 3px;
     2381    border: 1px solid #e2e8f0;
     2382    border-radius: 9px;
     2383    gap: 3px;
     2384    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
     2385}
     2386
     2387.wpt-custom-select-box,
     2388.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box {
     2389    padding: 6px 14px;
     2390    border: none;
    24272391    border-radius: 6px;
    2428     /* transition: 0.3s; */
    24292392    cursor: pointer;
    2430     border-style: dashed;
     2393    font-size: 13px;
    24312394    font-weight: 500;
    2432     background: #0073aa14;
    2433     color: black;
    2434 }
    2435 
    2436 .wpt-custom-select-box:hover {
    2437     background-color: #0073aa36;
    2438 }
    2439 
    2440 .wpt-custom-select-box.active {
    2441     background-color: #0073aa;
    2442     color: #fff;
    2443     border-color: #0073aa;
    2444 }
    2445 
    2446 .wpt-custom-select-box.disabled {
    2447     background-color: #f1f1f1;
    2448     color: #999;
     2395    line-height: 1.35;
     2396    background: transparent;
     2397    color: #475569;
     2398    box-shadow: none;
     2399    transition: all 0.15s ease-in-out;
     2400    display: inline-flex;
     2401    align-items: center;
     2402    justify-content: center;
     2403    user-select: none;
     2404}
     2405
     2406.wpt-custom-select-box:hover,
     2407.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box:hover {
     2408    color: #0f172a;
     2409    background-color: rgba(255, 255, 255, 0.7);
     2410}
     2411
     2412.wpt-custom-select-box.active,
     2413.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box.active {
     2414    background: #2563eb;
     2415    color: #ffffff;
     2416    font-weight: 600;
     2417    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.28);
     2418}
     2419
     2420.wpt-custom-select-box.disabled,
     2421.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box.disabled {
     2422    background: transparent;
     2423    color: #94a3b8;
    24492424    cursor: not-allowed;
    2450     border-style: dashed;
    2451     position: relative;
    2452     opacity: 0.8;
    2453     border-color: #a7a7a7;
    2454 }
    2455 .wpt-custom-select-box.disabled:hover {
    2456     background-color: #e0e0e0;
    2457     color: #999;
    2458     cursor: not-allowed;
    2459     border-style: dashed;
    2460 }
    2461 .wpt-extra-content>* {
    2462     padding: 0;
    2463     margin: 0 !important;
    2464 }
    2465 .sfl-auto-gen-box .wpt-custom-select-boxes {
    2466     gap: 0;
    2467     border: 1px #0073aa;
    2468     border-style: double;
    2469     border-radius: 6px;
    2470     overflow: hidden;
    2471     flex-wrap: nowrap;
    2472     flex-direction: row;
    2473 }
    2474 .sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box {
    2475     border-radius: 0;
    2476     border: 0 none;
    2477 }
    2478 .sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box.active {
    2479     color: white;
    2480     background: #0073aa;
    2481 }
    2482 
    2483 .sfl-auto-gen-box .wpt-custom-select-boxes {
    2484     border-color: #0073aa;
    2485     border-radius: 2px;
    2486 }
    2487 
    2488 .sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box {
    2489     background: #ededed61;
    2490     color: black;
    2491     box-shadow: 1px 0px 1px #00000062;
     2425    opacity: 0.5;
     2426    box-shadow: none;
     2427}
     2428
     2429.wpt-custom-select-box.disabled:hover,
     2430.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box.disabled:hover {
     2431    background: transparent;
     2432    color: #94a3b8;
    24922433}
    24932434
    … …  
    27532694span.wpt-query-selection-handle.type-pf-premium:after,
    27542695.wpt-custom-select-box.disabled::after,
    2755 .wpt-template-item.wpt-temp-type-limited:after,
    2756 .wpt-premium-feature-in-free-version>*:before {
     2696.wpt-template-item.wpt-temp-type-limited:after {
    27572697    content: "Pro";
    27582698    position: absolute;
    2759     background: red;
     2699    background: #7c3aed;
    27602700    right: 0;
    27612701    top: 0;
    … …  
    27742714    position: relative;
    27752715}
    2776 .wpt-premium-feature-in-free-version div,.wpt-premium-feature-in-free-version table, .wpt-premium-feature-in-free-version tr, .wpt-premium-feature-in-free-version td {
     2716.wpt-premium-feature-in-free-version div,
     2717.wpt-premium-feature-in-free-version table {
    27772718    background: transparent;
    27782719}
    … …  
    28892830}
    28902831.wpt-setting-search-input{
    2891     margin: 2px !important;
    2892     /* flex: 1; */
    2893     width: 400px;
    2894     max-width: 100%;
    2895     min-width: 300px;
    2896    
     2832    margin: 0 !important;
     2833    width: 220px;
     2834    max-width: 240px;
     2835    min-width: 180px;
    28972836    background: rgb(255, 255, 255) !important;
    28982837}
    28992838input#wpt-setting-search-input {
    29002839    padding: 3px 10px;
    2901     margin: 2px !important;
    2902     flex: 1;
     2840    margin: 0 !important;
     2841    flex: 0 0 auto;
    29032842}
    29042843.wpt_shotcode_content_column{color: green;font-weight:bold;display:none; padding-left: 12px;}
  • woo-product-table/tags/6.1.6/assets/css/base-template.css

    r3522314 r3837744  
    528528 flex-wrap: wrap;
    529529 flex-direction: column;
     530 align-items: flex-start;
    530531 flex-basis: 100%;
    531532}
  • woo-product-table/tags/6.1.6/assets/css/expert-services.css

    r3772120 r3837744  
    349349        background: #fff;
    350350        box-shadow: 0 10px 30px rgba(16, 42, 72, .08);
    351         opacity: 0.15;
    352         transition: opacity 0.3s ease-in-out;
     351        opacity: 1;
     352        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    353353}
    354354.caes-payment-section:hover {
    355         opacity: 1;
    356         cursor: pointer;
     355        border-color: #cbd5e1;
     356        box-shadow: 0 14px 34px rgba(16, 42, 72, .12);
    357357}
    358358
  • woo-product-table/tags/6.1.6/assets/css/new-admin.css

    r3522314 r3837744  
    3535    background: #ffffff;
    3636    display: flow-root;
    37     /* flex-basis: 100%; */
    38 }
    39 .wpt-header.wpt-clearfix.topbar-fixed-on-scroll {
    40     position: fixed;
    41     width: 100%;
    42     background: white;
     37    position: -webkit-sticky;
     38    position: sticky;
     39    top: 32px;
    4340    z-index: 999;
    44     box-shadow: 0 4px 10px #0000001a;
    45 }
    46 @media (max-width: 779px) {
    47     .wpt-header.wpt-clearfix.topbar-fixed-on-scroll {
    48         top: 0;
     41    transition: box-shadow 0.2s ease;
     42}
     43@media (max-width: 782px) {
     44    .wpt-header {
     45        top: 46px;
    4946    }
    5047    .header-button-wrapper{
    … …  
    5249    }
    5350}
     51@media (max-width: 600px) {
     52    .wpt-header {
     53        top: 0;
     54    }
     55}
     56.wpt-header.wpt-clearfix.topbar-fixed-on-scroll {
     57    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
     58}
    5459.topbar-fixed-on-scroll-main-element{
    55     margin-top: 200px;
     60    margin-top: 0;
    5661}
    5762.wpt-clearfix:before, .wpt-clearfix:after {
    … …  
    264269
    265270a.wpt-button, button.wpt-button {
    266     padding: 11px 19px 12px 18px;
    267     font-weight: 600;
     271    padding: 8px 16px;
     272    font-weight: 500;
    268273    cursor: pointer;
    269274    text-align: center;
    270     text-transform: uppercase;
    271     letter-spacing: -0.023em;
    272     border: none;
    273     border-radius: 0;
    274     color: #fff;
    275     background-color: #607D8B;
     275    text-transform: none;
     276    letter-spacing: 0;
     277    border: 1px solid #cbd5e1;
     278    border-radius: 8px;
     279    color: #475569;
     280    background-color: #ffffff;
    276281    text-decoration: none;
     282    display: inline-flex;
     283    align-items: center;
     284    gap: 6px;
     285    transition: all 0.18s ease;
    277286}
    278287
    279288a.wpt-button:hover, button.wpt-button:hover {
    280     background-color: #0073aa;
     289    background-color: #f8fafc;
     290    color: #0f172a;
     291    border-color: #94a3b8;
    281292}
    282293a.wpt-button.reverse, button.wpt-button.reverse {
    283     background-color: #0073aa;
     294    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
     295    border-color: #1d4ed8;
     296    color: #ffffff;
     297    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
    284298}
    285299a.wpt-button.reverse:hover, button.wpt-button.reverse:hover {
    286     background-color: #607D8B;
     300    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
     301    color: #ffffff;
     302    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
    287303}
    288304a.wpt-button.reset {
    289     background: #e3e3e3;
    290     color: #747272;
     305    background: #ffffff;
     306    border: 1px solid #cbd5e1;
     307    color: #64748b;
    291308}
    292309a.wpt-button.reset:hover {
    293     background: #ebebeb;
    294     color: #3e3a3a;
     310    background: #fef2f2;
     311    border-color: #fca5a5;
     312    color: #ef4444;
    295313}
    296314.wpt-btn {
    297     display: inline-block;
     315    display: inline-flex;
     316    align-items: center;
     317    justify-content: center;
     318    gap: 8px;
    298319    vertical-align: middle;
    299320    margin: 0;
    300     font-family: "Open Sans", Arial, sans-serif;
    301     font-size: 14px;
    302     line-height: normal;
     321    font-family: inherit;
     322    font-size: 13.5px;
     323    line-height: 1.4;
    303324    cursor: pointer;
    304325    text-decoration: none;
    305     padding: 11px 19px 12px 18px;
    306     font-weight: 800;
     326    padding: 9px 20px;
     327    font-weight: 600;
    307328    text-align: center;
    308     text-transform: uppercase;
    309     letter-spacing: -0.025em;
    310     border: none;
    311     border-radius: 2px;
     329    text-transform: none;
     330    letter-spacing: 0;
     331    border: 1px solid #1d4ed8;
     332    border-radius: 8px;
    312333    color: #fff;
    313     background-color: #0073aa;
     334    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    314335    white-space: nowrap;
     336    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
     337    transition: all 0.18s ease;
    315338}
    316339.wpt-btn strong{
    317     font-weight: 800;
     340    font-weight: 600;
    318341}
    319342.wpt-btn.round {
    320     border-radius: 22px;
     343    border-radius: 9999px;
    321344}
    322345.wpt-btn.wpt-btn-small {
    323     padding: 9px 18px 9px 18px;
    324     font-weight: normal;
     346    padding: 7px 14px;
     347    font-size: 12.5px;
     348    font-weight: 500;
    325349    text-transform: none;
    326350}
    327351.wpt-btn.wpt-btn-tiny {
    328     padding: 8px 16px 8px 16px;
    329     font-weight: normal;
     352    padding: 5px 10px;
     353    font-size: 12px;
     354    font-weight: 500;
    330355    text-transform: none;
    331356}
    332357.wpt-btn.reset {
    333     background-color: #9E9E9E;
     358    background: #ffffff;
     359    border: 1px solid #cbd5e1;
     360    color: #64748b;
     361    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    334362}
    335363.wpt-btn:hover {
    336364    color: white;
    337     background-color: #607D8B;
     365    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
     366    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
     367    transform: translateY(-1px);
     368}
     369.wpt-btn.reset:hover {
     370    color: #ef4444;
     371    border-color: #fca5a5;
     372    background: #fef2f2;
     373    transform: translateY(-1px);
     374    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.15);
    338375}
    339376.wpt-btn.wpt-has-icon{
    340     padding: 0 30px 0 0;
     377    padding: 9px 20px;
    341378}
    342379.wpt-btn.wpt-btn-tiny.wpt-has-icon {
    343     padding: 0 8px 0 0;
     380    padding: 5px 10px;
    344381}
    345382.wpt-btn span {
    346     display: inline-block;
    347     text-align: center;
    348     width: 46px;
    349     padding: 14px 0;
    350     margin-right: 14px;
    351     border-radius: 4px 0 0 4px;
    352     background: #00000042;
     383    display: inline-flex;
     384    align-items: center;
     385    justify-content: center;
     386    width: auto;
     387    padding: 0;
     388    margin-right: 2px;
     389    border-radius: 0;
     390    background: transparent;
    353391}
    354392
    … …  
    468506    }
    469507    .topbar-fixed-on-scroll .header-button-wrapper {
    470         justify-content: flex-start;
     508        justify-content: flex-end;
    471509    }
    472510    .wrap.wpt_wrap.wpt-content {
    … …  
    572610    font-family: "wptfontelo";
    573611    text-align: center;
    574     padding-top: 6px !important;
     612    padding-top: 6px;
    575613    font-size: 10px;
    576614    color: white;
  • woo-product-table/tags/6.1.6/assets/css/universal.css

    r3584643 r3837744  
    3939}
    4040.wpt-td-tag.wpt_action{
    41  text-align: right !important;
     41 text-align: left;
    4242}
    4343
    … …  
    19381938 }
    19391939}
     1940
     1941/* Keep Action variations and controls cleanly left-aligned when Action is not last */
     1942body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action form.variations_form.cart {
     1943  display: flex;
     1944  flex-direction: column;
     1945  align-items: flex-start;
     1946  flex-basis: 100%;
     1947  width: 100%;
     1948}
     1949
     1950body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action table.variations {
     1951  width: auto;
     1952  margin: 0 0 8px 0;
     1953}
     1954
     1955body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action table.variations th,
     1956body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action table.variations td {
     1957  text-align: left;
     1958  padding-left: 0;
     1959}
     1960
     1961body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action table.variations th {
     1962  padding-right: 10px;
     1963}
     1964
     1965body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action .wpt_varition_section {
     1966  display: inline-flex;
     1967  flex-wrap: wrap;
     1968  justify-content: flex-start;
     1969  align-items: center;
     1970  gap: 6px 10px;
     1971  margin: 0 0 8px 0;
     1972  width: auto;
     1973  max-width: 100%;
     1974}
     1975
     1976body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action .variation-wrapper {
     1977  display: inline-flex;
     1978  align-items: center;
     1979  justify-content: flex-start;
     1980  gap: 8px;
     1981}
     1982
     1983body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action .reset_variations[style*="hidden"],
     1984body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action .variation-wrapper.reset:has(.reset_variations[style*="hidden"]) {
     1985  display: none !important;
     1986}
     1987
     1988/* Right-align Action column header and controls only when it is the last column */
     1989body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-thead-tag .wpt-tr-tag.wpt_table_head > .wpt-th-tag.wpt_action:last-child {
     1990  text-align: right;
     1991}
     1992
     1993body.wpt_table_body div.wpt_column_sort #wpt_table.wpt-table-tag.wpt_product_table > .wpt-thead-tag > .wpt-tr-tag.wpt_table_head > .wpt-th-tag.wpt_action:last-child {
     1994  padding-right: 28px;
     1995}
     1996
     1997body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child,
     1998body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child p.stock,
     1999body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_message,
     2000body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .item_inside_cell {
     2001  text-align: right;
     2002}
     2003
     2004body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.td_or_cell.wpt_action:last-child > div,
     2005body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.product_type_simple > .wpt-td-tag.wpt_action:last-child > div,
     2006body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.inner-available.wpt_action:last-child,
     2007body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.cart,
     2008body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_varition_section,
     2009body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .variation-wrapper,
     2010body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap .woocommerce-variation-add-to-cart.variations_button {
     2011  justify-content: flex-end;
     2012}
     2013
     2014body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart,
     2015body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap,
     2016body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap .woocommerce-variation.single_variation {
     2017  align-items: flex-end;
     2018}
     2019
     2020body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations,
     2021body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_varition_section {
     2022  margin: 0 0 8px auto;
     2023}
     2024
     2025body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations th,
     2026body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations td {
     2027  text-align: right;
     2028}
     2029
     2030body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations td {
     2031  padding-right: 0;
     2032}
     2033
     2034@media only screen and (max-width: 767px) {
     2035  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child,
     2036  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child p.stock,
     2037  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_message,
     2038  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .item_inside_cell,
     2039  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations th,
     2040  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations td {
     2041    text-align: left;
     2042  }
     2043
     2044  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations,
     2045  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_varition_section {
     2046    margin-left: 0;
     2047  }
     2048
     2049  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.td_or_cell.wpt_action:last-child > div,
     2050  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.product_type_simple > .wpt-td-tag.wpt_action:last-child > div,
     2051  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.inner-available.wpt_action:last-child,
     2052  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.cart,
     2053  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_varition_section,
     2054  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .variation-wrapper,
     2055  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap .woocommerce-variation-add-to-cart.variations_button {
     2056    justify-content: flex-start;
     2057  }
     2058
     2059  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart,
     2060  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap,
     2061  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap .woocommerce-variation.single_variation {
     2062    align-items: flex-start;
     2063  }
     2064}
  • woo-product-table/tags/6.1.6/assets/js/admin.js

    r3522314 r3837744  
    105105
    106106            // Click behavior
    107             $boxesContainer.on('click', '.wpt-custom-select-box', function () {
     107            $boxesContainer.on('click', '.wpt-custom-select-box', function (e) {
     108                e.preventDefault();
     109                e.stopPropagation();
    108110                const $clicked = $(this);
    109111                if ($clicked.hasClass('disabled')) return;
    … …  
    121123(function($) {
    122124    'use strict';
     125
     126    function detect_responsive_stats(){
     127        var detect_responsive = [];
     128        $('body.wpt_admin_body #inside-tablet li.wpt_sortable_peritem.enabled .wpt_shortable_data input.colum_data_input,body.wpt_admin_body #inside-mobile li.wpt_sortable_peritem.enabled .wpt_shortable_data input.colum_data_input').each(function(Index) {
     129            detect_responsive[Index] = 1;
     130        });
     131
     132        var hid_respn_field = $('#hidden_responsive_data');
     133        if( detect_responsive.length > 0 ){
     134            hid_respn_field.val('no_responsive');
     135        }else{
     136            hid_respn_field.val('mobile_responsive');
     137        }
     138    }
     139
    123140    $(document).ready(function() {
    124141        if(! $('body').hasClass('wpt_admin_body')){
    125142            return false;
    126143        }
     144
     145        // Convert select dropdowns to custom buttons immediately to prevent FOUC / layout flash
     146        $('#wpt-main-configuration-form .wpt-form-control select,#wpt_table_footer_possition,#wpt_cf_search_box').customSelect();
     147        configureTabAreaAdded('#wpt-main-configuration-form'); //Specially for Configure Page
     148        configureTabAreaAdded('.fieldwrap.wpt_result_footer.ultraaddons.pro_version'); //From inside on Edit Table
     149
     150        // Restore exact scroll position after saving
     151        var savedScrollY = null;
     152        try {
     153            savedScrollY = sessionStorage.getItem('wpt_saved_scroll_y');
     154        } catch(e) {}
     155        if (savedScrollY !== null) {
     156            if ('scrollRestoration' in history) {
     157                history.scrollRestoration = 'manual';
     158            }
     159            var targetY = parseInt(savedScrollY, 10);
     160            if (!isNaN(targetY)) {
     161                window.scrollTo(0, targetY);
     162                setTimeout(function() {
     163                    window.scrollTo(0, targetY);
     164                }, 50);
     165                setTimeout(function() {
     166                    window.scrollTo(0, targetY);
     167                    try { sessionStorage.removeItem('wpt_saved_scroll_y'); } catch(e) {}
     168                }, 200);
     169            }
     170        }
     171
     172        // Show success notification after saving settings and restoring position
     173        try {
     174            if (sessionStorage.getItem('wpt_just_saved') === 'true') {
     175                sessionStorage.removeItem('wpt_just_saved');
     176                if (typeof WPT_ADMIN_CONTROL !== 'undefined' && typeof WPT_ADMIN_CONTROL.showNotification === 'function') {
     177                    WPT_ADMIN_CONTROL.showNotification('Settings saved successfully!', 'success');
     178                }
     179            }
     180        } catch(e) {}
    127181
    128182        $(document).on('click', '.wpt-offer-notice .notice-dismiss', function () {
    … …  
    230284       
    231285        $(document.body).on('click','a.my-inslide-close-button.button',function(){
    232             $('.inside-column-enabled').fadeOut().removeClass('inside-column-enabled');
     286            $('.inside-column-enabled').fadeOut(150, function(){
     287                $(this).removeClass('inside-column-enabled').css('display', '');
     288            });
    233289        });
    234290        $(document.body).on('click',function(event){
    235291            var inside_item = $('.inside-column-enabled').length;
    236292            if (inside_item > 0 && $(event.target).closest(".wpt_shortable_data").length === 0) {
    237                 $('.inside-column-enabled').fadeOut().removeClass('inside-column-enabled');
    238               }
     293                $('.inside-column-enabled').fadeOut(150, function(){
     294                    $(this).removeClass('inside-column-enabled').css('display', '');
     295                });
     296            }
    239297        });
    240298
    … …  
    327385        //code for Sortable
    328386        $( ".wpt_column_sortable" ).sortable({
    329             handle:'.handle',
     387            handle: '.handle:not(.checkbox_handle)',
     388            axis: 'y',
     389            tolerance: 'pointer',
    330390            stop: removeAjax,
    331391        });
    … …  
    337397       
    338398       
    339         $(document).on('click','.colum_data_input, .wpt-expand',function(){
    340             var parents = $(this).parents('.wpt_shortable_data');
     399        $(document).on('click','.wpt-expand, .extra_all_on_off',function(e){
     400            e.preventDefault();
     401            var parents = $(this).closest('.wpt_shortable_data');
     402            var li = $(this).closest('li.wpt_sortable_peritem');
    341403            var onOff = parents.children('.extra_all_on_off');
     404            var wptExpand = parents.children('.wpt-expand');
    342405            var extras = parents.children('.wpt_column_setting_extra');
    343             extras.toggle('medium',function(){
    344                 var status = $(this).attr('data-status');
    345                 if(status == 'expanded'){
    346                     onOff.removeClass('off_now');
    347                     onOff.addClass('on_now');
    348                     onOff.html("Expand");
    349                     onOff.attr('data-status','expanded');
    350                     extras.parents('li').removeClass('expanded_li');
    351                     $(this).attr('data-status','collapsed');
    352                 }else{
    353                    
    354                     onOff.removeClass('on_now');
    355                     onOff.addClass('off_now');
    356                     onOff.html("Collapse");
    357                     onOff.attr('data-status','collapsed');
    358                     extras.parents('li').addClass('expanded_li');
    359                     $(this).attr('data-status','expanded');
    360                 }
    361                
    362             });
     406            var isExpanded = li.hasClass('expanded_li');
     407
     408            if(isExpanded){
     409                li.removeClass('expanded_li');
     410                onOff.removeClass('off_now').addClass('on_now').html("Expand").attr('data-status','collapsed');
     411                wptExpand.html('<i class="wpt-expand-collapse"></i>Expand');
     412                extras.attr('data-status','collapsed');
     413            }else{
     414                li.addClass('expanded_li');
     415                onOff.removeClass('on_now').addClass('off_now').html("Collapse").attr('data-status','expanded');
     416                wptExpand.html('<i class="wpt-expand-collapse"></i>Collapse');
     417                extras.attr('data-status','expanded');
     418            }
    363419        });
    364420       
    … …  
    393449           
    394450        }
    395         $(document).on('click','span.extra_all_on_off',function(){
    396             var key = $(this).data('key');
    397             var thisExpand = $(this);
    398             $('.wpt_column_setting_extra.extra_all_' + key).toggle('medium',function(){
    399                 var status = thisExpand.attr('data-status');
    400                 if(status == 'expanded'){
    401                     thisExpand.removeClass('off_now');
    402                     thisExpand.addClass('on_now');
    403                     thisExpand.parents('li').removeClass('expanded_li');
    404                     thisExpand.html("Expand");
    405                     thisExpand.attr('data-status','collapsed');
    406                 }else{
    407                     thisExpand.removeClass('on_now');
    408                     thisExpand.addClass('off_now');
    409                     thisExpand.parents('li').addClass('expanded_li');
    410                     thisExpand.html("Collapse");
    411                     thisExpand.attr('data-status','expanded');
    412                 }
    413                
    414                
    415                
    416             });
    417            
    418         });
     451
    419452        $(document).on('click','ul#wpt_column_sortable>li.wpt_sortable_peritem.enabled .wpt_column_arrow',function(){
    420453            var target = $(this).attr('data-target');
    … …  
    466499        if (tabName && selectTabContent.length > 0) {
    467500            var currentTab = $('body.wpt_admin_body #wpt_configuration_form #' + tabName);
    468             if( ! currentTab.hasClass('tab-content-active')){
    469                 removingActiveClass();
    470                 currentTab.addClass('tab-content-active');
    471                 $('body.wpt_admin_body #wpt_configuration_form .nav-tab-wrapper a.wpt_nav_tab.wpt_nav_for_' + tabName).addClass('nav-tab-active');
    472             }
    473            
     501            if (currentTab.length > 0 && currentTab.hasClass('wpt_tab_content')) {
     502                if (!currentTab.hasClass('tab-content-active')) {
     503                    removingActiveClass();
     504                    currentTab.addClass('tab-content-active');
     505                    $('body.wpt_admin_body #wpt_configuration_form .nav-tab-wrapper a.wpt_nav_tab.wpt_nav_for_' + tabName).addClass('nav-tab-active');
     506                }
     507            }
     508        }
     509        if (selectTabContent.length > 0 && selectTabContent.filter('.tab-content-active').length === 0) {
     510            removingActiveClass();
     511            selectLinkTab.first().addClass('nav-tab-active');
     512            selectTabContent.first().addClass('tab-content-active');
    474513        }
    475514       
    … …  
    655694                });
    656695                $('.switch-enable-item-' + keyword).removeClass('item-enabled');
    657                 targetLiSelector.fadeOut(function(){
    658                     targetLiSelector.removeClass('enabled');
    659                 });
     696                if (targetLiSelector.hasClass('wpt-custom-column-item') || targetLiSelector.find('span.wpt_column_cross').length > 0) {
     697                    targetLiSelector.fadeOut('fast', function(){
     698                        $(this).remove();
     699                        detect_responsive_stats();
     700                    });
     701                } else {
     702                    targetLiSelector.fadeOut(function(){
     703                        targetLiSelector.removeClass('enabled');
     704                    });
     705                }
    660706            }
    661707            OptimizeColumnWithName();
    … …  
    672718
    673719            $mainWrapper.find('.wpt-col-selected-pre-value').html(enabledItemsText);
     720            syncPresetModalState($mainWrapper.find('.wpt-dropdown-container'));
    674721        });
    675722       
    676723        detect_responsive_stats();
    677         function detect_responsive_stats(){
    678             var detect_responsive;
    679             detect_responsive = [];
    680             $('body.wpt_admin_body #inside-tablet li.wpt_sortable_peritem.enabled .wpt_shortable_data input.colum_data_input,body.wpt_admin_body #inside-mobile li.wpt_sortable_peritem.enabled .wpt_shortable_data input.colum_data_input').each(function(Index) {
    681                 detect_responsive[Index] = 1;
    682             });
    683 
    684             var hid_respn_field = $('#hidden_responsive_data');
    685             if( detect_responsive.length > 0 ){
    686                 hid_respn_field.val('no_responsive');
    687             }else{
    688                 hid_respn_field.val('mobile_responsive');
    689             }
    690         }
    691724        /**
    692725         * For Hide on Mobile
    … …  
    722755            keyword = taxt_cf_type + taxt_cf_input;
    723756           
    724             html = '<li class="wpt_sortable_peritem column_keyword_' + keyword + ' enabled">';
     757            html = '<li class="wpt_sortable_peritem wpt-custom-column-item column_keyword_' + keyword + ' enabled">';
    725758                html += '<span title="Move Handle" class="handle ui-sortable-handle"></span>';
    726759                html += '<div class="wpt_shortable_data">';
    727760                    html += '<input name="column_array[' + keyword + ']" data-column_title="' + taxt_cf_title + '" data-keyword="' + keyword + '" class="colum_data_input product_id" type="text" value="' + taxt_cf_title + '">';
    728                     html += "<span class='wpt_column_cross'>X</span>";
    729761                html += '</div>';
    730762                html += '<span title="Move Handle" class="handle checkbox_handle ui-sortable-handle">';
    … …  
    753785        $('.wpt-design-tab-area-wrapper td select,.wpt_column select').customSelect();
    754786
    755         $(document.body).on('click','.wpt-custom-select-box', function() {
     787        $(document.body).on('click','.wpt-custom-select-box', function(e) {
     788            e.preventDefault();
    756789            if ($(this).hasClass('disabled')) return;
    757790            var wrapper = $(this).closest('.custom-select-box-wrapper');
    … …  
    806839
    807840            var html = '';
    808             html = '<li class="wpt_sortable_peritem column_keyword_' + keyword + ' enabled">';
     841            html = '<li class="wpt_sortable_peritem wpt-custom-column-item column_keyword_' + keyword + ' enabled">';
    809842                html += '<span title="Move Handle" class="handle ui-sortable-handle"></span>';
    810843                html += '<input type="hidden" name="column_settings' + device + '[' + keyword + '][type]" value="' + type + '">';
    … …  
    813846                    html += '<input name="column_array' + device + '[' + keyword + ']" data-column_title="' + label + '" data-keyword="' + keyword + '" class="colum_data_input ' + keyword + '" type="text" value="' + label + '">';
    814847                    html += '<span class="wpt_colunm_type">' + type_name_show + keyword + '</span>';
    815                     html += "<span class='wpt_column_cross'>X</span>";
    816848                html += '</div>';
    817849                html += '<span title="Move Handle" class="handle checkbox_handle ui-sortable-handle">';
    … …  
    837869                $('.and_new_column_label').val('');
    838870                $('.add_new_column_type_select').val('');
    839                 // return;
    840                 $('body.wpt_admin_body input#publish[name=save]').trigger('click');
     871                $('.add-new-custom-column-wrapper').addClass('wpt-default-hide').removeAttr('style');
     872                triggerTableFormSave();
    841873            }
    842874            return;
    … …  
    845877        });
    846878        $(document.body).on('change','#wpt_advance_search_taxonomy_choose',function(){
     879            $('.button,button').removeClass('wpt_ajax_update');
    847880            $('.wpt_astaxonomy_choose_notice').html('Submitting...');
    848881            WPT_ADMIN_CONTROL.showNotification('Submitting...', 'info');
    849             $('body.wpt_admin_body input#publish[name=save]').trigger('click');
    850         });
     882            triggerTableFormSave();
     883        });
     884
     885        function triggerTableFormSave(){
     886            var $saveBtn = $('#wpt_configuration_form .form_bottom.form_bottom_submit_button button[name="wpt_post_submit"], body.wpt_admin_body input#publish[name=save]').first();
     887            if($saveBtn.length > 0){
     888                $saveBtn.trigger('click');
     889            }
     890        }
     891
    851892        /**
    852893         * Data Save by Ctrl + S
    … …  
    854895        $(window).bind('keydown', function(event) {
    855896            if (event.ctrlKey || event.metaKey) {
    856                 if($('.form_bottom.form_bottom_submit_button').hasClass('wrapper_wpt_ajax_update') && String.fromCharCode(event.which).toLowerCase() === 's' ){
    857 
     897                if($('#wpt_configuration_form .form_bottom.form_bottom_submit_button button[name="wpt_post_submit"]').length > 0 && String.fromCharCode(event.which).toLowerCase() === 's' ){
    858898                    event.preventDefault();
    859                     $('body.wpt_admin_body input#publish[name=save]').trigger('click');
     899                    triggerTableFormSave();
    860900                }
    861901            }
    … …  
    884924            detect_responsive_stats();
    885925           
     926            $('.wpt_notify h1').html('Saving...');
    886927            $('.wpt_notify').css('display','block');
    887928           
    888             var 
    889             old_title   = $('button.button.wpt_ajax_update').attr('data-title'),
    890             new_title       = $('#title').val();
     929            var
     930            old_title   = $(this).attr('data-title'),
     931            new_title   = $('#title').val();
    891932           
    892933            if( old_title === new_title ){
    … …  
    903944            var data = $('form#post').serializeArray();
    904945            //Set a trigger for our save_post action
    905             data.push({wpt_ajax_save: true});
     946            data.push({name: 'wpt_ajax_save', value: 'true'});
    906947
    907948
    908949            //The XHR Goodness
    909950            $.post(postURL, data, function(response){}).done(function(){
     951                $(window).off('beforeunload.edit-post');
     952                if (typeof wp !== 'undefined' && wp.autosave && wp.autosave.server) {
     953                    wp.autosave.server.suspend();
     954                }
    910955                $('.wpt_notify h1').html('Saved Product Table');
    911956                $('.wpt_notify').fadeOut();
    … …  
    916961            return false;
    917962
     963        });
     964
     965        // Handle standard post submit when saving via custom Save button (without WP #submitdiv)
     966        $(document).on('submit', 'body.post-type-wpt_product_table form#post', function(e){
     967            if (e.isDefaultPrevented()) {
     968                return;
     969            }
     970            detect_responsive_stats();
     971
     972            if (typeof wp !== 'undefined' && wp.autosave && wp.autosave.server) {
     973                wp.autosave.server.suspend();
     974            }
     975            $(window).off('beforeunload.edit-post');
     976
     977            var origStatus = $('#original_post_status').val();
     978            if (origStatus === 'auto-draft' && window.history && window.history.replaceState) {
     979                var loc = window.location.href;
     980                if (loc.indexOf('wp-post-new-reload=true') === -1) {
     981                    loc += (loc.indexOf('?') !== -1) ? '&' : '?';
     982                    loc += 'wp-post-new-reload=true';
     983                    window.history.replaceState(null, null, loc);
     984                }
     985            }
     986
     987            try {
     988                sessionStorage.setItem('wpt_just_saved', 'true');
     989                if (origStatus === 'publish') {
     990                    var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     991                    sessionStorage.setItem('wpt_saved_scroll_y', y);
     992                }
     993            } catch(err) {}
     994
     995            if (typeof WPT_ADMIN_CONTROL !== 'undefined' && typeof WPT_ADMIN_CONTROL.showNotification === 'function') {
     996                WPT_ADMIN_CONTROL.showNotification('Saving .... !', 'success');
     997            }
    918998        });
    919999       
    … …  
    10141094
    10151095    $(document.body).on('submit', 'form#wpt-main-configuration-form', function (e){
     1096        try {
     1097            var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     1098            sessionStorage.setItem('wpt_saved_scroll_y', y);
     1099            sessionStorage.setItem('wpt_just_saved', 'true');
     1100        } catch(err) {}
    10161101
    10171102        let submitBtn = $(this).find('button.configure_submit');
    … …  
    10221107        // submitBtnIcon.attr('class', 'wpt-floppy');
    10231108        WPT_ADMIN_CONTROL.showNotification('Saving .... !', 'success');
     1109    });
     1110
     1111    $(document.body).on('click', 'button.configure_submit, .configure_submit', function (e){
     1112        try {
     1113            var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     1114            sessionStorage.setItem('wpt_saved_scroll_y', y);
     1115            sessionStorage.setItem('wpt_just_saved', 'true');
     1116        } catch(err) {}
    10241117    });
    10251118
    … …  
    10391132    if( colSetsLen > 0 ){
    10401133
    1041         var saveChangeText = 'Save';
    1042         var btnHtml = '<div class="">';
    1043         btnHtml += '<button type="submit" name="configure_submit" class="float-btn wpt-btn wpt-has-icon configure_submit"><span><i class="wpt-floppy"></i></span><strong>' + saveChangeText + '</strong></button>';
    1044         btnHtml += '</div>';
    1045 
    1046         $('#wpt-main-configuration-form').append(btnHtml);
    1047 
    10481134        $(window).on('scroll',function(){
    10491135
    1050             let targetElement = $('.float-btn');
    10511136            let topbarElement = $('div.wpt-header.wpt-clearfix');
    1052             // if(targetElement.length < 1) return;
    1053            
    1054             let bodyHeight = $('#wpbody').height();
    10551137            let scrollTop = $(this).scrollTop();
    1056             let screenHeight = $(this).height();
    10571138   
    10581139            let configFormElement = $('form#wpt-main-configuration-form');
    10591140            if(configFormElement.length < 1) return;
    10601141   
    1061             let conPass = bodyHeight - screenHeight - 100 - targetElement.height();
    1062             let leftWill = configFormElement.width() - targetElement.width() - 20;
    1063            
    1064             if(scrollTop < conPass){
    1065                 targetElement.addClass('stick_on_scroll-on');
    1066             }else{
    1067                 targetElement.removeClass('stick_on_scroll-on');
    1068             }
    10691142            if(scrollTop > 90){
    10701143                configFormElement.addClass('topbar-fixed-on-scroll-main-element');
    … …  
    10741147                topbarElement.removeClass('topbar-fixed-on-scroll');
    10751148            }
    1076             if(scrollTop > 100 && colSetsLen > 0){
    1077                 targetElement.attr('id','stick_on_scroll-on');
    1078             }else if(colSetsLen > 0){
    1079                 targetElement.removeAttr('id');
    1080             }
    1081            
    1082    
    10831149        });
    10841150
    … …  
    10861152   
    10871153
    1088     var postColSetsLen = $('#column_settings').length;
    1089 
    10901154    /**
    1091      * This is for Product Table post Edit and Add new page.
    1092      * actually for configure page and post edit page,
    1093      * we did it separately.
    1094      * Here for Product Table edit, and for configure page, we did it at the up of this comment.
     1155     * Product Table post Edit and Add New page save bar now uses
     1156     * CSS sticky positioning (.form_bottom.form_bottom_submit_button)
     1157     * so no duplicate .stick_on_scroll button injection is needed.
    10951158     */
    1096    
    1097     var status = $('#original_post_status').val();
    1098 
    1099     if( postColSetsLen > 0 && status === 'publish'){
    1100         var saveChangeText = $('button.button[name="wpt_post_submit"]').text(); //Save Change
    1101         var myHtml = '<div class="wrapper_wpt_ajax_update ultraaddons-button-wrapper">';
    1102         myHtml += '<button type="submit" name="wpt_post_submit" data-title="hello" class="stick_on_scroll button-primary button-primary primary button wpt_ajax_update">'+ saveChangeText +'</button>';
    1103         myHtml += '</div>';
    1104         $('#wpt_configuration_form').append(myHtml);
    1105         $(window).on('scroll',function(){
    1106 
    1107             let targetElement = $('.stick_on_scroll');
    1108             if(targetElement.length < 1) return;
    1109            
    1110            
    1111             let bodyHeight = $('#wpbody').height();
    1112             let scrollTop = $(this).scrollTop();
    1113             let screenHeight = $(this).height();
    1114    
    1115             let configFormElement = $('#wpt_configuration_form');
    1116             if(configFormElement.length < 1) return;
    1117    
    1118             let conPass = bodyHeight - screenHeight - 300 - targetElement.height();
    1119             let leftWill = configFormElement.width() - targetElement.width() - 20;
    1120            
    1121    
    1122             targetElement.css({
    1123                 left: leftWill,
    1124                 right: 'unset'
    1125             });
    1126             if(scrollTop < conPass){
    1127                 targetElement.attr('id','stick_on_scroll-on');
    1128             }else{
    1129                 targetElement.removeAttr('id');
    1130             }
    1131 
    1132             if(scrollTop > 100 && postColSetsLen > 0){
    1133                 targetElement.attr('id','stick_on_scroll-on');
    1134             }else if(postColSetsLen > 0){
    1135                 targetElement.removeAttr('id');
    1136             }
    1137            
    1138    
    1139         });
    1140 
    1141 
    1142     }
    11431159   
    11441160
    … …  
    11471163     * Tab Area Handle
    11481164     */
    1149     configureTabAreaAdded('#wpt-main-configuration-form'); //Specially for Configure Page
    1150     configureTabAreaAdded('.fieldwrap.wpt_result_footer.ultraaddons.pro_version'); //From inside on Edit Table
    11511165    function configureTabAreaAdded( mainSelector = '#wpt-main-configuration-form' ){
    11521166        var tabSerial = 0;
    11531167        var tabArray = new Array();
    1154         var tabHtml = ""
     1168        var tabHtml = "";
    11551169        var tabArea = $(mainSelector + ' .wpt-configure-tab-wrapper');
    11561170        if(tabArea.length < 1){
    … …  
    11581172            tabArea = $(mainSelector + ' .wpt-configure-tab-wrapper');
    11591173        }
    1160         var sectionPanel = $(mainSelector + ' div.wpt-section-panel');
     1174        var sectionPanel = $(mainSelector + ' div.wpt-section-panel').not('.wpt-configure-tab-wrapper').not('.wpt-full-form-submit-wrapper');
     1175        if(sectionPanel.length === 0) return;
     1176
     1177        var isMainConfigPage = (mainSelector === '#wpt-main-configuration-form');
     1178        var savedTab = '';
     1179        if (isMainConfigPage) {
     1180            try {
     1181                savedTab = localStorage.getItem('wpt_active_config_tab') || '';
     1182            } catch (e) {}
     1183        }
     1184
     1185        var currentHash = window.location.hash;
     1186        var targetHash = (currentHash && $(mainSelector + ' ' + currentHash).length > 0) || (isMainConfigPage && currentHash === '#show-all')
     1187            ? currentHash
     1188            : savedTab;
     1189        var hasValidHash = targetHash && ((isMainConfigPage && targetHash === '#show-all') || $(mainSelector + ' ' + targetHash).length > 0);
     1190        var activeTarget = hasValidHash ? targetHash : '';
     1191
     1192        if (isMainConfigPage && activeTarget && !currentHash) {
     1193            try {
     1194                history.replaceState(null, null, activeTarget);
     1195            } catch (e) {}
     1196        }
     1197
    11611198        sectionPanel.each(function(index, content){
    1162            
    11631199            let table = $(this).find('table');
    11641200            let tableCount = table.length;
    11651201            if(tableCount > 0){
    1166                
    11671202                let firstTable = table.first();
    11681203                let tableId = $(this).attr('id');
    1169                 let tableTitle = firstTable.find('thead tr th:first-child h3').text();
     1204                let tableTitle = firstTable.find('thead tr th:first-child h3').text().trim();
    11701205                tabArray[tableId] = tableTitle;
    11711206
    1172                 if(tabSerial !== 0){
    1173                     $(this).hide();
    1174                     tabHtml += "<a href='#" + tableId + "' class='tab-button wpt-button link-" + tableId + "'>" + tableTitle + "</a>"
    1175                 }else{
    1176                     $(this).addClass('active');
    1177                     tabHtml += "<a href='#" + tableId + "' class='tab-button wpt-button link-" + tableId + " active'>" + tableTitle + "</a>"
     1207                let isThisActive = false;
     1208                if(activeTarget === '#show-all'){
     1209                    isThisActive = false;
     1210                } else if(activeTarget !== ''){
     1211                    isThisActive = ('#' + tableId === activeTarget);
     1212                } else {
     1213                    isThisActive = (tabSerial === 0);
     1214                }
     1215
     1216                if(isThisActive || activeTarget === '#show-all'){
     1217                    $(this).show().addClass('active');
     1218                    tabHtml += "<a href='#" + tableId + "' class='tab-button wpt-button link-" + tableId + (isThisActive ? " active" : "") + "'>" + tableTitle + "</a>";
     1219                } else {
     1220                    $(this).hide().removeClass('active');
     1221                    tabHtml += "<a href='#" + tableId + "' class='tab-button wpt-button link-" + tableId + "'>" + tableTitle + "</a>";
    11781222                }
    11791223
    11801224                tabSerial++;
    1181 
    1182             }
    1183            
    1184         });
     1225            }
     1226        });
     1227
    11851228        if(tabSerial > 1){
    1186             tabHtml += "<a href='#show-all' class='tab-button wpt-button'>Show All</a>";
     1229            let isShowAllActive = (activeTarget === '#show-all');
     1230            tabHtml += "<a href='#show-all' class='tab-button wpt-button" + (isShowAllActive ? " active" : "") + "'>Show All</a>";
    11871231            tabArea.html(tabHtml);
    11881232        }
    1189        
    1190         $(document.body).on('click','.wpt-configure-tab-wrapper a.tab-button',function(e){
     1233
     1234        if(activeTarget === '#show-all'){
     1235            sectionPanel.show().addClass('active');
     1236        }
     1237
     1238        // Clean up instant style once jQuery states are fully applied
     1239        $('#wpt-instant-tab-css').remove();
     1240
     1241        var savedScrollY = null;
     1242        try { savedScrollY = sessionStorage.getItem('wpt_saved_scroll_y'); } catch(e){}
     1243        if (savedScrollY !== null) {
     1244            var targetY = parseInt(savedScrollY, 10);
     1245            if (!isNaN(targetY)) {
     1246                window.scrollTo(0, targetY);
     1247            }
     1248        }
     1249
     1250        $(document.body).off('click', mainSelector + ' .wpt-configure-tab-wrapper a.tab-button').on('click', mainSelector + ' .wpt-configure-tab-wrapper a.tab-button', function(e){
    11911251            e.preventDefault();
    1192             $('.wpt-configure-tab-wrapper a').removeClass('active');
     1252            $(mainSelector + ' .wpt-configure-tab-wrapper a').removeClass('active');
    11931253            $(this).addClass('active');
    1194             $(mainSelector + ' div.wpt-section-panel.active').hide();
    11951254            let target = $(this).attr('href');
    1196             if(target == '#show-all'){
    1197                 sectionPanel.fadeIn();
    1198 
     1255
     1256            if (isMainConfigPage) {
     1257                try {
     1258                    localStorage.setItem('wpt_active_config_tab', target);
     1259                } catch (e) {}
     1260            }
     1261
     1262            if(target === '#show-all'){
     1263                sectionPanel.show().addClass('active');
    11991264            }else{
    1200                 $(mainSelector + ' ' + target).fadeIn().addClass('active');
    1201             }
    1202            
    1203 
    1204             //Address replace
    1205             var currentUrl = new URL(window.location.href);
    1206             currentUrl.hash = target;
    1207             history.replaceState(null, null, currentUrl);
    1208            
    1209         });
    1210 
    1211         var tabName = window.location.hash;
    1212 
    1213         setTimeout(function(){
    1214             if(sectionPanel.length > 0 && tabName.length > 0){
    1215                 $(mainSelector + ' .wpt-configure-tab-wrapper a.tab-button').removeClass('active');
    1216                 $(mainSelector + ' .wpt-configure-tab-wrapper a[href="' + tabName + '"]').addClass('active');
    1217                
    1218                 if(tabName == '#show-all'){
    1219                     sectionPanel.fadeIn();
    1220                     return;
    1221                 }
    1222                 $(mainSelector + ' .wpt-section-panel').not('.wpt-configure-tab-wrapper').hide().removeClass('active');
    1223 
    1224                 $(mainSelector + ' ' + tabName).show().addClass('active');
    1225             }
    1226         },100);
     1265                sectionPanel.not(target).hide().removeClass('active');
     1266                $(mainSelector + ' ' + target).show().addClass('active');
     1267            }
     1268
     1269            // Ensure submit buttons remain visible
     1270            $(mainSelector + ' .wpt-full-form-submit-wrapper').show();
     1271
     1272            if (isMainConfigPage) {
     1273                // Address replace
     1274                try {
     1275                    history.replaceState(null, null, target);
     1276                } catch (e) {
     1277                    window.location.hash = target;
     1278                }
     1279
     1280                // Preserve active tab on form submit
     1281                $(mainSelector).attr('action', target);
     1282            }
     1283        });
    12271284    }
    12281285
    … …  
    14121469   
    14131470   
    1414     $(document.body).on('click','.wpt-add-preset-column', function(e) {
    1415         e.preventDefault();
    1416         var $button = $(this);
    1417         var $mainWrapper = $button.closest('.add_new_column_main_wrapper');
    1418         var $dropdownContainer = $mainWrapper.find('.wpt-dropdown-container');
    1419         $dropdownContainer.toggle(); // show/hide dropdown
    1420          
    1421     });
    1422     $(document.body).on('click','.wpt-add-new-custom-column-btn', function(e) {
    1423         e.preventDefault();
    1424         var $button = $(this);
    1425         var $mainWrapper = $button.closest('.add_new_column_main_wrapper');
    1426         var $_device = $mainWrapper.data('device'); 
    1427         $('.add_new_col_wrapper').attr('data-device', $_device);
    1428         $('.add-new-custom-column-wrapper').toggleClass('wpt-default-hide'); // show/hide dropdown
    1429         $dropdownContainer.hide(); 
    1430     });
     1471        /**
     1472         * Spotlight Preset Modal & Split Custom Column Studio Helpers
     1473         */
     1474        function syncPresetModalState($container) {
     1475            if (!$container || $container.length < 1) {
     1476                return;
     1477            }
     1478            var $items = $container.find('.wpt-dropdown-list > li.switch-enable-item');
     1479            var $enabled = $items.filter('.item-enabled');
     1480
     1481            // Update left category rail counts
     1482            $container.find('.wpt-rail-btn').each(function() {
     1483                var $btn = $(this);
     1484                var filter = $btn.data('filter');
     1485                var count = 0;
     1486                if (filter === 'all') {
     1487                    count = $items.length;
     1488                } else if (filter === 'premium') {
     1489                    count = $items.filter('.premium').length;
     1490                } else {
     1491                    count = $items.filter('[data-category="' + filter + '"]').length;
     1492                }
     1493                $btn.find('.wpt-rail-count').text(count);
     1494            });
     1495
     1496            // Sync active columns chip ribbon safely via DOM text nodes
     1497            var $chipsWrap = $container.find('.wpt-preset-active-chips');
     1498            $chipsWrap.empty();
     1499            if ($enabled.length === 0) {
     1500                $chipsWrap.append($('<span class="wpt-active-strip-empty"></span>').text('None selected yet'));
     1501            } else {
     1502                $enabled.each(function() {
     1503                    var $item = $(this);
     1504                    var kw = $item.data('column_keyword');
     1505                    var label = $item.attr('data-label') || $item.find('.wpt-preset-card-title').text() || kw;
     1506                    var $chip = $('<button type="button" class="wpt-active-chip"></button>').attr('data-keyword', kw);
     1507                    $chip.append($('<span></span>').text(label));
     1508                    $chip.append($('<span class="wpt-chip-x" aria-hidden="true">&times;</span>'));
     1509                    $chipsWrap.append($chip);
     1510                });
     1511            }
     1512
     1513            var visibleCount = $items.not('.wpt-filter-hidden').length;
     1514            $container.find('.wpt-spotlight-summary').text(visibleCount + ' columns shown · ' + $enabled.length + ' active');
     1515        }
     1516
     1517        function filterPresetModalList($container) {
     1518            if (!$container || $container.length < 1) {
     1519                return;
     1520            }
     1521            var searchTerm = ($container.find('.wpt-column-search-box').val() || '').toLowerCase().trim();
     1522            var activeFilter = $container.find('.wpt-rail-btn.active').data('filter') || 'all';
     1523            var $dropdownLi = $container.find('.wpt-dropdown-list > li.switch-enable-item');
     1524            var visibleCount = 0;
     1525
     1526            $dropdownLi.each(function() {
     1527                var $li = $(this);
     1528                var text = $li.text().toLowerCase();
     1529                var character = String($li.data('character') || '').toLowerCase();
     1530                var matchesSearch = !searchTerm || text.indexOf(searchTerm) > -1 || character.indexOf(searchTerm) > -1;
     1531                var matchesCat = true;
     1532
     1533                if (activeFilter === 'premium') {
     1534                    matchesCat = $li.hasClass('premium');
     1535                } else if (activeFilter !== 'all') {
     1536                    matchesCat = ($li.attr('data-category') === activeFilter);
     1537                }
     1538
     1539                if (matchesSearch && matchesCat) {
     1540                    $li.removeClass('wpt-filter-hidden').show();
     1541                    visibleCount++;
     1542                } else {
     1543                    $li.addClass('wpt-filter-hidden').hide();
     1544                }
     1545            });
     1546
     1547            $container.find('.wpt-preset-empty').toggle(visibleCount === 0);
     1548            var enabledCount = $dropdownLi.filter('.item-enabled').length;
     1549            $container.find('.wpt-spotlight-summary').text(visibleCount + ' columns shown · ' + enabledCount + ' active');
     1550        }
     1551
     1552        function syncCustomTypeBanner() {
     1553            var $modal = $('.add_new_col_wrapper');
     1554            if ($modal.length < 1) {
     1555                return;
     1556            }
     1557            var $active = $modal.find('.wpt-custom-select-box.active').first();
     1558            if ($active.length < 1) {
     1559                return;
     1560            }
     1561            var title = $active.text().trim();
     1562            var desc = $active.attr('data-desc') || '';
     1563            var ph = $active.attr('data-ph') || 'column_keyword';
     1564            var doc = $active.attr('data-doc') || 'https://wooproducttable.com/docs/doc/table-options/add-new-custom-column-in-woo-product-table/';
     1565
     1566            $('#wpt-twin-type-title').text(title);
     1567            $('#wpt-twin-type-desc').text(desc);
     1568            $('#wpt-twin-type-doc').attr('href', doc);
     1569            $('#wpt-new-col-key').attr('placeholder', 'e.g. ' + ph);
     1570        }
     1571
     1572        // Open Preset Column Spotlight Modal
     1573        $(document.body).on('click','.wpt-add-preset-column', function(e) {
     1574            e.preventDefault();
     1575            var $button = $(this);
     1576            var $mainWrapper = $button.closest('.add_new_column_main_wrapper');
     1577            var $targetContainer = $mainWrapper.find('.wpt-dropdown-container');
     1578            $targetContainer.toggle();
     1579            if ($targetContainer.is(':visible')) {
     1580                syncPresetModalState($targetContainer);
     1581                filterPresetModalList($targetContainer);
     1582                $targetContainer.find('.wpt-column-search-box').trigger('focus');
     1583            }
     1584        });
     1585
     1586        // Open Custom Column Twin Left-Rail Modal
     1587        $(document.body).on('click','.wpt-add-new-custom-column-btn', function(e) {
     1588            e.preventDefault();
     1589            var $button = $(this);
     1590            var $mainWrapper = $button.closest('.add_new_column_main_wrapper');
     1591            var $_device = $mainWrapper.data('device') || '';
     1592            var deviceLabel = 'Default (All Device)';
     1593            if ($_device === '_tablet') {
     1594                deviceLabel = 'Tablet';
     1595            } else if ($_device === '_mobile') {
     1596                deviceLabel = 'Mobile';
     1597            }
     1598            $('.add_new_col_wrapper').attr('data-device', $_device);
     1599            $('#wpt-custom-device-label').text(deviceLabel);
     1600            $('.add-new-custom-column-wrapper').toggleClass('wpt-default-hide');
     1601            $dropdownContainer.hide();
     1602            syncCustomTypeBanner();
     1603            if (!$('.add-new-custom-column-wrapper').hasClass('wpt-default-hide')) {
     1604                $('.add_new_col_wrapper .and_new_column_label').trigger('focus');
     1605            }
     1606        });
     1607
     1608        $(document).on('change', '.add_new_col_wrapper #selected_column_type', syncCustomTypeBanner);
     1609
     1610        // Category rail & active chip clicks inside Preset Spotlight Modal
     1611        $(document).on('click', '.wpt-rail-btn', function(e) {
     1612            e.preventDefault();
     1613            e.stopPropagation();
     1614            var $btn = $(this);
     1615            var $container = $btn.closest('.wpt-dropdown-container');
     1616            $container.find('.wpt-rail-btn').removeClass('active');
     1617            $btn.addClass('active');
     1618            filterPresetModalList($container);
     1619        });
     1620
     1621        $(document).on('click', '.wpt-active-chip', function(e) {
     1622            e.preventDefault();
     1623            e.stopPropagation();
     1624            var kw = $(this).attr('data-keyword');
     1625            var $container = $(this).closest('.wpt-dropdown-container');
     1626            $container.find('.wpt-dropdown-list > li.switch-enable-item[data-column_keyword="' + kw + '"]').trigger('click');
     1627        });
    14311628
    14321629    function findOnlyText(Element){
    … …  
    14911688        });
    14921689    });
    1493     // Search filter 
    1494     $('.wpt-column-search-box').on('input', function() {
    1495         var searchTerm = $(this).val().toLowerCase();
    1496         var $dropdown_li = $(this).closest('.wpt-dropdown-container').find('.wpt-dropdown-list li');
    1497         $dropdown_li.each(function() {
    1498             var text = $(this).text().toLowerCase();
    1499             var character = $(this).data('character').toLowerCase();
    1500             if (text.indexOf(searchTerm) > -1 || character.indexOf(searchTerm) > -1) {
    1501                 $(this).show();
    1502             } else {
    1503                 $(this).hide();
    1504             }
    1505         });
    1506     });
    1507 
    1508     // When an item is selected
     1690    // Search filter inside Preset Spotlight modal
     1691    $(document).on('input', '.wpt-column-search-box', function() {
     1692        filterPresetModalList($(this).closest('.wpt-dropdown-container'));
     1693    });
     1694
     1695    // When a preset item is clicked
    15091696    $(document).on('click', '.wpt-dropdown-list li', function() {
    15101697        if ($(this).hasClass('premium')) {return;}
    1511         var selectedKeyword = $(this).data('column_keyword');
    1512 
    1513         if ($(this).hasClass('item-enabled')) {
    1514 
    1515             // e.g., remove from active list, update UI, etc.
    1516             $(this).removeClass('item-enabled');
    1517         } else {
    1518             $(this).addClass('item-enabled');
    1519         }
    1520 
    1521         var $mainWrapper = $(this).closest('.inside-column-settings-wrapper .inside_tab_content.tab-content.tab-content-active');
    1522         var $listWrapper = $(this).closest('.wpt-dropdown-list');
    1523         // Get all enabled items in the dropdown
     1698        var $item = $(this);
     1699        var selectedKeyword = $item.data('column_keyword');
     1700        var $tabContent = $item.closest('.tab-content');
     1701        var $targetCheckbox = $tabContent.find('.wpt_column_sortable li.wpt_sortable_peritem input.checkbox_handle_input[data-column_keyword="' + selectedKeyword + '"]');
     1702        var isDesktopMinLocked = ($tabContent.attr('id') === 'inside-desktop')
     1703            && $item.hasClass('item-enabled')
     1704            && $tabContent.find('.wpt_column_sortable li.wpt_sortable_peritem.enabled').length < 2;
     1705
     1706        if (!isDesktopMinLocked) {
     1707            $item.toggleClass('item-enabled');
     1708        }
     1709
     1710        var $mainWrapper = $item.closest('.inside-column-settings-wrapper .inside_tab_content.tab-content.tab-content-active');
     1711        var $listWrapper = $item.closest('.wpt-dropdown-list');
    15241712        var $enabledItems = $listWrapper.find('li.item-enabled');
    1525        
    1526         // Get text values of enabled items in one line
    15271713        var enabledItemsText = $enabledItems.map(function() {
    15281714            return $(this).data('column_keyword');
    … …  
    15301716
    15311717        $mainWrapper.find('.wpt-col-selected-pre-value').html(enabledItemsText);
    1532        
    1533         $(this).closest('.tab-content').find('.wpt_column_sortable li.wpt_sortable_peritem input.checkbox_handle_input[data-column_keyword="' + selectedKeyword + '"]').trigger('click');
    1534 
    1535     });
    1536 
    1537    
    1538     // Click outside to close dropdown
     1718        $targetCheckbox.trigger('click');
     1719        syncPresetModalState($item.closest('.wpt-dropdown-container'));
     1720    });
     1721
     1722    // Click outside or Close / Done / Cancel buttons to close modals
     1723    $(document).on('click', '.wpt-dropdown-container .wpt-modal-close-btn, .wpt-dropdown-container .wpt-modal-done-btn', function(e) {
     1724        e.preventDefault();
     1725        e.stopPropagation();
     1726        $(this).closest('.wpt-dropdown-container').hide();
     1727    });
     1728    $(document).on('click', '.add-new-custom-column-wrapper .wpt-modal-close-btn, .add-new-custom-column-wrapper .wpt-custom-cancel-btn', function(e) {
     1729        e.preventDefault();
     1730        e.stopPropagation();
     1731        $(this).closest('.add-new-custom-column-wrapper').addClass('wpt-default-hide').removeAttr('style');
     1732    });
     1733    $(document).on('keydown', function(e) {
     1734        if (e.key === 'Escape' || e.keyCode === 27) {
     1735            $dropdownContainer.hide();
     1736            $('.add-new-custom-column-wrapper').addClass('wpt-default-hide').removeAttr('style');
     1737        }
     1738    });
    15391739    $(document).on('click', function(e) {
    15401740        if (!$(e.target).closest('.wpt-dropdown-container-insider,.wpt_column_sortable, #wpt-add-preset-column').length) {
    … …  
    15431743    });
    15441744    var $addCustomColWrapperContainer = $('.add-new-custom-column-wrapper');
    1545     // Click outside to close dropdown
     1745    // Click outside to close custom column modal
    15461746    $(document).on('click', function(e) {
    15471747        if (!$(e.target).closest('.add_new_col_wrapper,.wpt_column_sortable,.inside_tab_content').length) {
    … …  
    16361836    $(document).ready(function() {
    16371837        WPT_ADMIN_CONTROL.init();
     1838
     1839        // Move Ctrl+S save pill directly into Table Modification postbox-header for clean alignment
     1840        var $ctrlSPill = $('#wpt_configuration_form p.wpt_ctrl_s');
     1841        var $configHeader = $('#wpt_shortcode_configuration_metabox_id .postbox-header');
     1842        if ($ctrlSPill.length && $configHeader.length) {
     1843            $configHeader.append($ctrlSPill);
     1844        }
     1845
     1846        // Demo 1: Fast Single-Request & Non-Destructive Live Table Preview
     1847        var $previewBackdrop = $('#wpt-live-preview-backdrop');
     1848        var $previewIframe = $('#wpt-lp-iframe');
     1849        var $previewViewport = $('#wpt-lp-viewport');
     1850        var $previewLoading = $('#wpt-lp-loading');
     1851        var $previewLoadingText = $('#wpt-lp-loading-text');
     1852        var $previewStatus = $('#wpt-lp-status');
     1853        var $previewExternalLink = $('#wpt-lp-external-link');
     1854        var $postForm = $('body.post-type-wpt_product_table form#post');
     1855        var isExpectingIframeLoad = false;
     1856        var hasLoadedPreviewOnce = false;
     1857        var hasUserModifiedForm = false;
     1858        var isNewUnsavedPost = $('body').hasClass('post-new-php');
     1859        var previewFallbackTimer = null;
     1860        var wptSubmitFieldPattern = /^(post_title|wpt_shortcode_nonce_value)$|^(column_array|column_array_tablet|column_array_mobile|enabled_column_array|enabled_column_array_tablet|enabled_column_array_mobile|column_settings|column_settings_tablet|column_settings_mobile|basics|table_style|conditions|mobile|search_n_filter|pagination|config|responsive|_cf_filter|text_data)(\[|$)/;
     1861
     1862        function getSerializedPreviewFields() {
     1863            if ($postForm.length < 1) {
     1864                return [];
     1865            }
     1866            detect_responsive_stats();
     1867            return $postForm.serializeArray().filter(function(field) {
     1868                return wptSubmitFieldPattern.test(field.name);
     1869            });
     1870        }
     1871
     1872        function getFormFingerprint(fields) {
     1873            return $.param(fields.filter(function(field) {
     1874                return field.name !== 'wpt_shortcode_nonce_value';
     1875            }));
     1876        }
     1877
     1878        var initialSavedFingerprint = $postForm.length > 0 ? getFormFingerprint(getSerializedPreviewFields()) : '';
     1879        var lastPreviewFingerprint = null;
     1880
     1881        $(window).on('load', function() {
     1882            if (!hasUserModifiedForm && $postForm.length > 0) {
     1883                initialSavedFingerprint = getFormFingerprint(getSerializedPreviewFields());
     1884            }
     1885        });
     1886
     1887        $postForm.on('input change sortupdate sortstop', ':input, .wpt_column_sortable', function() {
     1888            hasUserModifiedForm = true;
     1889        });
     1890
     1891        $postForm.on('click', '.wpt-preset-chip, .add_new_col_btn, .wpt_column_sortable .wpt-col-remove', function() {
     1892            hasUserModifiedForm = true;
     1893        });
     1894
     1895        function setPreviewStatus(state, text) {
     1896            $previewStatus
     1897                .removeClass('is-syncing is-synced is-unsaved is-error')
     1898                .addClass('is-' + state)
     1899                .find('.wpt-lp-status-text')
     1900                .text(text);
     1901        }
     1902
     1903        function updateReadyBadge() {
     1904            var isUnsavedState = isNewUnsavedPost || hasUserModifiedForm || (lastPreviewFingerprint !== null && lastPreviewFingerprint !== initialSavedFingerprint);
     1905            if (isUnsavedState) {
     1906                setPreviewStatus('unsaved', 'Previewing unsaved edits');
     1907            } else {
     1908                setPreviewStatus('synced', 'Live preview ready');
     1909            }
     1910        }
     1911
     1912        function markPreviewFrameReady() {
     1913            if (!isExpectingIframeLoad) {
     1914                return;
     1915            }
     1916            isExpectingIframeLoad = false;
     1917            hasLoadedPreviewOnce = true;
     1918            if (previewFallbackTimer) {
     1919                clearTimeout(previewFallbackTimer);
     1920                previewFallbackTimer = null;
     1921            }
     1922            $previewLoading.addClass('is-hidden').hide();
     1923            updateReadyBadge();
     1924        }
     1925
     1926        function updateModalHeaderAndLinks() {
     1927            var rawTitle = ($('#title').val() || '').trim();
     1928            $('#wpt-lp-table-title').text(rawTitle ? '— ' + rawTitle : '');
     1929            var externalUrl = $previewBackdrop.attr('data-external-url') || '';
     1930            if (externalUrl) {
     1931                $previewExternalLink.attr('href', externalUrl);
     1932            }
     1933
     1934            // Sync shortcode in modal toolbar
     1935            var shortcodeVal = $('#wpt-shortcode-text').val() || '';
     1936            if (!shortcodeVal) {
     1937                var cleanTitle = rawTitle.replace(/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/g, '');
     1938                var currentPostId = $('#post_ID').val() || $('input[name="post_ID"]').val() || '';
     1939                if (currentPostId) {
     1940                    shortcodeVal = "[Product_Table id='" + currentPostId + "' name='" + cleanTitle + "']";
     1941                }
     1942            }
     1943            if (shortcodeVal) {
     1944                $('#wpt-lp-shortcode-val').text(shortcodeVal);
     1945                $('#wpt-lp-copy-shortcode').attr('data-shortcode', shortcodeVal);
     1946                $('#wpt-lp-shortcode-wrap').show();
     1947            }
     1948        }
     1949
     1950        function closeLivePreviewModal() {
     1951            if ($previewBackdrop.length < 1 || $previewBackdrop.prop('hidden')) {
     1952                return;
     1953            }
     1954            if (previewFallbackTimer) {
     1955                clearTimeout(previewFallbackTimer);
     1956                previewFallbackTimer = null;
     1957            }
     1958            isExpectingIframeLoad = false;
     1959            $previewBackdrop.prop('hidden', true).removeClass('is-open');
     1960            $('body').removeClass('wpt-lp-modal-open');
     1961            try {
     1962                var iframeDoc = $previewIframe[0] && $previewIframe[0].contentDocument;
     1963                if (iframeDoc) {
     1964                    iframeDoc.querySelectorAll('audio, video').forEach(function(media) {
     1965                        if (!media.paused) {
     1966                            media.pause();
     1967                        }
     1968                    });
     1969                }
     1970            } catch (err) {}
     1971        }
     1972
     1973        function submitLivePreviewToIframe(fields, embedBaseUrl) {
     1974            if (previewFallbackTimer) {
     1975                clearTimeout(previewFallbackTimer);
     1976            }
     1977            isExpectingIframeLoad = true;
     1978            $previewLoading.removeClass('is-error is-hidden').show();
     1979            $previewLoadingText.text('Rendering live table preview...');
     1980            setPreviewStatus('syncing', 'Loading preview...');
     1981
     1982            var sep = embedBaseUrl.indexOf('?') !== -1 ? '&' : '?';
     1983            var actionUrl = embedBaseUrl + sep + '_wpt_pv=' + Date.now();
     1984
     1985            var $tempForm = $('<form>', {
     1986                method: 'POST',
     1987                action: actionUrl,
     1988                target: 'wpt_lp_iframe',
     1989                style: 'display:none;'
     1990            });
     1991
     1992            $.each(fields, function(_, field) {
     1993                if (typeof field.value === 'string' && field.value.indexOf('\n') !== -1) {
     1994                    $tempForm.append($('<textarea>', { name: field.name }).val(field.value));
     1995                } else {
     1996                    $tempForm.append($('<input>', { type: 'hidden', name: field.name, value: field.value }));
     1997                }
     1998            });
     1999
     2000            $('body').append($tempForm);
     2001            $tempForm[0].submit();
     2002            $tempForm.remove();
     2003
     2004            previewFallbackTimer = setTimeout(function() {
     2005                if (isExpectingIframeLoad) {
     2006                    isExpectingIframeLoad = false;
     2007                    $previewLoading.addClass('is-hidden').hide();
     2008                    updateReadyBadge();
     2009                }
     2010            }, 25000);
     2011        }
     2012
     2013        function openLivePreview(forceReload) {
     2014            if ($previewBackdrop.length < 1) {
     2015                return;
     2016            }
     2017            var embedBaseUrl = $previewBackdrop.attr('data-embed-url') || '';
     2018            if (!embedBaseUrl) {
     2019                return;
     2020            }
     2021
     2022            updateModalHeaderAndLinks();
     2023            $previewBackdrop.prop('hidden', false).addClass('is-open');
     2024            $('body').addClass('wpt-lp-modal-open');
     2025
     2026            var fields = getSerializedPreviewFields();
     2027            var currentFingerprint = getFormFingerprint(fields);
     2028            if (!hasLoadedPreviewOnce && !hasUserModifiedForm) {
     2029                initialSavedFingerprint = currentFingerprint;
     2030            }
     2031
     2032            // Instant 0ms re-open if form inputs have not changed since last rendered preview.
     2033            if (!forceReload && hasLoadedPreviewOnce && currentFingerprint === lastPreviewFingerprint) {
     2034                $previewLoading.addClass('is-hidden').hide();
     2035                updateReadyBadge();
     2036                return;
     2037            }
     2038
     2039            // Refresh without edits: skip re-posting form and reload transient-backed GET URL directly.
     2040            if (forceReload && hasLoadedPreviewOnce && currentFingerprint === lastPreviewFingerprint) {
     2041                if (previewFallbackTimer) {
     2042                    clearTimeout(previewFallbackTimer);
     2043                }
     2044                isExpectingIframeLoad = true;
     2045                $previewLoading.removeClass('is-error is-hidden').show();
     2046                $previewLoadingText.text('Refreshing live table preview...');
     2047                setPreviewStatus('syncing', 'Refreshing preview...');
     2048                var sep = embedBaseUrl.indexOf('?') !== -1 ? '&' : '?';
     2049                $previewIframe.attr('src', embedBaseUrl + sep + '_wpt_pv=' + Date.now());
     2050                return;
     2051            }
     2052
     2053            lastPreviewFingerprint = currentFingerprint;
     2054            submitLivePreviewToIframe(fields, embedBaseUrl);
     2055        }
     2056
     2057        $(window).on('message', function(e) {
     2058            var nativeEvent = e.originalEvent || e;
     2059            if (!nativeEvent || nativeEvent.origin !== window.location.origin) {
     2060                return;
     2061            }
     2062            if (nativeEvent.data && nativeEvent.data.type === 'wptLivePreviewReady') {
     2063                markPreviewFrameReady();
     2064            }
     2065        });
     2066
     2067        $previewIframe.on('load', function() {
     2068            markPreviewFrameReady();
     2069        });
     2070
     2071        function fallbackCopy(text, callback) {
     2072            var $temp = $('<textarea>');
     2073            $temp.css({ position: 'absolute', left: '-9999px', top: (window.pageYOffset || document.documentElement.scrollTop) + 'px' });
     2074            $('body').append($temp);
     2075            $temp.val(text).select();
     2076            try {
     2077                document.execCommand('copy');
     2078                if (callback) callback();
     2079            } catch (err) {}
     2080            $temp.remove();
     2081        }
     2082
     2083        $(document).on('click', '#wpt-lp-copy-shortcode, #wpt-lp-shortcode-val', function(e) {
     2084            e.preventDefault();
     2085            var shortcode = $('#wpt-lp-copy-shortcode').attr('data-shortcode') || $('#wpt-lp-shortcode-val').text();
     2086            if (!shortcode) return;
     2087
     2088            var $btn = $('#wpt-lp-copy-shortcode');
     2089            var $label = $btn.find('.wpt-copy-text');
     2090            var originalText = $label.text() || 'Copy';
     2091
     2092            function showCopied() {
     2093                $btn.addClass('copied');
     2094                $label.text('Copied!');
     2095                setTimeout(function() {
     2096                    $btn.removeClass('copied');
     2097                    $label.text(originalText);
     2098                }, 2000);
     2099            }
     2100
     2101            if (navigator.clipboard && navigator.clipboard.writeText) {
     2102                navigator.clipboard.writeText(shortcode).then(showCopied).catch(function() {
     2103                    fallbackCopy(shortcode, showCopied);
     2104                });
     2105            } else {
     2106                fallbackCopy(shortcode, showCopied);
     2107            }
     2108        });
     2109
     2110        // Click Ctrl+S shortcut pill to save table
     2111        $(document).on('click', 'p.wpt_ctrl_s', function(e) {
     2112            e.preventDefault();
     2113            $('#publish, #save-post, input[name="save"]').first().trigger('click');
     2114        });
     2115
     2116        // Trigger Live Preview directly from All Tables & Dashboard tables
     2117        $(document).on('click', '.wpt-table-preview-btn', function(e) {
     2118            e.preventDefault();
     2119            var $btn = $(this);
     2120            var embedUrl = $btn.attr('data-embed-url') || '';
     2121            var externalUrl = $btn.attr('data-external-url') || '';
     2122            var tableTitle = $btn.attr('data-table-title') || '';
     2123            var shortcode = $btn.attr('data-shortcode') || '';
     2124
     2125            if (!embedUrl) {
     2126                return;
     2127            }
     2128
     2129            $previewBackdrop.attr('data-embed-url', embedUrl);
     2130            $previewBackdrop.attr('data-external-url', externalUrl);
     2131            $('#wpt-lp-table-title').text(tableTitle ? '— ' + tableTitle : '');
     2132            $previewExternalLink.attr('href', externalUrl || '#');
     2133
     2134            if (shortcode) {
     2135                $('#wpt-lp-shortcode-val').text(shortcode);
     2136                $('#wpt-lp-copy-shortcode').attr('data-shortcode', shortcode);
     2137                $('#wpt-lp-shortcode-wrap').show();
     2138            } else {
     2139                $('#wpt-lp-shortcode-wrap').hide();
     2140            }
     2141
     2142            $previewBackdrop.prop('hidden', false).addClass('is-open');
     2143            $('body').addClass('wpt-lp-modal-open');
     2144
     2145            isExpectingIframeLoad = true;
     2146            $previewLoading.removeClass('is-error is-hidden').show();
     2147            $previewLoadingText.text('Rendering live table preview...');
     2148            setPreviewStatus('syncing', 'Loading preview...');
     2149
     2150            var sep = embedUrl.indexOf('?') !== -1 ? '&' : '?';
     2151            $previewIframe.attr('src', embedUrl + sep + '_wpt_pv=' + Date.now());
     2152
     2153            if (previewFallbackTimer) {
     2154                clearTimeout(previewFallbackTimer);
     2155            }
     2156            previewFallbackTimer = setTimeout(function() {
     2157                if (isExpectingIframeLoad) {
     2158                    isExpectingIframeLoad = false;
     2159                    $previewLoading.addClass('is-hidden').hide();
     2160                    setPreviewStatus('synced', 'Live preview ready');
     2161                }
     2162            }, 25000);
     2163        });
     2164
     2165        $(document).on('click', '#wpt-open-preview-btn, #wpt-top-preview-btn', function(e) {
     2166            e.preventDefault();
     2167            openLivePreview(false);
     2168        });
     2169
     2170        $(document).on('click', '#wpt-lp-refresh-btn', function(e) {
     2171            e.preventDefault();
     2172            openLivePreview(true);
     2173        });
     2174
     2175        $(document).on('click', '.wpt-lp-device-btn', function(e) {
     2176            e.preventDefault();
     2177            var device = $(this).attr('data-device') || 'desktop';
     2178            $('.wpt-lp-device-btn').removeClass('active');
     2179            $(this).addClass('active');
     2180            $previewViewport.removeClass('is-desktop is-tablet is-mobile').addClass('is-' + device);
     2181        });
     2182
     2183        $(document).on('click', '#wpt-lp-close-btn', function(e) {
     2184            e.preventDefault();
     2185            closeLivePreviewModal();
     2186        });
     2187
     2188        $previewBackdrop.on('click', function(e) {
     2189            if (e.target === this) {
     2190                closeLivePreviewModal();
     2191            }
     2192        });
     2193
     2194        $(document).on('keydown', function(e) {
     2195            if (e.key === 'Escape' && $previewBackdrop.hasClass('is-open')) {
     2196                closeLivePreviewModal();
     2197            }
     2198        });
    16382199    });
    16392200
  • woo-product-table/tags/6.1.6/inc/handle/enable-column.php

    r3522314 r3837744  
    4242         */
    4343        if( $shortcode->table_type == 'advance_table' ){
    44             self::$message_col = isset( $shortcode->_enable_cols['message'] ); //If available, value will be true
     44            self::$message_col = is_array( $shortcode->_enable_cols ) && isset( $shortcode->_enable_cols['message'] ); //If available, value will be true
    4545           
    46             self::$inner_items = array_column( $shortcode->column_settings, 'items' );
     46            if( is_array( $shortcode->column_settings ) && ! empty( $shortcode->column_settings ) ){
     47                self::$inner_items = array_column( $shortcode->column_settings, 'items' );
    4748
    48             foreach( $shortcode->column_settings as $key=>$items){
    49                 if( ! isset( $items['items'] ) ) continue;
     49                foreach( $shortcode->column_settings as $key=>$items){
     50                    if( ! isset( $items['items'] ) || ! is_array( $items['items'] ) ) continue;
    5051
    51                 $m_index = array_search( 'message', $items['items'] );
    52                
    53                 if( is_int( $m_index ) ){
     52                    $m_index = array_search( 'message', $items['items'] );
    5453                   
    55                     unset($shortcode->column_settings[$key]['items'][$m_index]);
    56                     self::$message_col = true;
    57                     break;
     54                    if( is_int( $m_index ) ){
     55                       
     56                        unset($shortcode->column_settings[$key]['items'][$m_index]);
     57                        self::$message_col = true;
     58                        break;
     59                    }
     60                   
    5861                }
    59                
     62            } else {
     63                self::$inner_items = [];
    6064            }
    6165
    62             if( self::$message_col ){
     66            if( self::$message_col && is_array( $shortcode->_enable_cols ) ){
    6367                unset($shortcode->_enable_cols['message']);
    6468                add_action( 'woocommerce_before_add_to_cart_quantity', 'wpt_add_custom_message_field' );
    … …  
    6670        }
    6771        //If set Only Product Variation
    68         if( $shortcode->req_product_type == 'product_variation' ){
     72        if( $shortcode->req_product_type == 'product_variation' && is_array( $shortcode->_enable_cols ) ){
    6973            /**
    7074             * We have remove @version 3.3.8.1 because, in category item
  • woo-product-table/tags/6.1.6/inc/shortcode.php

    r3772120 r3837744  
    580580        set_query_var( $this->req_post_type, $this->table_id );
    581581
    582         $this->is_table = $this->table_id && $this->post_type == $this->req_post_type && $this->status == 'publish';
     582        $is_preview_request   = is_preview() || wp_doing_ajax() || ! empty( $_GET['wpt_embed_preview'] ) || ! empty( $_GET['wpt_live_preview'] ) || ! empty( $atts['preview_mode'] );
     583        $is_authorized_preview = is_user_logged_in()
     584            && in_array( $this->status, array( 'draft', 'pending', 'future', 'private', 'auto-draft' ), true )
     585            && current_user_can( 'edit_post', $this->table_id )
     586            && $is_preview_request;
     587
     588        $this->is_table = $this->table_id && $this->post_type == $this->req_post_type && ( 'publish' === $this->status || $is_authorized_preview );
    583589        if( ! $this->is_table && ! empty( $this->atts ) ){
    584590            return Msg::not_found($this);
     591        }
     592
     593        if ( ( ! empty( $_GET['wpt_live_preview'] ) || ! empty( $atts['preview_mode'] ) ) && function_exists( 'wpt_activate_live_preview_context' ) ) {
     594            wpt_activate_live_preview_context( $this->table_id );
    585595        }
    586596
    … …  
    716726
    717727        $this->column_settings = apply_filters( 'wpto_column_settings', $column_settings, $this->table_id, $this->_enable_cols );
     728        if( ! is_array( $this->column_settings ) ){
     729            $this->column_settings = [];
     730        }
     731        if( ! is_array( $this->_enable_cols ) ){
     732            $this->_enable_cols = [];
     733        }
     734        if( ! is_array( $this->column_array ) ){
     735            $this->column_array = [];
     736        }
    718737       
    719738        /**
  • woo-product-table/tags/6.1.6/includes/enqueue.php

    r3772120 r3837744  
    1616   function wpt_enqueue(){
    1717        global $post;
    18         $pass = is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'Product_Table') || is_woocommerce() || ( is_a($post, 'WP_Post') && $post->post_type === 'wpt_product_table' ) || ( is_a($post, 'WP_Post') && strpos( $post->post_content, 'wpt' ) !== false );
     18        $is_live_preview  = ! empty( $_GET['wpt_live_preview'] ) && is_user_logged_in();
     19        $is_embed_preview = $is_live_preview && ! empty( $_GET['wpt_embed_preview'] );
     20        $pass = $is_live_preview || ( is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'Product_Table') ) || is_woocommerce() || ( is_a($post, 'WP_Post') && $post->post_type === 'wpt_product_table' ) || ( is_a($post, 'WP_Post') && strpos( $post->post_content, 'wpt' ) !== false );
    1921
    2022        if( ! $pass ) return;
    … …  
    2931       //jQuery file including. jQuery is a already registerd to WordPress
    3032       wp_enqueue_script( 'jquery' );
    31        wp_enqueue_script( 'wc-cart-fragments' );
     33       if ( ! $is_embed_preview ) {
     34           wp_enqueue_script( 'wc-cart-fragments' );
     35       }
    3236       wp_enqueue_script( 'wc-add-to-cart-variation' );
    3337
     38       $wpt_custom_deps = $is_embed_preview
     39           ? array( 'jquery', 'wc-add-to-cart-variation' )
     40           : array( 'jquery', 'wc-cart-fragments', 'wc-add-to-cart-variation' );
     41
    3442       //register wpt-custom-js
    35        wp_register_script( 'wpt-custom-js', WPT_Product_Table::getPath('BASE_URL') . 'assets/js/custom.js', array( 'jquery','wc-cart-fragments','wc-add-to-cart-variation' ), WPT_DEV_VERSION, true );
     43       wp_register_script( 'wpt-custom-js', WPT_Product_Table::getPath('BASE_URL') . 'assets/js/custom.js', $wpt_custom_deps, WPT_DEV_VERSION, true );
    3644
    3745       // Enqueue the registered script
  • woo-product-table/tags/6.1.6/includes/functions.php

    r3522314 r3837744  
    327327            <label for="nolink<?php echo esc_attr( $_device_name ); ?>"><input type="radio" id="nolink<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[title_variation]" value="nolink" <?php echo $title_variation == 'nolink' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Link Disable', 'woo-product-table' ); ?></label>
    328328            <label for="ca_quick_view<?php echo esc_attr( $_device_name ); ?>" class="tooltip"><input type="radio" id="ca_quick_view<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[title_variation]" value="ca_quick_view" <?php echo $title_variation == 'ca_quick_view' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Quick View - BizzView', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/ca-quick-view/" target="_blank"><?php echo esc_html__( 'BizzView - Quick View', 'woo-product-table' ); ?></a></span></label>
    329             <label for="yith<?php echo esc_attr( $_device_name ); ?>" style="opacity:0.041" class="tooltip"><input type="radio" id="yith<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[title_variation]" value="yith" <?php echo $title_variation == 'yith' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Link Disable + Quick View', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/yith-woocommerce-quick-view/" target="_blank"><?php echo esc_html__( 'YITH WooCommerce Quick View', 'woo-product-table' ); ?></a></span></label>
     329            <label for="yith<?php echo esc_attr( $_device_name ); ?>" class="tooltip wpt-legacy-quick-view"><input type="radio" id="yith<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[title_variation]" value="yith" <?php echo $title_variation == 'yith' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Link Disable + Quick View (YITH)', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/yith-woocommerce-quick-view/" target="_blank"><?php echo esc_html__( 'YITH WooCommerce Quick View', 'woo-product-table' ); ?></a></span></label>
    330330        </div>       
    331331
    … …  
    368368           
    369369            <label for="ca_quick_view_thumb<?php echo esc_attr( $_device_name ); ?>" class="tooltip"><input type="radio" id="ca_quick_view_thumb<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[thumb_variation]" value="ca_quick_view" <?php echo $thumb_variation == 'ca_quick_view' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Quick View - BizzView', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/ca-quick-view/" target="_blank"><?php echo esc_html__( 'BizzView - Quick View', 'woo-product-table' ); ?></a></span></label>
    370             <label for="quick_view<?php echo esc_attr( $_device_name ); ?>" style="opacity:0.041;" class="tooltip"><input type="radio" id="quick_view<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[thumb_variation]" value="quick_view" <?php echo $thumb_variation == 'quick_view' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Quick View', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/yith-woocommerce-quick-view/" target="_blank"><?php echo esc_html__( 'YITH WooCommerce Quick View', 'woo-product-table' ); ?></a></span></label>
     370            <label for="quick_view<?php echo esc_attr( $_device_name ); ?>" class="tooltip wpt-legacy-quick-view"><input type="radio" id="quick_view<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[thumb_variation]" value="quick_view" <?php echo $thumb_variation == 'quick_view' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Quick View (YITH)', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/yith-woocommerce-quick-view/" target="_blank"><?php echo esc_html__( 'YITH WooCommerce Quick View', 'woo-product-table' ); ?></a></span></label>
    371371        </div>
    372372       
  • woo-product-table/tags/6.1.6/includes/items/quick.php

    r3522314 r3837744  
    44    echo do_shortcode( '[bizzview id="' . esc_attr( $product_id ) . '"]' ); 
    55}else{
    6     $text = $config_value['quick_view_btn_text'] ?? __( 'Qiuck View', 'woo-product-table' );
     6    $text = $config_value['quick_view_btn_text'] ?? __( 'Quick View', 'woo-product-table' );
    77
    88    /**
  • woo-product-table/tags/6.1.6/readme.txt

    r3772130 r3837744  
    55Requires at least: 6.2
    66Tested up to: 7.1
    7 Stable tag: 6.1.5
     7Stable tag: 6.1.6
    88Requires PHP: 7.4
    99License: GPLv2 or later
    … …  
    309309== Changelog ==
    310310
     311= 6.1.6 =
     312* New: Live Preview added.
     313* Update: Dashboard design updated.
     314* Code optimized.
     315
    311316= 6.1.5 =
    312317* Try live demo link updated to new demo site.
  • woo-product-table/tags/6.1.6/templates/table-preview.php

    r2839777 r3837744  
     1<?php
     2$wpt_preview_post_id = get_queried_object_id();
     3if ( empty( $wpt_preview_post_id ) && ! empty( $_GET['wpt_table_id'] ) ) {
     4    $wpt_preview_post_id = absint( $_GET['wpt_table_id'] );
     5}
     6$is_embed_preview    = ! empty( $_GET['wpt_embed_preview'] ) && is_user_logged_in() && ( $wpt_preview_post_id ? current_user_can( 'edit_post', $wpt_preview_post_id ) : current_user_can( 'edit_wpt_product_tables' ) );
     7if ( $is_embed_preview ) {
     8    show_admin_bar( false );
     9}
     10?>
    111<!doctype html>
    212<html <?php language_attributes(); ?>>
    … …  
    414        <meta charset="<?php bloginfo( 'charset' ); ?>">
    515        <meta name="viewport" content="width=device-width, initial-scale=1">
    6         <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    716        <link rel="profile" href="https://gmpg.org/xfn/11">
    817        <style id="wpt-wpt-page">
    … …  
    2332                max-width: 100%;
    2433            }
     34            <?php if ( $is_embed_preview ) : ?>
     35            html { margin-top: 0 !important; }
     36            body.wpt-table-preview-body { background: #ffffff !important; margin: 0 !important; }
     37            body.wpt-table-preview-body div#page { padding: 16px 20px !important; }
     38            body.wpt-table-embed-preview .wpt_edit_table { display: none !important; }
     39            <?php endif; ?>
    2540        </style>
    2641        <?php wp_head(); ?>
    2742</head>
    2843
    29 <body <?php body_class( 'wpt-table-preview-body' ); ?>>
     44<body <?php body_class( $is_embed_preview ? 'wpt-table-preview-body wpt-table-embed-preview' : 'wpt-table-preview-body' ); ?>>
    3045<?php wp_body_open(); ?>
    3146
    … …  
    3348<div id="page" class="hfeed site wpt-fullwidth">
    3449<?php
    35     if ( have_posts() ) : while ( have_posts() ) : the_post();
    36     $id = get_the_ID();
    37     $title = get_the_title();
     50    $id = ! empty( $wpt_preview_post_id ) ? absint( $wpt_preview_post_id ) : get_the_ID();
     51    $title = $id ? get_the_title( $id ) : '';
    3852
    39 
     53    if ( ! $is_embed_preview ) :
    4054    ?>
    4155    <div class="wpt-preview-title">
    42         <h2 class="wpt-preview-heading"><?php the_title(); ?></h2>
     56        <h2 class="wpt-preview-heading"><?php echo esc_html( $title ); ?></h2>
    4357
    4458        <?php if( is_user_logged_in() ){ ?>
    … …  
    5872
    5973    <?php
     74    endif;
    6075
     76    if ( $id ) {
     77        $preview_attr = ! empty( $_GET['wpt_live_preview'] ) ? " preview_mode='1'" : '';
     78        echo do_shortcode( "[Product_Table id='{$id}'{$preview_attr}]" );
     79    }
    6180
    62     echo do_shortcode("[Product_Table id='{$id}']");
    63     endwhile;
     81    if ( $is_embed_preview && $id ) :
     82    ?>
     83    <script>
     84    if ( window.parent && window.parent !== window ) {
     85        try {
     86            window.parent.postMessage( { type: 'wptLivePreviewReady', tableId: <?php echo (int) $id; ?> }, window.location.origin );
     87        } catch (err) {}
     88    }
     89    </script>
     90    <?php
    6491    endif;
    6592
  • woo-product-table/tags/6.1.6/woo-product-table.php

    r3772130 r3837744  
    99 * Tags: wooproducttable, woocommerce product list,woocommerce product table, wc product table, product grid view, inventory, shop product table
    1010 *
    11  * Version: 6.1.5
     11 * Version: 6.1.6
    1212 * Requires at least:    6.2
    1313 * Tested up to:         7.1
    … …  
    4545
    4646if( ! defined( 'WPT_DEV_VERSION' ) ){
    47     define( 'WPT_DEV_VERSION', '6.1.5.0' );
     47    define( 'WPT_DEV_VERSION', '6.1.6.0' );
    4848}
    4949
    … …  
    9191$wpt_old_pro_dir = trailingslashit( WP_PLUGIN_DIR ) . 'woo-product-table-pro';
    9292
    93 
     93//an example notice added at Dashbord, no need condition. just want to show a notice
     94add_action( 'admin_notices', function() {
     95    if( is_plugin_active( 'woo-product-table-pro/woo-product-table-pro.php' ) ){
     96        ?>
     97        <div class="notice notice-error is-dismissible">
     98            <p><?php echo esc_html__( 'You have installed the old version of Woo Product Table Pro plugin. Please deactivate it and use the new version of Woo Product Table Pro plugin.', 'woo-product-table' ); ?></p>
     99        </div>
     100        <?php
     101    }
     102} );
    94103
    95104/**
    … …  
    513522             */
    514523            //include_once $this->path('BASE_DIR','includes/wpt_product_table_post.php');
     524            include_once $this->path('BASE_DIR','includes/live-preview.php');
    515525            include_once $this->path('BASE_DIR','includes/enqueue.php');
    516526           
    … …  
    572582         * Getting Device Object Info by Using Mobile_Detect Class
    573583         *
    574          * @param type $userAgent
     584         * @param null|string $userAgent
    575585         * @return \Mobile_Detect Object
    576586         */
    … …  
    582592         * Set Path
    583593         *
    584          * @param type $path_array
     594         * @param array $path_array
    585595         *
    586596         * @since 1.0.0
    … …  
    597607         * Name should like Constant and full Capitalize
    598608         *
    599          * @param type $name
     609         * @param string $name
    600610         * @return string
    601611         */
  • woo-product-table/trunk/admin/action-hook.php

    r3522314 r3837744  
    181181                    <div class="wpt-form-info">
    182182                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/customize-add-to-card-icon/') ?>
     183                        <p><?php esc_html_e( 'Choose how the Add to Cart icon is displayed on button: no icon, icon only, left or right.', 'woo-product-table' ); ?></p>
    183184                    </div>
    184185                </td>
    … …  
    240241                    <div class="wpt-form-info">
    241242                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/floating-cart-options/'); ?>
     243                        <p><?php esc_html_e( 'Display a sticky floating cart button on your product table page.', 'woo-product-table' ); ?></p>
    242244                    </div>
    243245                </td>
    … …  
    258260                    <div class="wpt-form-info">
    259261                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/floating-cart-options/') ?>
     262                        <p><?php esc_html_e( 'Set the background color for the floating cart button or bar.', 'woo-product-table' ); ?></p>
    260263                    </div>
    261264                </td>
    … …  
    281284                    <div class="wpt-form-info">
    282285                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/floating-cart-options/'); ?>
     286                        <p><?php esc_html_e( 'Choose floating cart position on screen (e.g. Bottom Right, Top Left).', 'woo-product-table' ); ?></p>
    283287                    </div>
    284288                </td>
    … …  
    298302                    <div class="wpt-form-info">
    299303                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/floating-cart-options/'); ?>
     304                        <p><?php esc_html_e( 'Set floating cart button diameter size in pixels. Default is 70.', 'woo-product-table' ); ?></p>
    300305                    </div>
    301306                </td>
    … …  
    446451                    <div class="wpt-form-info">
    447452                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/advance-uses/show-product-in-new-same-tab/'); ?>
     453                        <p><?php esc_html_e( 'Choose whether clicking a product title or thumbnail opens in a new tab or same tab.', 'woo-product-table' ); ?></p>
    448454                    </div>
    449455                </td>
    … …  
    468474                    <div class="wpt-form-info">
    469475                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/disable-categories-tag-link/'); ?>
     476                        <p><?php esc_html_e( 'Enable or disable clickable links on category and tag terms inside table cells.', 'woo-product-table' ); ?></p>
    470477                    </div>
    471478                </td>
    … …  
    510517                    <div class="wpt-form-info">
    511518                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/disable-enable-add-to-cart-popup-notice/'); ?>
     519                        <p><?php esc_html_e( 'Show or hide popup confirmation message when adding products to cart.', 'woo-product-table' ); ?></p>
    512520                    </div>
    513521                </td>
    … …  
    572580                        </div>
    573581                        <div class="form-field col-lg-6">
    574                             <select name="<?php echo esc_attr( $field_name ); ?>[query_by_url]" id="wpt_table_instant_search_filter" class="wpt_fullwidth ua_input" >
     582                            <select name="<?php echo esc_attr( $field_name ); ?>[query_by_url]" id="wpt_table_query_by_url" class="wpt_fullwidth ua_input" >
    575583                                <?php wpt_default_option( $page ) ?>
    576584                                <option value="0" <?php wpt_selected( 'query_by_url', '0', $current_config_value ); ?>><?php esc_html_e( 'Off', 'woo-product-table' ); ?></option>
    … …  
    583591                    <div class="wpt-form-info">
    584592                        <?php wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/how-to-show-hide-query-url/'); ?>
     593                        <p><?php esc_html_e( 'Allow filtering or sorting table data directly using URL query parameters.', 'woo-product-table' ); ?></p>
    585594                    </div>
    586595                </td>
    … …  
    603612                <td>
    604613                    <div class="wpt-form-info">
    605                        
     614                        <p><?php esc_html_e( 'Calculate cart quantities per unique product or across all item variations.', 'woo-product-table' ); ?></p>
    606615                    </div>
    607616                </td>
    … …  
    15101519                <div class="wpt-form-info">
    15111520                    <?php wpt_doc_link('https://wooproducttable.com/doc/advance-uses/sort-table-column/') ?>
     1521                    <p><?php esc_html_e( 'Allow visitors to sort table columns alphabetically or numerically on frontend.', 'woo-product-table' ); ?></p>
    15121522                </div>
    15131523            </td>
  • woo-product-table/trunk/admin/admin-enqueue.php

    r3522314 r3837744  
    3737       
    3838       
    39         wp_enqueue_style( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/css/admin.css', array('select2'), WPT_DEV_VERSION, 'all' );
     39        $admin_css_file = WPT_Product_Table::getPath( 'BASE_DIR' ) . 'assets/css/admin.css';
     40        $admin_css_ver  = file_exists( $admin_css_file ) ? filemtime( $admin_css_file ) : WPT_DEV_VERSION;
     41        wp_enqueue_style( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/css/admin.css', array('select2'), $admin_css_ver, 'all' );
    4042
    4143        wpt_admin_notice_css_file_load();
    … …  
    9395        //wp_enqueue_script( 'select2-wpt' );
    9496
    95         wp_enqueue_script( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/js/admin.js', array( 'jquery','select2-wpt' ), WPT_DEV_VERSION, true );
     97        $admin_js_file = WPT_Product_Table::getPath( 'BASE_DIR' ) . 'assets/js/admin.js';
     98        $admin_js_ver = file_exists( $admin_js_file ) ? filemtime( $admin_js_file ) : WPT_DEV_VERSION;
     99        wp_enqueue_script( 'wpt-admin', WPT_Product_Table::getPath( 'BASE_URL' ) . 'assets/js/admin.js', array( 'jquery','select2-wpt' ), $admin_js_ver, true );
    96100       
    97101        $ajax_url = admin_url( 'admin-ajax.php' );
  • woo-product-table/trunk/admin/class-codeastrology-expert-services.php

    r3772120 r3837744  
    249249                private static function render_review_page( $context ) {
    250250                        $links = self::get_contact_links( $context, 'free-store-review-page' );
     251
     252                        if ( ! empty( $context['key'] ) && $context['key'] === 'product-table-for-woocommerce' ) {
     253                                if ( empty( $GLOBALS['wpt_topbar_rendered'] ) ) {
     254                                        $wpt_topbar = defined( 'WPT_BASE_DIR' ) ? WPT_BASE_DIR . 'admin/page/topbar.php' : '';
     255                                        if ( $wpt_topbar && file_exists( $wpt_topbar ) ) {
     256                                                include $wpt_topbar;
     257                                        }
     258                                }
     259                        }
    251260                        ?>
    252261                        <div class="wrap caes-page caes-review-page">
  • woo-product-table/trunk/admin/duplicate.php

    r3522314 r3837744  
    129129        if(isset( $actions['inline hide-if-no-js'] )) unset($actions['inline hide-if-no-js']);
    130130        if (current_user_can('edit_posts') ) {
    131                 $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?action=wpt_duplicate_as_draft&post=' . $post->ID, basename(__FILE__), 'duplicate_nonce' ) . '" title="Duplicate this Product Table" rel="permalink"><i class="wpt-table"></i> Duplicate</a>';
     131                $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?action=wpt_duplicate_as_draft&post=' . $post->ID, basename(__FILE__), 'duplicate_nonce' ) . '" title="Duplicate this Product Table" rel="permalink"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align: -2px;" aria-hidden="true"><rect x="8" y="8" width="13" height="13" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/><path d="M14.5 11.5v6"/><path d="M11.5 14.5h6"/></svg> Duplicate</a>';
    132132        }
    133133        return $actions;
  • woo-product-table/trunk/admin/functions.php

    r3522314 r3837744  
    6565}
    6666
    67 /**
    68  * Remove empty Array value from an Multi-dimensional Array
    69  * I have taken help from a stackoverflow tips.
    70  *
    71  * @param array $array Obviously should be an Array
    72  * @return array
    73  *
    74  * @link https://stackoverflow.com/questions/9895130/recursively-remove-empty-elements-and-subarrays-from-a-multi-dimensional-array
    75  *
    76  */
    77 function wpt_remove_empty_value_from_array($array)
    78 {
    79 
    80 
    81     if (! is_array($array)) return $array;
    82 
    83     foreach ($array as $key => &$value) {
    84         if (! is_bool($value) && empty($value)) {
    85             unset($array[$key]);
    86         } else {
    87             if (is_array($value)) {
    88                 $value = wpt_remove_empty_value_from_array($value);
    89                 if (! is_bool($value) && empty($value)) {
    90                     unset($array[$key]);
    91                 }
    92             }
    93         }
    94     }
    95 
    96     return $array;
    97 }
     67// wpt_remove_empty_value_from_array() is defined in includes/live-preview.php.
    9868
    9969
    … …  
    177147}
    178148//add_filter( 'wpto_admin_tab_array', 'wpt_admin_responsive_tab' );
    179 
    180 if (!function_exists('wpt_admin_responsive_tab_save')) {
    181     /**
    182      * Save Responsive Tab Data
    183      * @since 5.0.3.0
    184      * @param array $save_tab_array
    185      * @return array
    186      */
    187     function wpt_admin_responsive_tab_save($save_tab_array)
    188     {
    189         $save_tab_array['responsive'] = 'responsive';
    190         return $save_tab_array;
    191     }
    192 }
    193 add_filter('wpto_save_tab_array', 'wpt_admin_responsive_tab_save');
    194149
    195150if (!function_exists('wpt_column_style_for_all')) {
    … …  
    292247                    <br><label>Toggle Text</label>
    293248                    <input style="display: inline;" type="text" class="" name="column_settings[check][toggle_label]" value="">
    294                     <p>To show Hide Column or as Item inside Column, Check it.</p>
     249                    <p><?php echo esc_html__( 'Enable this to show or hide inner items when clicked.', 'woo-product-table' ); ?></p>
    295250                </div>
    296251            <?php } ?>
    … …  
    328283    }
    329284}
    330 
    331 if (!function_exists('wpt_data_manipulation_on_save')) {
    332 
    333     /**
    334      * Args Manipulation from Basic Tab
    335      * Used Filter:
    336      * $tab_data = apply_filters( 'wpto_tab_data_on_save', $tab_data, $tab, $post_id, $save_tab_array );
    337      * @since 2.8.3.5
    338      *
    339      * @param array $tab_data Data of current saving tab
    340      * @param string $tab Current saving tab name
    341      * @param int $post_id Current post ID
    342      * @param array $save_tab_array Array of all saving tabs
    343      * @return array
    344      */
    345     function wpt_data_manipulation_on_save($tab_data, $tab, $post_id, $save_tab_array)
    346     {
    347 
    348         if ('basics' == $tab && is_array($tab_data)) {
    349 
    350             /**
    351              * Query Relation for Taxonomy added
    352              * @version 2.8.3.5
    353              */
    354             $query_relation = ! isset($tab_data['query_relation']) ? 'IN' : $tab_data['query_relation'];
    355             $query_relation = $tab_data['query_relation'] ?? 'IN';
    356 
    357             $data = isset($tab_data['data']) ? $tab_data['data'] : false;
    358             $terms_string = 'terms';
    359             $terms = isset($data[$terms_string]) ? $data[$terms_string] : false;
    360             if (is_array($terms)) {
    361                 foreach ($terms as $term_key => $term_ids) {
    362                     $term_key_IN = $term_key . '_' . $query_relation; //IN
    363                     $tab_data['args']['tax_query'][$term_key_IN] = array(
    364                         'taxonomy'      => $term_key,
    365                         'field'         => 'id',
    366                         'terms'         => $term_ids, //Array of Term's IDs
    367                         'operator'      => 'IN' //$query_relation,//
    368                     );
    369                 }
    370             }
    371         }
    372         //        if( 'column_settings' == $tab && is_array( $tab_data ) ){
    373         //            foreach( $tab_data as $per_key => $per_data ){
    374         //                if( !empty( $per_key ) && is_array( $per_data ) ){
    375         //                    $tab_data[$per_key]['style_str'] = isset( $per_data['style'] ) && is_array( $per_data['style'] ) ? wpt_convert_style_from_arr( $per_data['style'] ) : '';
    376         //                }
    377         //            }
    378         //        }
    379 
    380         return $tab_data;
    381     }
    382 }
    383 add_filter('wpto_tab_data_on_save', 'wpt_data_manipulation_on_save', 10, 4);
    384285
    385286if (! function_exists('wpt_add_tabs')) {
  • woo-product-table/trunk/admin/menu_plugin_setting_link.php

    r3522314 r3837744  
    1515            $wpt_links[] = '<a class="wpt-wp-plugin-list-link" href="https://wooproducttable.com/pricing/?utm_source=Product+Table+Dashboard&utm_medium=Free+Version&utm_content=Get+Pro" title="' . esc_attr__( 'Many awesome features is waiting for you', 'woo-product-table' ) . '" target="_blank">'.esc_html__( 'Get Premium','woo-product-table' ).'</a>';
    1616        }
     17        $wpt_links[] = '<a href="' . admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-dashboard' ) . '" title="' . esc_attr__( 'Dashboard', 'woo-product-table' ) . '"><strong>' . esc_html__( 'Dashboard', 'woo-product-table' ).'</strong></a>';
    1718        $wpt_links[] = '<a href="' . admin_url( 'post-new.php?post_type=wpt_product_table' ) . '" title="' . esc_attr__( 'Add Table', 'woo-product-table' ) . '">' . esc_html__( 'Create Table', 'woo-product-table' ).'</a>';
    18         $wpt_links[] = '<a href="' . admin_url( 'edit.php?post_type=wpt_product_table&page=woo-product-table-config' ) . '" title="' . esc_attr__( 'Table Settings', 'woo-product-table' ) . '">' . esc_html__( 'Table Settings', 'woo-product-table' ) . '</a>';
     19        $wpt_links[] = '<a href="' . admin_url( 'edit.php?post_type=wpt_product_table&page=woo-product-table-config' ) . '" title="' . esc_attr__( 'Table Settings', 'woo-product-table' ) . '">' . esc_html__( 'Settings', 'woo-product-table' ) . '</a>';
    1920        // $wpt_links[] = '<a href="https://codeastrology.com/my-support/?utm_source=Product+Table+Dashboard&utm_medium=Free+Version" title="' . esc_attr__( 'CodeAstrology Support', 'woo-product-table' ) . '" target="_blank">'.esc_html__( 'Support','woo-product-table' ).'</a>';
    2021
    … …  
    3839
    3940    if( $browse_plugins ){
    40         return $browse_plugins;//As $res
     41        return wpt_sort_priority_plugins( $browse_plugins );
    4142    }
    4243   
    … …  
    9495    }
    9596   
     97    return wpt_sort_priority_plugins( $res );
     98}
     99
     100/**
     101 * Sort plugins so priority plugins appear at the top in requested order.
     102 *
     103 * @param object $res
     104 * @return object
     105 */
     106function wpt_sort_priority_plugins( $res ) {
     107    if ( empty( $res ) || empty( $res->plugins ) || ! is_array( $res->plugins ) ) {
     108        return $res;
     109    }
     110
     111    $priority_slugs = [
     112        'woo-product-table',
     113        'woo-min-max-quantity-step-control-single',
     114        'wc-quantity-plus-minus-button',
     115        'product-sync-master-sheet',
     116        'sheet-to-wp-table-for-google-sheet',
     117        'woo-add-to-cart-text-change',
     118        'ultraaddons-elementor-lite',
     119        'ca-quick-view',
     120        'anywhere-elementor-template',
     121    ];
     122
     123    $plugin_map = [];
     124    $others     = [];
     125    foreach ( $res->plugins as $plugin ) {
     126        $slug = is_object( $plugin ) ? ( $plugin->slug ?? '' ) : ( $plugin['slug'] ?? '' );
     127        if ( $slug ) {
     128            $plugin_map[ $slug ] = $plugin;
     129        } else {
     130            $others[] = $plugin;
     131        }
     132    }
     133
     134    $sorted = [];
     135    foreach ( $priority_slugs as $slug ) {
     136        if ( isset( $plugin_map[ $slug ] ) ) {
     137            $sorted[] = $plugin_map[ $slug ];
     138            unset( $plugin_map[ $slug ] );
     139        }
     140    }
     141
     142    $res->plugins = array_merge( $sorted, array_values( $plugin_map ), $others );
    96143    return $res;
    97144}
  • woo-product-table/trunk/admin/page-loader.php

    r3772120 r3837744  
    2424        require_once $this->base_dir . 'admin/class-codeastrology-expert-services.php';
    2525        require_once $this->base_dir . 'admin/handle/class-sale-notice.php';
     26        require_once $this->base_dir . 'admin/handle/class-dashboard.php';
     27
     28        $dashboard_handler = new \WOO_PRODUCT_TABLE\Admin\Handle\Dashboard_Handler();
     29        $dashboard_handler->run();
    2630
    2731        $this->is_pro = defined( 'WPT_PRO_DEV_VERSION' );
    … …  
    9599        //has come from admin/menu_plugin_settings_link.php file
    96100        add_action( 'admin_menu', [$this, 'admin_menu'], 2 );
     101        add_action( 'admin_menu', [$this, 'reorder_admin_menu'], 999 );
    97102        add_filter('admin_body_class', [$this, 'body_class']);
    98103        add_action( 'admin_enqueue_scripts', [$this, 'admin_enqueue_scripts'] );
     104        add_action( 'load-edit.php', [$this, 'load_all_tables_page'] );
     105        add_action( 'edit_form_top', [$this, 'render_post_edit_topbar'] );
     106        add_action( 'current_screen', [$this, 'setup_store_audit_topbar'] );
     107        add_action( 'wpt_product_table_page_wpt-free-store-audit', [$this, 'render_audit_topbar'], 1 );
     108        add_action( 'woo-product-table_page_wpt-free-store-audit', [$this, 'render_audit_topbar'], 1 );
    99109
    100110        if ( class_exists( '\WOO_PRODUCT_TABLE\Admin\Appseros\Src\Client' ) ) {
    … …  
    105115    }
    106116
     117    public function dashboard_page_render()
     118    {
     119        include $this->page_folder_dir . 'dashboard.php';
     120    }
     121
     122    public function templates_page_render()
     123    {
     124        include $this->page_folder_dir . 'templates-library.php';
     125    }
     126
     127    public function ecosystem_page_render()
     128    {
     129        include $this->page_folder_dir . 'ecosystem.php';
     130    }
     131
     132    public function load_all_tables_page()
     133    {
     134        global $typenow, $title;
     135        if ( $typenow === 'wpt_product_table' && empty( $_GET['page'] ) ) {
     136            $post_type_object = get_post_type_object( 'wpt_product_table' );
     137            $title = $post_type_object && isset( $post_type_object->labels->name ) ? $post_type_object->labels->name : __( 'Product Tables', 'woo-product-table' );
     138            require_once ABSPATH . 'wp-admin/admin-header.php';
     139            include $this->page_folder_dir . 'all-tables.php';
     140            require_once ABSPATH . 'wp-admin/admin-footer.php';
     141            exit;
     142        }
     143    }
     144
     145    public function render_post_edit_topbar( $post )
     146    {
     147        if ( isset( $post->post_type ) && $post->post_type === 'wpt_product_table' ) {
     148            include $this->topbar_file;
     149        }
     150    }
     151
     152    public function setup_store_audit_topbar( $current_screen )
     153    {
     154        if ( ! is_admin() || empty( $current_screen ) ) {
     155            return;
     156        }
     157
     158        $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
     159        if ( $page !== 'wpt-free-store-audit' ) {
     160            return;
     161        }
     162
     163        global $title;
     164        if ( empty( $title ) ) {
     165            $title = __( 'Free Store Audit', 'woo-product-table' );
     166        }
     167
     168        if ( ! empty( $current_screen->id ) ) {
     169            add_action( $current_screen->id, [$this, 'render_audit_topbar'], 1 );
     170        }
     171    }
     172
     173    public function render_audit_topbar()
     174    {
     175        if ( ! empty( $GLOBALS['wpt_topbar_rendered'] ) ) {
     176            return;
     177        }
     178        $GLOBALS['wpt_topbar_rendered'] = true;
     179
     180        $this->topbar_sub_title = __( 'Get a free expert audit for your WooCommerce store', 'woo-product-table' );
     181        if ( ! empty( $this->topbar_file ) && file_exists( $this->topbar_file ) ) {
     182            include $this->topbar_file;
     183        }
     184    }
     185
    107186    public function configure_page_render()
    108187    {
    … …  
    113192        include $this->page_folder_dir . 'configure.php';
    114193    }
     194
    115195    public function admin_menu()
    116196    {
    117197        $proString = $this->is_pro ? esc_html__( ' Pro', 'woo-product-table' ) : '';
    118         add_submenu_page( $this->main_slug, esc_html__( 'Table Settings ', 'woo-product-table' ) . $proString,  esc_html__( 'Table Settings', 'woo-product-table' ), WPT_CAPABILITY, 'woo-product-table-config', [$this, 'configure_page_render'] );
    119        
     198
     199        // 1. Dashboard (The Main Hub)
     200        add_submenu_page(
     201            $this->main_slug,
     202            esc_html__( 'Dashboard', 'woo-product-table' ),
     203            esc_html__( 'Dashboard', 'woo-product-table' ),
     204            WPT_CAPABILITY,
     205            'wpt-dashboard',
     206            [$this, 'dashboard_page_render'],
     207            1
     208        );
     209
     210        // 2. Starter Templates
     211        add_submenu_page(
     212            $this->main_slug,
     213            esc_html__( 'Templates', 'woo-product-table' ),
     214            esc_html__( 'Templates', 'woo-product-table' ),
     215            WPT_CAPABILITY,
     216            'wpt-templates',
     217            [$this, 'templates_page_render']
     218        );
     219
     220        // 3. Table Settings
     221        add_submenu_page(
     222            $this->main_slug,
     223            esc_html__( 'Table Settings ', 'woo-product-table' ) . $proString,
     224            esc_html__( 'Table Settings', 'woo-product-table' ),
     225            WPT_CAPABILITY,
     226            'woo-product-table-config',
     227            [$this, 'configure_page_render']
     228        );
     229
     230        // 4. Addons & Tools
     231        add_submenu_page(
     232            $this->main_slug,
     233            esc_html__( 'Addons & Tools', 'woo-product-table' ),
     234            esc_html__( 'Addons & Tools', 'woo-product-table' ),
     235            WPT_CAPABILITY,
     236            'wpt-ecosystem',
     237            [$this, 'ecosystem_page_render']
     238        );
    120239
    121240        if (class_exists('\PSSG_Sync_Sheet\App\Handle\Quick_Table')) {
    … …  
    123242        }
    124243       
    125        
     244        // Browse Plugins (legacy route preserved)
    126245        add_submenu_page( $this->main_slug, esc_html__( 'Browse Plugins', 'woo-product-table' ),  esc_html__( 'Browse Plugins', 'woo-product-table' ), WPT_CAPABILITY, 'wpt-browse-plugins', [$this, 'browse_plugins_html'] );
     246
    127247        if( ! $this->is_pro ){
    128248            //Get Premium link
    129             add_submenu_page( $this->main_slug, esc_html__( 'Get Premium', 'woo-product-table' ),  esc_html__( 'Get Premium', 'woo-product-table' ), 'read', 'https://wooproducttable.com/pricing/' );
    130             // add_submenu_page( $this->main_slug, esc_html__( 'Addons', 'woo-product-table' ),  esc_html__( 'Addons', 'woo-product-table' ), WPT_CAPABILITY, 'woo-product-table-addons-list', [$this, 'addons_list_html'] );
    131             // add_submenu_page( $this->main_slug, esc_html__( 'Tutorials', 'woo-product-table' ),  esc_html__( 'Tutorials', 'woo-product-table' ), WPT_CAPABILITY, 'woo-product-table-tutorial-page', [$this, 'html_tutorial_page'] );
    132         }
     249            add_submenu_page( $this->main_slug, esc_html__( 'Get Premium', 'woo-product-table' ),  esc_html__( 'Get Premium', 'woo-product-table' ), 'read', 'https://wooproducttable.com/pricing/?utm_source=admin_menu&utm_medium=menu_item&utm_campaign=get_premium' );
     250        }
     251    }
     252
     253    /**
     254     * Reorder submenus into a clean, intuitive hierarchy.
     255     * Puts Dashboard as the first item so clicking the main menu opens the Dashboard!
     256     * Cleans up repetitive promotional submenus from the left sidebar so it stays focused and uncluttered.
     257     */
     258    public function reorder_admin_menu()
     259    {
     260        // Prevent PHP 8.1+ strip_tags(null) deprecation notice in admin-header.php
     261        // for submenus removed from sidebar but accessed directly via URL/topbar
     262        global $title;
     263        $current_page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
     264        if ( empty( $title ) ) {
     265            if ( $current_page === 'wpt-free-store-audit' ) {
     266                $title = __( 'Free Store Audit', 'woo-product-table' );
     267            } elseif ( $current_page === 'wpt-browse-plugins' ) {
     268                $title = __( 'Browse Plugins', 'woo-product-table' );
     269            }
     270        }
     271
     272        // Remove individual duplicate / promotional items from the left sidebar
     273        // (They are already integrated cleanly inside "Addons & Tools", Dashboard, and the topbar)
     274        remove_submenu_page( $this->main_slug, 'wpt-free-store-audit' );
     275        remove_submenu_page( $this->main_slug, 'wpt-browse-plugins' );
     276
     277        global $submenu;
     278        if ( ! isset( $submenu[$this->main_slug] ) || ! is_array( $submenu[$this->main_slug] ) ) {
     279            return;
     280        }
     281
     282        $menu_items = $submenu[$this->main_slug];
     283        $ordered = [];
     284
     285        // Desired clean, focused order
     286        $priority_slugs = [
     287            'wpt-dashboard',
     288            'edit.php?post_type=wpt_product_table',
     289            'post-new.php?post_type=wpt_product_table',
     290            'wpt-templates',
     291            'woo-product-table-config',
     292            'wpt-ecosystem',
     293            'wpt-product-quick-edit',
     294            'woo-product-table-license',
     295        ];
     296
     297        foreach ( $priority_slugs as $slug ) {
     298            foreach ( $menu_items as $key => $item ) {
     299                if ( isset( $item[2] ) && $item[2] === $slug ) {
     300                    $ordered[] = $item;
     301                    unset( $menu_items[$key] );
     302                    break;
     303                }
     304            }
     305        }
     306
     307        // Append remaining items (like Get Premium for free version or custom items)
     308        foreach ( $menu_items as $item ) {
     309            if ( isset( $item[2] ) && is_string( $item[2] ) && $item[2] !== '' ) {
     310                $ordered[] = $item;
     311            }
     312        }
     313
     314        $submenu[$this->main_slug] = $ordered;
    133315    }
    134316
    … …  
    137319        global $current_screen;
    138320
    139        
    140321        $s_id = isset( $current_screen->id ) ? $current_screen->id : '';
     322        $current_page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
    141323       
    142324        if( $s_id == 'edit-wpt_product_table' || $s_id == 'wpt_product_table' ){
    143             // $classes .= ' wp-default-content-wrapper ';
    144         }else if( strpos( $s_id, $this->plugin_prefix ) !== false ){
     325            $classes .= ' wpt-zero-body wpt-edit-table-page ';
     326        }else if( strpos( $s_id, $this->plugin_prefix ) !== false || strpos( $s_id, 'wpt_product_table' ) !== false || strpos( $s_id, 'wpt-free-store-audit' ) !== false ){
    145327            $classes .= ' wpt-zero-body ';
    146328        }
    147329       
    148        
     330        if ( $current_page === 'wpt-browse-plugins' ) {
     331            $classes .= ' plugin-install-php wpt-browse-plugins-body ';
     332        }
     333
    149334        return $classes;
    150335
    151336    }
     337
    152338    public function admin_enqueue_scripts()
    153339    {
    … …  
    155341
    156342        $s_id = isset( $current_screen->id ) ? $current_screen->id : '';
    157         if( strpos( $s_id, $this->plugin_prefix ) === false ) return;
     343        if( strpos( $s_id, $this->plugin_prefix ) === false && strpos( $s_id, 'wpt_product_table' ) === false && strpos( $s_id, 'wpt-free-store-audit' ) === false ) return;
    158344
    159345        add_filter('admin_footer_text',[$this, 'admin_footer_text']);
    160346
    161 
    162347        $this->live_chat_script();
    163348
    164         wp_register_style( $this->plugin_prefix . '-new-admin', $this->base_url . 'assets/css/new-admin.css', false, $this->dev_version );
     349        $new_admin_css_file = $this->base_dir . 'assets/css/new-admin.css';
     350        $new_admin_css_ver  = file_exists( $new_admin_css_file ) ? filemtime( $new_admin_css_file ) : $this->dev_version;
     351        wp_register_style( $this->plugin_prefix . '-new-admin', $this->base_url . 'assets/css/new-admin.css', false, $new_admin_css_ver );
    165352        wp_enqueue_style( $this->plugin_prefix . '-new-admin' );
    166     }
    167 
     353
     354        $js_ver  = file_exists( $this->base_dir . 'assets/js/wpt-dashboard.js' ) ? filemtime( $this->base_dir . 'assets/js/wpt-dashboard.js' ) : $this->dev_version;
     355        $css_ver = file_exists( $this->base_dir . 'assets/css/wpt-dashboard.css' ) ? filemtime( $this->base_dir . 'assets/css/wpt-dashboard.css' ) : $this->dev_version;
     356
     357        // Enqueue modern clean dashboard styles and script (dependent on wpt-admin so it always overrides)
     358        wp_register_style( 'wpt-modern-dashboard', $this->base_url . 'assets/css/wpt-dashboard.css', [ 'wpt-admin', $this->plugin_prefix . '-new-admin' ], $css_ver );
     359        wp_enqueue_style( 'wpt-modern-dashboard' );
     360
     361        wp_register_script( 'wpt-modern-dashboard-js', $this->base_url . 'assets/js/wpt-dashboard.js', [ 'jquery' ], $js_ver, true );
     362        wp_localize_script( 'wpt-modern-dashboard-js', 'wpt_dashboard_obj', [
     363            'ajax_url'      => admin_url( 'admin-ajax.php' ),
     364            'nonce'         => wp_create_nonce( 'wpt_dashboard_nonce' ),
     365            'tables_url'    => admin_url( 'edit.php?post_type=wpt_product_table' ),
     366            'dashboard_url' => admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-dashboard' ),
     367            'templates_url' => admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-templates' ),
     368            'ecosystem_url' => admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-ecosystem' ),
     369        ] );
     370        wp_enqueue_script( 'wpt-modern-dashboard-js' );
     371
     372        $current_page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '';
     373        if ( $current_page === 'wpt-browse-plugins' ) {
     374            wp_enqueue_script( 'plugin-install' );
     375            wp_enqueue_script( 'updates' );
     376            add_thickbox();
     377        }
     378    }
    168379
    169380    /**
    … …  
    196407        <?php
    197408    }
     409
    198410    public function admin_footer_text($text)
    199411    {
    … …  
    208420        return '<span id="footer-thankyou" class="wpt-footer-thankyou">' . wp_kses_post( $text ) . '</span>';
    209421    }
     422
    210423    public function browse_plugins_html()
    211424    {
    212         //In future, I will make it like min max plugin - which I already did
    213         // add_filter( 'plugins_api_result', [$this, 'plugins_api_result'], 1, 3 );
    214425        $this->topbar_sub_title = __( 'Browse our Plugins','woo-product-table' );
    215426        include $this->topbar_file;
    … …  
    243454        include $this->page_folder_dir . 'addons-list.php';
    244455    }
     456
    245457    public function html_tutorial_page()
    246458    {
    247         //In future, I will make it like min max plugin - which I already did
    248         // add_filter( 'plugins_api_result', [$this, 'plugins_api_result'], 1, 3 );
    249459        $this->topbar_sub_title = __( 'Tutorial','woo-product-table' );
    250460        include $this->topbar_file;
    … …  
    260470        include $this->topbar_file;
    261471        include $this->page_folder_dir . 'product-bulk-edit.php';
    262        
    263472    }
    264473
    … …  
    280489        $this->license_data = get_option($this->license_data_key);
    281490
    282        
    283491        add_action( 'admin_notices', [$this, 'license_activation_message'] );
    284492
    285         /**
    286          * Actually if not found lisen data, we will return null here
    287          *
    288          * @since 3.4.3.0
    289          * @author Saiful Islam <codersaiful@gmail.com>
    290          */
    291493        if( empty( $this->license_status ) || empty( $this->license_data ) ) return;
    292494       
    … …  
    295497        if('lifetime' == $expires) return;
    296498        $exp_timestamp = strtotime($expires);
    297         /**
    298          * keno ami ei timestamp niyechi.
    299          * asole expire a zodi faka ase, tahole ta 1 jan, 1970 as strtotime er output.
    300          *
    301          * ar jehetu amora 2010 er por kaj suru korechi. tai sei expire date ba ager date asar kOnO karonoi nai.
    302          * tai zodi 2012 er kom timestamp ase amora return null kore debo.
    303          * za already diyechi: if( $exp_timestamp < $year2010_timestamp ) return; by this line. niche follow korun.
    304          */
     499
    305500        $year2010_timestamp = strtotime('2023-09-08 23:59:59');
    306501        if( $exp_timestamp < $year2010_timestamp ) return;
    307502
    308         //ekhon amora bortoman date er sathe tulona korbo
    309503        if($exp_timestamp < time()){
    310 
    311504            $this->exp_timestamp = $exp_timestamp;
    312505
    … …  
    316509                update_option( $this->license_status_key, $this->invalid_status );
    317510                update_option( $this->license_data_key, $this->license_data );
    318 
    319                
    320511            }
    321512            add_action( 'admin_notices', [$this, 'renew_license_notice'] );
    322513        }
    323        
    324514    }
    325515
    326516    public function license_activation_message()
    327517    {
    328 
    329518        global $current_screen;
    330519        if(strpos($current_screen->id, 'woo-product-table-license') !== false) return;
    … …  
    345534                <img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-license-brand-logo">
    346535                    Your License of <strong>Woo Product Table pro</strong> is <span style="color: #d00;font-weight:bold;">Invalid/Inactive</span>
    347                     %1$s <a href="%2$s">%3$s</a>
     536                    %1$s <a href="%2$s"><?php echo esc_html( $link_label ); ?></a>
    348537                </div>
    349538            </div>
    … …  
    353542        }
    354543    }
     544
    355545    public function renew_license_notice()
    356546    {
    357 
    358547        if(empty($this->item_id)) return;
    359548        $wpt_logo = WPT_ASSETS_URL . 'images/logo.png';
    … …  
    368557            <img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-license-brand-logo">
    369558                Your License of <strong>Woo Product Table pro</strong> has been expired at <span style="color: #d00;font-weight:bold;"><?php echo esc_html( $expired_date ); ?></span>
    370                 %1$s <a href="%2$s" target="_blank">%3$s</a>
     559                %1$s <a href="<?php echo esc_url( $link ); ?>" target="_blank"><?php echo esc_html( $link_label ); ?></a>
    371560            </div>
    372561        </div>
    … …  
    375564        printf( wp_kses_post( $full_message ), esc_html( $message ), esc_url( $link ), esc_html( $link_label ) );   
    376565    }
    377 
    378    
    379566}
  • woo-product-table/trunk/admin/page/browse-plugins.php

    r3522314 r3837744  
    1 <div class="wrap wpt_wrap wpt-content">
     1<div class="wrap wpt_wrap wpt-content wpt-browse-plugins-page">
    22    <h1 class="wp-heading "></h1>
    33    <div class="fieldwrap">
  • woo-product-table/trunk/admin/page/configure.php

    r3645101 r3837744  
    3939           
    4040            <div class="wpt-configure-form-header">
    41                 <div class="wpt-configure-tab-wrapper wpt-temp-menu-wrapper wpt-section-panel no-background"></div>
    42                 <input type="text" id="wpt-setting-search-input" class="wpt-setting-search-input" placeholder="🔍 Search settings by label/value/anything">
     41                <div class="wpt-configure-tab-wrapper wpt-temp-menu-wrapper wpt-section-panel no-background">
     42                    <a href="#wpt-configurate-main-section" class="tab-button wpt-button link-wpt-configurate-main-section"><?php esc_html_e( 'Settings', 'woo-product-table' ); ?></a>
     43                    <a href="#wpt-basic-settings" class="tab-button wpt-button link-wpt-basic-settings"><?php esc_html_e( 'Basic', 'woo-product-table' ); ?></a>
     44                    <a href="#wpt-label-settings" class="tab-button wpt-button link-wpt-label-settings"><?php esc_html_e( 'Label Text', 'woo-product-table' ); ?></a>
     45                    <a href="#wpt-all-messages-settings" class="tab-button wpt-button link-wpt-all-messages-settings"><?php esc_html_e( 'All Messages', 'woo-product-table' ); ?></a>
     46                    <a href="#show-all" class="tab-button wpt-button"><?php esc_html_e( 'Show All', 'woo-product-table' ); ?></a>
     47                </div>
     48                <input type="text" id="wpt-setting-search-input" class="wpt-setting-search-input" placeholder="<?php esc_attr_e( 'Search settings...', 'woo-product-table' ); ?>">
    4349            </div>
     50
     51            <script>
     52            (function() {
     53                var hash = window.location.hash;
     54                var saved = '';
     55                try { saved = localStorage.getItem('wpt_active_config_tab') || ''; } catch(e){}
     56                var activeTab = hash || saved || '#wpt-configurate-main-section';
     57                if (activeTab && activeTab !== '#show-all') {
     58                    var style = document.createElement('style');
     59                    style.id = 'wpt-instant-tab-css';
     60                    style.innerHTML = '#wpt-main-configuration-form div.wpt-section-panel:not(.wpt-configure-tab-wrapper):not(.wpt-full-form-submit-wrapper):not(' + activeTab + ') { display: none !important; } ' +
     61                                      '#wpt-main-configuration-form div.wpt-section-panel' + activeTab + ' { display: block !important; } ' +
     62                                      '.wpt-configure-tab-wrapper a[href="' + activeTab + '"] { background: #ffffff !important; color: #2563eb !important; font-weight: 600 !important; border: 1px solid #cbd5e1 !important; box-shadow: 0 1px 3px rgba(15,23,42,0.08) !important; }';
     63                    document.head.appendChild(style);
     64                }
     65
     66                // Restore exact scroll position after saving
     67                var savedScrollY = null;
     68                try {
     69                    savedScrollY = sessionStorage.getItem('wpt_saved_scroll_y');
     70                } catch(e) {}
     71
     72                if (savedScrollY !== null) {
     73                    if ('scrollRestoration' in history) {
     74                        history.scrollRestoration = 'manual';
     75                    }
     76                    var targetY = parseInt(savedScrollY, 10);
     77                    if (!isNaN(targetY)) {
     78                        window.scrollTo(0, targetY);
     79                        var restoreScroll = function() {
     80                            window.scrollTo(0, targetY);
     81                        };
     82                        requestAnimationFrame(restoreScroll);
     83                        setTimeout(restoreScroll, 50);
     84                        setTimeout(restoreScroll, 150);
     85                        setTimeout(restoreScroll, 300);
     86                        setTimeout(function() {
     87                            restoreScroll();
     88                            try { sessionStorage.removeItem('wpt_saved_scroll_y'); } catch(e) {}
     89                        }, 500);
     90                    }
     91                }
     92            })();
     93
     94            // Capture exact scroll position right before form submission or save button click
     95            document.addEventListener('submit', function(e) {
     96                if (e.target && e.target.id === 'wpt-main-configuration-form') {
     97                    try {
     98                        var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     99                        sessionStorage.setItem('wpt_saved_scroll_y', y);
     100                        sessionStorage.setItem('wpt_just_saved', 'true');
     101                    } catch(err) {}
     102                }
     103            }, true);
     104
     105            document.addEventListener('click', function(e) {
     106                var btn = e.target && e.target.closest ? e.target.closest('button.configure_submit, .configure_submit') : null;
     107                if (btn) {
     108                    try {
     109                        var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     110                        sessionStorage.setItem('wpt_saved_scroll_y', y);
     111                        sessionStorage.setItem('wpt_just_saved', 'true');
     112                    } catch(err) {}
     113                }
     114            }, true);
     115            </script>
     116
     117
     118
     119
    44120
    45121
    … …  
    57133                                    <div class="wpt-table-header-inside">
    58134                                        <h3><?php echo esc_html__( 'Settings', 'woo-product-table' ); ?></h3>
     135                                        <p class="wpt-section-subtitle"><?php esc_html_e( 'Configure storewide table behaviors, shop archive redirection, and display defaults.', 'woo-product-table' ); ?></p>
    59136                                    </div>
    60137
    61138                                </th>
    62139                                <th>
    63                                     <div class="wpt-table-header-right-side"></div>
     140                                    <div class="wpt-table-header-right-side">
     141                                        <span class="wpt-panel-badge"><i class="wpt-cog-alt"></i> <?php esc_html_e( 'General Preferences', 'woo-product-table' ); ?></span>
     142                                    </div>
    64143                                </th>
    65144                            </tr>
    … …  
    103182            </div>
    104183
     184        <script>
     185        (function($) {
     186            if (!$) return;
     187            if (typeof $.fn.customSelect !== 'function') {
     188                $.fn.customSelect = function (options) {
     189                    const settings = $.extend({
     190                        parentClass: '',
     191                        parentId: '',
     192                        className: ''
     193                    }, options);
     194                    return this.each(function () {
     195                        const $select = $(this);
     196                        var tagName = $select[0].tagName.toLowerCase();
     197                        if (tagName !== 'select') return;
     198
     199                        if ($select.find('option').length > 4) return;
     200                        if ($select.hasClass('wpt_select2')) return;
     201                        if ($select.hasClass('wpt_query_terms')) return;
     202                        if ($select.hasClass('wpt_table__for_variation')) return;
     203                        if ($select.hasClass('wpt_table_on_archive')) return;
     204                        if ($select.hasClass('product_includes_excludes')) return;
     205
     206                        const selectedValue = $select.val();
     207                        const name = $select.attr('name');
     208                        const id = $select.attr('id');
     209
     210                        const attributes = $select[0].attributes;
     211                        const inputAttrs = {};
     212                        var hindenInputClassName = '';
     213                        $.each(attributes, function () {
     214                            if (this.name !== 'class') {
     215                                inputAttrs[this.name] = this.value;
     216                            } else if (this.name == 'class') {
     217                                inputAttrs['backup_class'] = this.value;
     218                                hindenInputClassName = this.value;
     219                            }
     220                        });
     221
     222                        const $wrapper = $('<div class="custom-select-box-wrapper sfl-auto-gen-box"></div>');
     223                        if (settings.parentClass) {
     224                            $wrapper.addClass(settings.parentClass);
     225                        }
     226                        if (settings.parentId) {
     227                            $wrapper.attr('id', settings.parentId);
     228                        }
     229
     230                        const $hiddenInput = $('<input type="hidden">')
     231                            .addClass('custom-select-box-input')
     232                            .val(selectedValue)
     233                            .attr('name', name)
     234                            .attr('id', id)
     235                            .attr(inputAttrs);
     236
     237                        if (settings.className) {
     238                            $hiddenInput.addClass(settings.className);
     239                        }
     240                        $hiddenInput.addClass(hindenInputClassName);
     241
     242                        const $boxesContainer = $('<div class="wpt-custom-select-boxes"></div>');
     243
     244                        $select.find('option').each(function () {
     245                            const $option = $(this);
     246                            const value = $option.val();
     247                            const text = $option.text();
     248                            const isSelected = $option.is(':selected');
     249                            const isDisabled = $option.is(':disabled');
     250
     251                            const $box = $('<div class="wpt-custom-select-box"></div>')
     252                                .text(text)
     253                                .attr('data-value', value);
     254
     255                            if (isSelected) $box.addClass('active');
     256                            if (isDisabled) $box.addClass('disabled');
     257
     258                            $boxesContainer.append($box);
     259                        });
     260
     261                        const $parent = $select.parent();
     262                        const $afterSelectContent = $select.nextAll('p, span, strong, a');
     263                        const $contentWrapper = $('<div class="wpt-extra-content"></div>');
     264                        if ($afterSelectContent.length) {
     265                            $afterSelectContent.each(function () {
     266                                $contentWrapper.append($(this).detach());
     267                            });
     268                        }
     269
     270                        $wrapper.append($hiddenInput).append($boxesContainer).append($contentWrapper);
     271                        $select.replaceWith($wrapper);
     272
     273                        $boxesContainer.on('click', '.wpt-custom-select-box', function (e) {
     274                            e.preventDefault();
     275                            e.stopPropagation();
     276                            const $clicked = $(this);
     277                            if ($clicked.hasClass('disabled')) return;
     278
     279                            $boxesContainer.find('.wpt-custom-select-box').removeClass('active');
     280                            $clicked.addClass('active');
     281                            $hiddenInput.val($clicked.data('value')).trigger('change');
     282                        });
     283                    });
     284                };
     285            }
     286
     287            // Immediately convert configuration form selects before initial paint
     288            $('#wpt-main-configuration-form .wpt-form-control select, #wpt_table_footer_possition, #wpt_cf_search_box').customSelect();
     289        })(window.jQuery);
     290        </script>
    105291        </form>
    106292
  • woo-product-table/trunk/admin/page/topbar.php

    r3522314 r3837744  
    11<?php
    2 $wpt_logo = WPT_ASSETS_URL . 'images/logo.png';
     2/**
     3 * Modern Shared Top Header & Sub-Navigation Bar
     4 *
     5 * Appears at the top of all Woo Product Table admin pages and tabs.
     6 * Matches the unified Product Table Studio design (Image 1).
     7 *
     8 * @package WOO_PRODUCT_TABLE
     9 */
    310
    4 /**
    5  * This following part actually
    6  * for our both version
    7  *
    8  * ekta en vato nd arekta amader mull site laisens er jonno.
    9  * code vato hole to WC_MMQ_PRO::$direct er value null thakbe
    10  * tokhon amra License menu ta ekhane dekhabo na.
    11  *
    12  * ********************
    13  * arekta prosno jagte pare.
    14  * ei lai sense er jonno to ekta property achei amade Page_Loader class e
    15  * tarpor o keno amra ekhane notun kore check korchi.
    16  *
    17  * asoel ei tobbar.php file ta onno class diye o , jemon \WC_MMQ_PRO\Admin\License\Init class eo
    18  * load kora hoyeche. tokhon to $this->license pabe na.
    19  * tai notun kore check korechi.
    20  */
    21 $license_direct = $pro = $license_page_slug = false;
    22 if( class_exists( '\WOO_Product_Table' ) ){
    23     $pro = true;
    24     $license_direct = property_exists( '\WOO_Product_Table','direct' ) ? \WOO_Product_Table::$direct : false;
    25     $license_page_slug = defined('WPT_EDD_LICENSE_PAGE') ? WPT_EDD_LICENSE_PAGE : false;
     11use WOO_PRODUCT_TABLE\Admin\Handle\Dashboard_Handler;
     12
     13if ( ! defined( 'ABSPATH' ) ) {
     14    exit;
    2615}
    27 global $current_screen;
    28 $lisence_page_bool = strpos( $current_screen->id, $license_page_slug );
    2916
    30 $topbar_sub_title = __( 'Manage and Settings', 'woo-product-table' );
    31 if( isset( $this->topbar_sub_title ) && ! empty( $this->topbar_sub_title ) ){
    32     $topbar_sub_title = $this->topbar_sub_title;
     17$GLOBALS['wpt_topbar_rendered'] = true;
     18
     19// 1. Get Metrics & Versions
     20$metrics = class_exists( '\WOO_PRODUCT_TABLE\Admin\Handle\Dashboard_Handler' )
     21    ? Dashboard_Handler::get_metrics()
     22    : [
     23        'plugin_version' => defined( 'WPT_DEV_VERSION' ) ? WPT_DEV_VERSION : '6.1.4.0',
     24        'is_pro'         => defined( 'WPT_PRO_DEV_VERSION' ) || class_exists( '\WOO_Product_Table' ),
     25        'pro_version'    => defined( 'WPT_PRO_DEV_VERSION' ) ? WPT_PRO_DEV_VERSION : '',
     26    ];
     27
     28$brand_logo = defined( 'WPT_BASE_URL' ) ? WPT_BASE_URL . 'assets/images/logo.png' : ( defined( 'WPT_ASSETS_URL' ) ? WPT_ASSETS_URL . 'images/logo.png' : '' );
     29
     30// 2. Navigation URLs
     31$dashboard_url  = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-dashboard' );
     32$all_tables_url = admin_url( 'edit.php?post_type=wpt_product_table' );
     33$new_table_url  = admin_url( 'post-new.php?post_type=wpt_product_table' );
     34$templates_url  = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-templates' );
     35$settings_url   = admin_url( 'edit.php?post_type=wpt_product_table&page=woo-product-table-config' );
     36$ecosystem_url  = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-ecosystem' );
     37$audit_url      = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-free-store-audit' );
     38$browse_url     = admin_url( 'edit.php?post_type=wpt_product_table&page=wpt-browse-plugins' );
     39
     40// License & Pro info
     41$license_page_slug = 'woo-product-table-license';
     42if ( defined( 'WPT_EDD_LICENSE_PAGE' ) ) {
     43    $license_page_slug = WPT_EDD_LICENSE_PAGE;
     44}
     45$license_url = admin_url( 'edit.php?post_type=wpt_product_table&page=' . $license_page_slug );
     46$doc_url     = 'https://wooproducttable.com/documentation/';
     47$pricing_url = 'https://wooproducttable.com/pricing/?utm_source=topbar&utm_medium=button&utm_campaign=get_pro';
     48
     49// 3. Determine Active Tab and Subtitle
     50global $current_screen, $pagenow;
     51$current_page      = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
     52$current_post_type = isset( $_GET['post_type'] ) ? sanitize_text_field( wp_unslash( $_GET['post_type'] ) ) : ( isset( $GLOBALS['typenow'] ) ? $GLOBALS['typenow'] : '' );
     53
     54$active_tab    = 'dashboard';
     55$page_subtitle = __( 'High-Converting Wholesale & Product Tables for WooCommerce', 'woo-product-table' );
     56
     57if ( $current_page === 'wpt-dashboard' ) {
     58    $active_tab    = 'dashboard';
     59    $page_subtitle = __( 'High-Converting Wholesale & Product Tables for WooCommerce', 'woo-product-table' );
     60} elseif ( $current_page === 'wpt-templates' ) {
     61    $active_tab    = 'templates';
     62    $page_subtitle = __( 'Browse and import pre-built, high-converting product table templates', 'woo-product-table' );
     63} elseif ( $current_page === 'woo-product-table-config' ) {
     64    $active_tab    = 'settings';
     65    $page_subtitle = __( 'Configure global table behaviors, query defaults, and UI controls', 'woo-product-table' );
     66} elseif ( $current_page === 'wpt-ecosystem' ) {
     67    $active_tab    = 'ecosystem';
     68    $page_subtitle = __( 'Extend Woo Product Table with powerful companion tools and custom services', 'woo-product-table' );
     69} elseif ( $current_page === 'wpt-free-store-audit' ) {
     70    $active_tab    = 'audit';
     71    $page_subtitle = __( 'Get a free expert audit for your WooCommerce store', 'woo-product-table' );
     72} elseif ( $current_page === 'wpt-browse-plugins' ) {
     73    $active_tab    = 'plugins';
     74    $page_subtitle = __( 'Discover helpful WordPress and WooCommerce plugins by CodeAstrology', 'woo-product-table' );
     75} elseif ( $current_page === $license_page_slug || strpos( (string) $current_page, 'license' ) !== false ) {
     76    $active_tab    = 'license';
     77    $page_subtitle = __( 'Manage your Woo Product Table Pro license and updates', 'woo-product-table' );
     78} elseif ( $current_page === 'wpt-product-quick-edit' ) {
     79    $active_tab    = 'quick-edit';
     80    $page_subtitle = __( 'Quickly edit your WooCommerce products in a bulk sheet table', 'woo-product-table' );
     81} elseif ( $pagenow === 'post-new.php' && $current_post_type === 'wpt_product_table' ) {
     82    $active_tab    = '';
     83    $page_subtitle = __( 'Create a new customized product table for your store', 'woo-product-table' );
     84} elseif ( $pagenow === 'post.php' && $current_post_type === 'wpt_product_table' ) {
     85    $active_tab    = 'all-tables';
     86    $page_subtitle = __( 'Edit table columns, query, design, conditions, and responsive settings', 'woo-product-table' );
     87} elseif ( $pagenow === 'edit.php' && $current_post_type === 'wpt_product_table' && empty( $current_page ) ) {
     88    $active_tab    = 'all-tables';
     89    $page_subtitle = __( 'Manage, edit, copy shortcodes, and scale all your store tables', 'woo-product-table' );
     90}
     91
     92if ( ! empty( $topbar_sub_title ) && is_string( $topbar_sub_title ) && $topbar_sub_title !== __( 'Manage and Settings', 'woo-product-table' ) ) {
     93    $page_subtitle = $topbar_sub_title;
    3394}
    3495?>
    35 <div class="wpt-header wpt-clearfix">
    36     <div class="container-flued">
    37         <div class="col-lg-7">
    38             <div class="wpt-logo-wrapper-area">
    39                 <div class="wpt-logo-area">
    40                     <img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-brand-logo">
    41                 </div>
    42                 <div class="wpt-main-title">
    43                     <h2 class="wpt-ntitle">
    44                         <?php echo esc_html_e("Woo Product Table", 'woo-product-table');?>
    45                     </h2>
    46                 </div>
    47                 <div class="wpt-extra-data">
    48                    
    49                     <span class="wpt-version">v<?php echo esc_html( WPT_DEV_VERSION ); ?></span>
    50                     <?php
    51                     if( wpt_is_pro() ) : ?>
    52                         <span class="wpt-pro-version-data" style="display: block;">
    53                             <span class="title-name"><?php echo esc_html_e("Premium", 'woo-product-table'); ?></span>
    54                             <span class="version-number">v<?php echo esc_html( WPT_PRO_DEV_VERSION ); ?></span>
     96
     97<!-- Sticky Top Navigation Header Group -->
     98<div class="wpt-sticky-header-wrap">
     99    <!-- 1. Modern Top Header with Free & Pro Version Display -->
     100    <header class="wpt-top-header">
     101        <div class="wpt-top-header-left">
     102            <a href="<?php echo esc_url( $dashboard_url ); ?>" style="display: flex; align-items: center; text-decoration: none;">
     103                <img src="<?php echo esc_url( $brand_logo ); ?>" alt="Woo Product Table Logo" class="wpt-brand-icon">
     104            </a>
     105            <div class="wpt-brand-meta">
     106                <div class="wpt-brand-title-row">
     107                    <h1 class="wpt-brand-title">
     108                        <a href="<?php echo esc_url( $dashboard_url ); ?>" style="text-decoration: none; color: inherit;">
     109                            <?php esc_html_e( 'Woo Product Table', 'woo-product-table' ); ?>
     110                        </a>
     111                    </h1>
     112                    <span class="wpt-badge-version" title="<?php esc_attr_e( 'Free Core Version', 'woo-product-table' ); ?>">
     113                        v<?php echo esc_html( $metrics['plugin_version'] ); ?>
     114                    </span>
     115                    <?php if ( ! empty( $metrics['is_pro'] ) ) : ?>
     116                        <span class="wpt-badge-pro" title="<?php esc_attr_e( 'Woo Product Table Pro Active', 'woo-product-table' ); ?>">
     117                            <i class="wpt-heart-filled"></i> PRO <?php echo ! empty( $metrics['pro_version'] ) ? 'v' . esc_html( $metrics['pro_version'] ) : ''; ?>
    55118                        </span>
    56119                    <?php endif; ?>
    57                    
    58120                </div>
    59                 <div class="wpt-main-title wpt-main-title-secondary">
    60                     <h2 class="wpt-ntitle"><?php echo esc_html( $topbar_sub_title );?></h2>
    61                 </div>
    62 
     121                <p class="wpt-brand-subtitle"><?php echo esc_html( $page_subtitle ); ?></p>
    63122            </div>
    64123        </div>
    65         <div class="col-lg-5">
    66             <div class="header-button-wrapper">
    67                 <?php if( ! $pro){ ?>
    68                     <a class="wpt-button reverse"
    69                         href="https://wpprincipal.xyz?demo=wpt"
    70                         title="View Pro Demo - Woo Product Table"
    71                         target="_blank">
    72                             Pro Demo
    73                     </a>
    74                     <a class="wpt-button reverse"
    75                         href="https://wooproducttable.com/pricing/"
    76                         title="Get Premium Woo Product Table - Pricing Page"
    77                         target="_blank">
    78                         <i class="wpt-heart-filled"></i>
    79                         Get Pro
    80                     </a>
    81                 <?php }else if( $license_direct && ! $lisence_page_bool ){ ?>
    82                     <a class="wpt-btn wpt-has-icon"
    83                         href="<?php echo esc_attr( admin_url( 'edit.php?post_type=wpt_product_table&page=' . $license_page_slug ) ) ?>">
    84                         <span><i class=" wpt-heart-1"></i></span>
    85                         License
    86                     </a>
    87                 <?php } ?>
    88                
    89                 <a class="wpt-button reset"
    90                     href="https://wooproducttable.com/documentation/"
    91                     target="_blank">
    92                     <i class="wpt-note"></i>Doc
     124        <div class="wpt-top-header-right">
     125            <a href="<?php echo esc_url( $new_table_url ); ?>" class="wpt-btn-main wpt-btn-primary">
     126                <span>+</span> <?php esc_html_e( 'Create New Table', 'woo-product-table' ); ?>
     127            </a>
     128            <a href="<?php echo esc_url( $doc_url ); ?>" target="_blank" class="wpt-btn-main wpt-btn-secondary">
     129                <i class="wpt-note"></i> <?php esc_html_e( 'Documentation', 'woo-product-table' ); ?>
     130            </a>
     131            <?php if ( empty( $metrics['is_pro'] ) ) : ?>
     132                <a href="<?php echo esc_url( $pricing_url ); ?>" target="_blank" class="wpt-btn-main wpt-btn-pro">
     133                    <i class="wpt-heart-filled"></i> <?php esc_html_e( 'Upgrade to Pro', 'woo-product-table' ); ?>
    93134                </a>
    94                
    95                 <!-- <button class="wpt-btn"><span><i class="wpt-cart"></i></span> Save Chabnge</button> -->
    96             </div>
     135            <?php endif; ?>
    97136        </div>
    98     </div>
     137    </header>
     138
     139    <!-- 2. Modern Sub-Navigation Bar (All Plugin Menus Hub) -->
     140    <nav class="wpt-subnav-bar">
     141        <div class="wpt-subnav-inner">
     142            <a href="<?php echo esc_url( $dashboard_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'dashboard' ? 'active' : ''; ?>" data-tab="dashboard">
     143                <i class="wpt-laptop"></i> <?php esc_html_e( 'Dashboard', 'woo-product-table' ); ?>
     144            </a>
     145            <a href="<?php echo esc_url( $all_tables_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'all-tables' ? 'active' : ''; ?>" data-tab="all-tables">
     146                <i class="wpt-table"></i> <?php esc_html_e( 'All Tables', 'woo-product-table' ); ?>
     147            </a>
     148            <a href="<?php echo esc_url( $templates_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'templates' ? 'active' : ''; ?>" data-tab="templates">
     149                <i class="wpt-table"></i> <?php esc_html_e( 'Templates', 'woo-product-table' ); ?>
     150            </a>
     151            <a href="<?php echo esc_url( $settings_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'settings' ? 'active' : ''; ?>">
     152                <i class="wpt-cog-alt"></i> <?php esc_html_e( 'Settings', 'woo-product-table' ); ?>
     153            </a>
     154            <a href="<?php echo esc_url( $ecosystem_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'ecosystem' ? 'active' : ''; ?>" data-tab="ecosystem">
     155                <i class="wpt-cart"></i> <?php esc_html_e( 'Addons & Tools', 'woo-product-table' ); ?>
     156            </a>
     157            <a href="<?php echo esc_url( $audit_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'audit' ? 'active' : ''; ?>">
     158                <i class="wpt-star-filled"></i> <?php esc_html_e( 'Store Audit', 'woo-product-table' ); ?>
     159            </a>
     160            <a href="<?php echo esc_url( $browse_url ); ?>" class="wpt-subnav-link <?php echo $active_tab === 'plugins' ? 'active' : ''; ?>">
     161                <i class="wpt-arrows-cw"></i> <?php esc_html_e( 'Plugins', 'woo-product-table' ); ?>
     162            </a>
     163            <?php if ( ! empty( $metrics['is_pro'] ) ) : ?>
     164                <a href="<?php echo esc_url( $license_url ); ?>" class="wpt-subnav-link wpt-subnav-license <?php echo $active_tab === 'license' ? 'active' : ''; ?>">
     165                    <i class="wpt-heart-filled"></i> <?php esc_html_e( 'License', 'woo-product-table' ); ?>
     166                </a>
     167            <?php else : ?>
     168                <a href="<?php echo esc_url( $pricing_url ); ?>" target="_blank" class="wpt-subnav-link wpt-subnav-pro">
     169                    <i class="wpt-heart-filled"></i> <?php esc_html_e( 'Get Pro', 'woo-product-table' ); ?>
     170                </a>
     171            <?php endif; ?>
     172        </div>
     173    </nav>
    99174</div>
     175<?php if ( $current_page !== '' ) : // Core post-edit/list screens already output .wp-header-end. ?>
     176<hr class="wp-header-end">
     177<?php endif; ?>
  • woo-product-table/trunk/admin/post_metabox.php

    r3607110 r3837744  
    1717    function wpt_shortcode_metabox(){
    1818
    19         add_meta_box( 'wpt_shortcode_metabox_id', 'Shortcode', 'wpt_shortcode_metabox_render', 'wpt_product_table', 'normal' );
    2019        add_meta_box( 'wpt_shortcode_configuration_metabox_id', 'Table Modification', 'wpt_shortcode_configuration_metabox_render', 'wpt_product_table', 'normal' ); //Added at 4.1.4
    2120        //add_meta_box( 'wpt_column_panel_metabox_id', __( 'Available Columns', 'woo-product-table' ), 'wpt_column_panel_metabox_render', 'wpt_product_table', 'side', 'low' ); //Added at 4.1.4
    … …  
    2322    }
    2423}
     24
     25if( ! function_exists( 'wpt_render_inline_shortcode_box' ) ){
     26    /**
     27     * Render Shortcode card directly beside Title field via edit_form_after_title
     28     * so Title and Shortcode sit cleanly side-by-side above Table Modification.
     29     */
     30    function wpt_render_inline_shortcode_box( $post ){
     31        if ( ! isset( $post->post_type ) || 'wpt_product_table' !== $post->post_type ) {
     32            return;
     33        }
     34        ?>
     35        <div id="wpt_shortcode_metabox_id" class="wpt-top-shortcode-card">
     36            <div class="inside">
     37                <?php wpt_shortcode_metabox_render(); ?>
     38            </div>
     39        </div>
     40        <?php
     41    }
     42}
     43add_action( 'edit_form_after_title', 'wpt_render_inline_shortcode_box' );
     44
     45if( ! function_exists( 'wpt_remove_publish_metabox' ) ){
     46    /**
     47     * Ensure default WordPress Publish metabox is always removed on product table edit screen.
     48     */
     49    function wpt_remove_publish_metabox(){
     50        remove_meta_box( 'submitdiv', 'wpt_product_table', 'side' );
     51    }
     52}
     53add_action( 'add_meta_boxes_wpt_product_table', 'wpt_remove_publish_metabox', 99 );
     54
     55if( ! function_exists( 'wpt_product_table_screen_layout_columns' ) ){
     56    /**
     57     * Restrict Product Table post edit screen to a clean single full-width column.
     58     */
     59    function wpt_product_table_screen_layout_columns( $columns ){
     60        $columns['wpt_product_table'] = 1;
     61        return $columns;
     62    }
     63}
     64add_filter( 'screen_layout_columns', 'wpt_product_table_screen_layout_columns' );
     65
     66if( ! function_exists( 'wpt_product_table_single_column_layout' ) ){
     67    /**
     68     * Force 1-column layout so no blank sidebar space remains after removing Publish box.
     69     */
     70    function wpt_product_table_single_column_layout(){
     71        return 1;
     72    }
     73}
     74add_filter( 'get_user_option_screen_layout_wpt_product_table', 'wpt_product_table_single_column_layout' );
     75
     76if( ! function_exists( 'wpt_force_publish_status_on_save' ) ){
     77    /**
     78     * Automatically publish product tables when saved via the Table Editor form
     79     * (preserving auto-draft on initial page load so default tab values still populate).
     80     */
     81    function wpt_force_publish_status_on_save( $data, $postarr ){
     82        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
     83            return $data;
     84        }
     85        if ( ! isset( $data['post_type'] ) || 'wpt_product_table' !== $data['post_type'] ) {
     86            return $data;
     87        }
     88        $nonce = sanitize_text_field( wp_unslash( $_POST['wpt_shortcode_nonce_value'] ?? '' ) );
     89        if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, plugin_basename( __FILE__ ) ) ) {
     90            return $data;
     91        }
     92
     93        $ptype = get_post_type_object( 'wpt_product_table' );
     94        if ( $ptype && isset( $ptype->cap->publish_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
     95            if ( isset( $data['post_status'] ) && in_array( $data['post_status'], array( 'auto-draft', 'draft', 'pending' ), true ) ) {
     96                $data['post_status'] = 'publish';
     97            }
     98        }
     99
     100        return $data;
     101    }
     102}
     103add_filter( 'wp_insert_post_data', 'wpt_force_publish_status_on_save', 10, 2 );
    25104
    26105if( ! function_exists( 'wpt_column_panel_metabox_render' ) ){
    … …  
    86165        global $post;
    87166        $curent_post_id = $post->ID;
    88         $post_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/',"$1", $post->post_title );
     167        $raw_title = html_entity_decode( wp_strip_all_tags( (string) $post->post_title ), ENT_QUOTES, 'UTF-8' );
     168        $post_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/', '', $raw_title );
     169        $post_title = trim( preg_replace( '/\s+/', ' ', $post_title ) );
     170        $is_published = isset( $post->post_status ) && 'publish' === $post->post_status;
    89171        ?>
     172        <div class="wpt-shortcode-card-head">
     173            <span class="wpt-shortcode-card-label">
     174                <?php esc_html_e( 'Shortcode', 'woo-product-table' ); ?>
     175                <span class="wpt-shortcode-id-pill">#<?php echo esc_html( absint( $curent_post_id ) ); ?></span>
     176            </span>
     177            <span class="wpt-shortcode-quick-links">
     178                <button type="button" id="wpt-top-preview-btn" class="wpt-shortcode-preview-btn" title="<?php esc_attr_e( 'Open Live Table Preview', 'woo-product-table' ); ?>">
     179                    <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
     180                    <span><?php esc_html_e( 'Preview', 'woo-product-table' ); ?></span>
     181                </button>
     182                <span aria-hidden="true">·</span>
     183                <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=page' ) ); ?>"><?php esc_html_e( 'Create new page', 'woo-product-table' ); ?></a>
     184                <span aria-hidden="true">·</span>
     185                <a href="<?php echo esc_url( admin_url( 'edit.php?post_type=page' ) ); ?>"><?php esc_html_e( 'All Pages', 'woo-product-table' ); ?></a>
     186            </span>
     187        </div>
     188
    90189        <div class="wpt-shortcode-box-inside">
    91190            <input type="text" value="[Product_Table id='<?php echo esc_attr( absint( $curent_post_id ) ); ?>' name='<?php echo esc_attr( $post_title ); ?>']" class="wpt_auto_select_n_copy wpt_meta_box_shortcode mb-text-input mb-field" id="wpt_metabox_copy_content" readonly>
    92             <a  class="button button-primary wpt_copy_button_metabox" data-target_id="wpt_metabox_copy_content">Copy</a>
     191            <a class="button button-primary wpt_copy_button_metabox" data-target_id="wpt_metabox_copy_content"><?php esc_html_e( 'Copy', 'woo-product-table' ); ?></a>
    93192            <p class="wpt_metabox_copy_content"></p>
    94193        </div>
    95194
    96195        <p class="wpt-shorcode-render-box">
    97             <strong>First Publish Product Table</strong> and then
    98             copy this shortcode and paste to your desired page.
    99             You can
    100             <a href="<?php echo esc_attr( admin_url('post-new.php?post_type=page') ); ?>">
    101                 Create new page
    102             </a> or  Go to
    103             <a href="<?php echo esc_attr( admin_url('edit.php?post_type=page') ); ?>">
    104                 All Pages
    105             </a>
     196            <?php if ( ! $is_published ) : ?>
     197                <strong><?php esc_html_e( 'First Save Product Table', 'woo-product-table' ); ?></strong> <?php esc_html_e( 'and copy this shortcode to paste into any page.', 'woo-product-table' ); ?>
     198            <?php else : ?>
     199                <?php esc_html_e( 'Copy and paste this shortcode into any page or post to display the table.', 'woo-product-table' ); ?>
     200            <?php endif; ?>
    106201        </p>
    107202
    … …  
    215310
    216311
    217 if( ! function_exists( 'wpt_shortcode_configuration_metabox_save_meta' ) ){
    218 
    219     function wpt_shortcode_configuration_metabox_save_meta( $post_id, $post ) { // save the data
    220        
    221         $nonce = sanitize_text_field( wp_unslash( $_POST['wpt_shortcode_nonce_value'] ?? '' ) );
    222         if ( empty($nonce) || ! wp_verify_nonce( $nonce, plugin_basename(__FILE__) ) ) {
    223             return;
    224         }
    225        
    226 
     312if( ! function_exists( 'wpt_save_table_meta_from_request' ) ){
     313
     314    /**
     315     * Sanitize and persist Product Table metabox configuration fields from POST request.
     316     *
     317     * @param int          $post_id Product table post ID.
     318     * @param WP_Post|null $post    Post object.
     319     * @return void
     320     */
     321    function wpt_save_table_meta_from_request( $post_id, $post = null ) {
     322        $post = $post ?: get_post( $post_id );
    227323        $wpt_import_data = sanitize_text_field( wp_unslash( $_POST['wpt-import-data'] ?? '' ) );
    228324        if( ! empty( $wpt_import_data ) ){
    … …  
    237333             */
    238334            do_action( 'wpto_import_data', $wpt_import_data, $post_id );
    239             return;
    240         }
    241 
    242         /**
    243          * @Hook Filter: wpto_on_save_global_post
    244          * To change/Modify $_POST
    245          * Before Save Data on Database by update_post_meta() func
    246          * @since 6.1.0.5
    247          * @Hook_Version: 6.1.0.5
    248          */
    249 
    250         $save_tab_array = array(
    251             'column_array' => 'column_array',
    252             'column_array_tablet' => 'column_array_tablet',
    253             'column_array_mobile' => 'column_array_mobile',
    254            
    255             'enabled_column_array' => 'enabled_column_array',
    256             'enabled_column_array_tablet' => 'enabled_column_array_tablet',
    257             'enabled_column_array_mobile' => 'enabled_column_array_mobile',
    258            
    259             'column_settings' => 'column_settings',
    260             'column_settings_tablet' => 'column_settings_tablet',
    261             'column_settings_mobile' => 'column_settings_mobile',
    262            
    263             'basics' => 'basics',
    264             'table_style' => 'table_style',
    265             'conditions' => 'conditions',
    266             'mobile' => 'mobile',
    267             'search_n_filter' => 'search_n_filter',
    268             'pagination' => 'pagination',
    269             'config' => 'config',
    270         );
    271 
    272         $save_tab_array = apply_filters( 'wpto_save_tab_array', $save_tab_array, $post_id, $post );
    273 
    274         if( ! is_array( $save_tab_array ) || ( is_array( $save_tab_array ) && count( $save_tab_array ) < 1 )){
     335            if ( function_exists( 'wpt_get_live_preview_transient_key' ) ) {
     336                delete_transient( wpt_get_live_preview_transient_key( $post_id ) );
     337            }
    275338            return;
    276339        }
    … …  
    283346         */
    284347        do_action( 'wpto_on_save_post_before_update_meta', $post_id );
    285        
    286         /**
    287          * In Filter, Availabe Tabs:
    288          * tabs: column_array,column_array_tablet,column_array_mobile,enabled_column_array,
    289          * enabled_column_array_tablet,enabled_column_array_mobile,
    290          * column_settings,column_settings_tablet,column_settings_mobile,
    291          * basics,table_style,conditions,mobile,search_n_filter,pagination,config
    292          *
    293          * @since 2.9.1
    294          */
    295         $filtar_args = array(
    296             'column_array' => array(
    297                 'filter' => FILTER_CALLBACK,
    298                 'flags' => FILTER_REQUIRE_ARRAY,
    299                 'options' => 'sanitize_text_field'
    300             ),
    301             'column_array_tablet' => array(
    302                 'filter' => FILTER_CALLBACK,
    303                 'flags' => FILTER_REQUIRE_ARRAY,
    304                 'options' => 'sanitize_text_field'
    305             ),
    306             'column_array_mobile' => array(
    307                 'filter' => FILTER_CALLBACK,
    308                 'flags' => FILTER_REQUIRE_ARRAY,
    309                 'options' => 'sanitize_text_field'
    310             ),
    311             'enabled_column_array' => array(
    312                 'filter' => FILTER_CALLBACK,
    313                 'flags' => FILTER_REQUIRE_ARRAY,
    314                 'options' => 'sanitize_text_field'
    315             ),
    316             'enabled_column_array_tablet' => array(
    317                 'filter' => FILTER_CALLBACK,
    318                 'flags' => FILTER_REQUIRE_ARRAY,
    319                 'options' => 'sanitize_text_field'
    320             ),
    321             'enabled_column_array_mobile' => array(
    322                 'filter' => FILTER_CALLBACK,
    323                 'flags' => FILTER_REQUIRE_ARRAY,
    324                 'options' => 'sanitize_text_field'
    325             ),
    326             'column_settings' => array(
    327                 'filter' => FILTER_CALLBACK,
    328                 'flags' => FILTER_REQUIRE_ARRAY,
    329                 'options' => 'wp_kses_post'
    330             ),
    331             'column_settings_tablet' => array(
    332                 'filter' => FILTER_CALLBACK,
    333                 'flags' => FILTER_REQUIRE_ARRAY,
    334                 'options' => 'wp_kses_post'
    335             ),
    336             'column_settings_mobile' => array(
    337                 'filter' => FILTER_CALLBACK,
    338                 'flags' => FILTER_REQUIRE_ARRAY,
    339                 'options' => 'wp_kses_post'
    340             ),
    341             'basics' => array(
    342                 'filter' => FILTER_CALLBACK,
    343                 'flags' => FILTER_REQUIRE_ARRAY,
    344                 'options' => 'wp_kses_post'
    345             ),
    346             'table_style' => array(
    347                 'filter' => FILTER_CALLBACK,
    348                 'flags' => FILTER_REQUIRE_ARRAY,
    349                 'options' => 'wp_kses_post'
    350             ),
    351             'conditions' => array(
    352                 'filter' => FILTER_CALLBACK,
    353                 'flags' => FILTER_REQUIRE_ARRAY,
    354                 'options' => 'sanitize_text_field'
    355             ),
    356             'mobile' => array(
    357                 'filter' => FILTER_CALLBACK,
    358                 'flags' => FILTER_REQUIRE_ARRAY,
    359                 'options' => 'sanitize_text_field'
    360             ),
    361             'search_n_filter' => array(
    362                 'filter' => FILTER_CALLBACK,
    363                 'flags' => FILTER_REQUIRE_ARRAY,
    364                 'options' => 'wp_kses_post'
    365             ),
    366             'pagination' => array(
    367                 'filter' => FILTER_CALLBACK,
    368                 'flags' => FILTER_REQUIRE_ARRAY,
    369                 'options' => 'wp_kses_post'
    370             ),
    371             'config' => array(
    372                 'filter' => FILTER_CALLBACK,
    373                 'flags' => FILTER_REQUIRE_ARRAY,
    374                 'options' => 'wp_kses_post'
    375             ),
    376         );
    377         $filtar_args = apply_filters('wpt_data_save_filter_arr', $filtar_args);
    378         $submitte_data = filter_input_array( INPUT_POST, $filtar_args );
    379 
    380         $submitte_data = wpt_remove_empty_value_from_array($submitte_data);
    381 
    382         //Some special Sanitizzze
    383         $table_class = $submitte_data['basics']['table_class'] ?? '';
    384         $submitte_data['basics']['table_class'] = sanitize_html_class( $table_class );
    385         /********* Column Setting Optimizing Start here ***********/
    386 
    387         //Fixing for tablet setting
    388         if( isset( $submitte_data['column_settings_tablet'] ) && ! isset( $submitte_data['enabled_column_array_tablet'] ) ){
    389             unset( $submitte_data['column_settings_tablet'] );
    390         }
    391 
    392        
    393         //Fixing for mobile setting
    394         if( isset( $submitte_data['column_settings_mobile'] ) && ! isset( $submitte_data['enabled_column_array_mobile'] ) ){
    395             unset( $submitte_data['column_settings_mobile'] );
    396         }
    397 
    398         //Optimize for Desktop
    399         if( isset( $submitte_data['column_settings'] ) && is_array( $submitte_data['column_settings'] ) ){
    400             $total_enable_coll_arr = $submitte_data['enabled_column_array'];
    401            
    402             foreach( $submitte_data['column_settings'] as $each_settings ){
    403                 $each_settings = isset( $each_settings['items'] ) && is_array( $each_settings['items'] ) ? array_flip( $each_settings['items'] ) : array();
    404                 $total_enable_coll_arr += $each_settings;
    405             }
    406             $total_enable_coll_arr = array_keys($total_enable_coll_arr);
    407             $total_enable_coll_arr['thumb_variation'] = 'thumb_variation';
    408             $total_enable_coll_arr['title_variation'] = 'title_variation';
    409             $total_enable_coll_arr['description_off'] = 'description_off';
    410 
    411             foreach( $submitte_data['column_settings'] as $u_key => $Ueach_settings ){
    412                 if( isset( $submitte_data['column_settings'][$u_key] ) && ! in_array($u_key,$total_enable_coll_arr)){
    413                     unset( $submitte_data['column_settings'][$u_key] );
    414                 }
    415             }
    416         }
    417 
    418        
    419         //Optimize setting for Tablet
    420         if( isset( $submitte_data['enabled_column_array_tablet'] ) && isset( $submitte_data['column_settings_tablet'] ) && is_array( $submitte_data['column_settings'] ) ){
    421             $total_enable_coll_arr = $submitte_data['enabled_column_array_tablet'];
    422             foreach( $submitte_data['column_settings_tablet'] as $each_settings ){
    423                 $each_settings = isset( $each_settings['items'] ) && is_array( $each_settings['items'] ) ? array_flip( $each_settings['items'] ) : array();
    424                 $total_enable_coll_arr += $each_settings;
    425             }
    426             $total_enable_coll_arr = array_keys($total_enable_coll_arr);
    427             $total_enable_coll_arr['thumb_variation'] = 'thumb_variation';
    428             $total_enable_coll_arr['title_variation'] = 'title_variation';
    429             $total_enable_coll_arr['description_off'] = 'description_off';
    430 
    431             foreach( $submitte_data['column_settings_tablet'] as $u_key => $Ueach_settings ){
    432                 if( isset( $submitte_data['column_settings_tablet'][$u_key] ) && ! in_array($u_key,$total_enable_coll_arr)){
    433                     unset( $submitte_data['column_settings_tablet'][$u_key] );
    434                 }
    435             }
    436         }
    437         //Optimize setting for Mobile
    438         if( isset( $submitte_data['enabled_column_array_mobile'] ) && isset( $submitte_data['column_settings_mobile'] ) && is_array( $submitte_data['column_settings'] ) ){
    439             $total_enable_coll_arr = $submitte_data['enabled_column_array_mobile'];
    440             foreach( $submitte_data['column_settings_mobile'] as $each_settings ){
    441                 $each_settings = isset( $each_settings['items'] ) && is_array( $each_settings['items'] ) ? array_flip( $each_settings['items'] ) : array();
    442                 $total_enable_coll_arr += $each_settings;
    443             }
    444             $total_enable_coll_arr = array_keys($total_enable_coll_arr);
    445             $total_enable_coll_arr['thumb_variation'] = 'thumb_variation';
    446             $total_enable_coll_arr['title_variation'] = 'title_variation';
    447             $total_enable_coll_arr['description_off'] = 'description_off';
    448 
    449             foreach( $submitte_data['column_settings_mobile'] as $u_key => $Ueach_settings ){
    450                 if( isset( $submitte_data['column_settings_mobile'][$u_key] ) && ! in_array($u_key,$total_enable_coll_arr)){
    451                     unset( $submitte_data['column_settings_mobile'][$u_key] );
    452                 }
    453             }
    454         }
    455         /********* Column Setting Optimizing End here ***********/
    456 
    457 
    458 
    459 
    460 
    461         /**
    462          * @Hook wpto_table_data_on_submit
    463          * Save or change data before updated to database.
    464          *
    465          *
    466          * Submitted Tata is optimized for column setting actually
    467          * We only saving data for column setting for desktop,tablet,mobile
    468          *
    469          * @author Saiful Islam <codersaiful@gmail.com>
    470          * @since 3.1.0.1
    471          */
    472         $submitte_data = apply_filters( 'wpto_table_data_on_submit', $submitte_data, $post_id, $save_tab_array );
    473 
    474         /**
    475          * To removed empty/false value from full array
    476          * currently it's inactivated
    477          *
    478          * @since 1.0.4.1
    479          */
    480         foreach( $save_tab_array as $tab ){
    481            
    482             /**
    483              * Already Filtered using filter_input_arry/filter_var_array
    484              *
    485              * @since 2.9.1
    486              */
    487             $tab_data = isset( $submitte_data[$tab] ) ? $submitte_data[$tab] : false;
    488            
    489             /**
    490              * Hook before save tab data
    491              * @Hooked: wpt_data_manipulation_on_save at admin/functions.php
    492              */
    493             $tab_data = apply_filters( 'wpto_tab_data_on_save', $tab_data, $tab, $post_id, $save_tab_array );
    494            
    495             /**
    496              * Hook for Individual Tab data save.
    497              *
    498              * Only for customer use at this moment.
    499              */
    500             $tab_data = apply_filters( 'wpto_tab_data_on_save_' . $tab, $tab_data, $post_id, $save_tab_array );
    501             $tab_data = wpt_remove_empty_value_from_array( $tab_data );
     348
     349        if ( ! function_exists( 'wpt_parse_table_meta_from_request' ) ) {
     350            return;
     351        }
     352
     353        $parsed_meta = wpt_parse_table_meta_from_request( $post_id, $post );
     354        if ( ! is_array( $parsed_meta ) || count( $parsed_meta ) < 1 ) {
     355            return;
     356        }
     357
     358        foreach ( $parsed_meta as $tab => $tab_data ) {
    502359            update_post_meta( $post_id, $tab, $tab_data );
    503360        }
    504        
     361
    505362        /**
    506363         * @Hook Action: wpto_on_save_post
    … …  
    510367         */
    511368        do_action( 'wpto_on_save_post', $post_id );
     369
     370        if ( function_exists( 'wpt_get_live_preview_transient_key' ) ) {
     371            delete_transient( wpt_get_live_preview_transient_key( $post_id ) );
     372        }
     373    }
     374}
     375
     376if( ! function_exists( 'wpt_shortcode_configuration_metabox_save_meta' ) ){
     377
     378    function wpt_shortcode_configuration_metabox_save_meta( $post_id, $post ) { // save the data
     379        $nonce = sanitize_text_field( wp_unslash( $_POST['wpt_shortcode_nonce_value'] ?? '' ) );
     380        if ( empty($nonce) || ! wp_verify_nonce( $nonce, plugin_basename(__FILE__) ) ) {
     381            return;
     382        }
     383
     384        wpt_save_table_meta_from_request( $post_id, $post );
     385
    512386        //flash rewrite rules
    513387        flush_rewrite_rules();
    514388    }
    515389}
    516 add_action( 'save_post', 'wpt_shortcode_configuration_metabox_save_meta', 10, 2 ); //
     390add_action( 'save_post', 'wpt_shortcode_configuration_metabox_save_meta', 10, 2 ); //
     391
     392if( ! function_exists( 'wpt_render_live_preview_modal' ) ){
     393    /**
     394     * Render the Demo 1 Live Table Preview modal at root admin_footer level
     395     * on the Product Table editor screen to avoid metabox stacking issues.
     396     *
     397     * @return void
     398     */
     399    function wpt_render_live_preview_modal(){
     400        if ( ! function_exists( 'get_current_screen' ) ) {
     401            return;
     402        }
     403        $screen = get_current_screen();
     404        if ( ! $screen ) {
     405            return;
     406        }
     407        $is_table_screen = ( 'wpt_product_table' === $screen->post_type ) ||
     408                           ( strpos( $screen->id, 'wpt' ) !== false ) ||
     409                           ( strpos( $screen->id, 'woo-product-table' ) !== false );
     410        if ( ! $is_table_screen ) {
     411            return;
     412        }
     413        global $post;
     414        $table_id     = isset( $post->ID ) ? absint( $post->ID ) : absint( $_GET['post'] ?? 0 );
     415        $embed_url    = $table_id && function_exists( 'wpt_get_live_preview_url' ) ? wpt_get_live_preview_url( $table_id, true ) : '';
     416        $external_url = $table_id && function_exists( 'wpt_get_live_preview_url' ) ? wpt_get_live_preview_url( $table_id, false ) : '';
     417        $table_title  = $table_id ? get_the_title( $table_id ) : '';
     418        $clean_title  = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/', '', $table_title );
     419        $shortcode    = $table_id ? sprintf( '[Product_Table id="%d" name="%s"]', $table_id, esc_attr( $clean_title ) ) : '';
     420        ?>
     421        <div id="wpt-live-preview-backdrop" class="wpt-lp-backdrop" data-embed-url="<?php echo esc_url( $embed_url ); ?>" data-external-url="<?php echo esc_url( $external_url ); ?>" role="dialog" aria-modal="true" aria-labelledby="wpt-lp-modal-heading" hidden>
     422            <div class="wpt-lp-modal">
     423                <div class="wpt-lp-head">
     424                    <div class="wpt-lp-head-left">
     425                        <span class="wpt-lp-head-icon" aria-hidden="true">
     426                            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
     427                        </span>
     428                        <h3 id="wpt-lp-modal-heading" class="wpt-lp-title">
     429                            <?php esc_html_e( 'Live Table Preview', 'woo-product-table' ); ?>
     430                            <span id="wpt-lp-table-title" class="wpt-lp-table-name"><?php echo $table_title ? '— ' . esc_html( $table_title ) : ''; ?></span>
     431                        </h3>
     432                    </div>
     433                    <button type="button" id="wpt-lp-close-btn" class="wpt-lp-close-btn" aria-label="<?php esc_attr_e( 'Close preview', 'woo-product-table' ); ?>">
     434                        &times;
     435                    </button>
     436                </div>
     437
     438                <div class="wpt-lp-toolbar">
     439                    <div class="wpt-lp-toolbar-left">
     440                        <span id="wpt-lp-status" class="wpt-lp-status is-syncing">
     441                            <span class="wpt-lp-dot" aria-hidden="true"></span>
     442                            <span class="wpt-lp-status-text"><?php esc_html_e( 'Loading preview...', 'woo-product-table' ); ?></span>
     443                        </span>
     444                        <button type="button" id="wpt-lp-refresh-btn" class="wpt-lp-tool-btn">
     445                            <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/></svg>
     446                            <span><?php esc_html_e( 'Refresh Preview', 'woo-product-table' ); ?></span>
     447                        </button>
     448                    </div>
     449
     450                    <div class="wpt-lp-toolbar-center">
     451                        <div class="wpt-lp-shortcode-pill" id="wpt-lp-shortcode-wrap" style="<?php echo empty( $shortcode ) ? 'display:none;' : ''; ?>">
     452                            <span class="wpt-lp-shortcode-tag"><?php esc_html_e( 'Shortcode', 'woo-product-table' ); ?></span>
     453                            <code id="wpt-lp-shortcode-val" class="wpt-lp-shortcode-code" title="<?php esc_attr_e( 'Click to copy shortcode', 'woo-product-table' ); ?>"><?php echo esc_html( $shortcode ); ?></code>
     454                            <button type="button" id="wpt-lp-copy-shortcode" class="wpt-lp-copy-btn" data-shortcode="<?php echo esc_attr( $shortcode ); ?>" title="<?php esc_attr_e( 'Copy shortcode to clipboard', 'woo-product-table' ); ?>">
     455                                <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
     456                                <span class="wpt-copy-text"><?php esc_html_e( 'Copy', 'woo-product-table' ); ?></span>
     457                            </button>
     458                        </div>
     459                    </div>
     460
     461                    <div class="wpt-lp-toolbar-right">
     462                        <div class="wpt-lp-device-group" role="group" aria-label="<?php esc_attr_e( 'Preview device width', 'woo-product-table' ); ?>">
     463                            <button type="button" class="wpt-lp-device-btn active" data-device="desktop"><?php esc_html_e( 'Desktop', 'woo-product-table' ); ?></button>
     464                            <button type="button" class="wpt-lp-device-btn" data-device="tablet"><?php esc_html_e( 'Tablet', 'woo-product-table' ); ?></button>
     465                            <button type="button" class="wpt-lp-device-btn" data-device="mobile"><?php esc_html_e( 'Mobile', 'woo-product-table' ); ?></button>
     466                        </div>
     467                        <a href="<?php echo esc_url( $external_url ?: '#' ); ?>" id="wpt-lp-external-link" class="wpt-lp-tool-btn" target="_blank" rel="noopener noreferrer">
     468                            <span><?php esc_html_e( 'Open in New Tab', 'woo-product-table' ); ?> &nearr;</span>
     469                        </a>
     470                    </div>
     471                </div>
     472
     473                <div class="wpt-lp-stage">
     474                    <div id="wpt-lp-viewport" class="wpt-lp-viewport is-desktop">
     475                        <div id="wpt-lp-loading" class="wpt-lp-loading">
     476                            <span class="wpt-lp-spinner" aria-hidden="true"></span>
     477                            <span id="wpt-lp-loading-text"><?php esc_html_e( 'Rendering live table preview...', 'woo-product-table' ); ?></span>
     478                        </div>
     479                        <iframe id="wpt-lp-iframe" name="wpt_lp_iframe" class="wpt-lp-iframe" title="<?php esc_attr_e( 'Woo Product Table Live Preview', 'woo-product-table' ); ?>"></iframe>
     480                    </div>
     481                </div>
     482            </div>
     483        </div>
     484        <?php
     485    }
     486}
     487add_action( 'admin_footer', 'wpt_render_live_preview_modal' );
  • woo-product-table/trunk/admin/post_metabox_form.php

    r3522314 r3837744  
    162162   
    163163    <div class="form_bottom form_bottom_submit_button wrapper_<?php echo esc_attr( $ajax_submit_btn ); ?> ultraaddons-button-wrapper ultraaddons-panel no-background">
    164         <button type="submit" style="display: none;"
    165                 name="wpt_post_submit"
    166                 data-title="<?php echo esc_attr( $post_title ); ?>"
    167                 class="button-primary button-primary primary button <?php echo esc_attr( $ajax_submit_btn ); ?>"
    168                 ><?php esc_html_e( 'Save Change', 'woo-product-table' );?></button>
     164        <input type="hidden" name="post_status" value="publish" />
     165        <button type="button"
     166                id="wpt-open-preview-btn"
     167                class="button wpt-preview-submit-btn">
     168            <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>
     169            <span><?php esc_html_e( 'Live Preview', 'woo-product-table' ); ?></span>
     170        </button>
     171        <button type="submit"
     172                name="wpt_post_submit"
     173                id="wpt-save-table-btn"
     174                data-title="<?php echo esc_attr( $post_title ); ?>"
     175                class="button-primary button-primary primary button wpt-save-submit-btn <?php echo esc_attr( $ajax_submit_btn ); ?>">
     176            <i class="wpt-floppy" aria-hidden="true"></i>
     177            <span><?php esc_html_e( 'Save Change', 'woo-product-table' ); ?></span>
     178        </button>
    169179    </div>
    170180</div>
  • woo-product-table/trunk/admin/tabs/config.php

    r3522314 r3837744  
    449449                            </div>
    450450                            <div class="form-field col-lg-6">
    451                                 <select saiful="config[query_by_url]" id="wpt_table_instant_search_filter" class="wpt_fullwidth ua_input">
     451                                <select saiful="config[query_by_url]" id="wpt_table_query_by_url" class="wpt_fullwidth ua_input">
    452452                                    <option value="">Default</option>
    453453                                    <option value="0">Off</option>
  • woo-product-table/trunk/admin/tabs/inc-column/add-new-column.php

    r3522314 r3837744  
    11
    2 <!-- Add new Custom Collumn -->
    3 <div class="add_new_col_wrapper" data-device="">
    4     <div class="section ultraaddons-panel add_new_column">
    5         <h3 class="with-background dark-background slim-title"><?php echo esc_html__( 'Add New Column','woo-product-table' ); ?> <small style="color: orange; font-size: 12px;"></small></h3>
    6 
    7         <table class="ultraaddons-table">
    8             <tbody>
    9                 <tr>
    10                     <th><label class=""><?php echo esc_html__( 'Column Keyword','woo-product-table' ); ?></label></th>
    11                         <td>
    12                            <input class="and_new_column_key wpt_data_filed_atts column-keyword ua_input" type="text" placeholder="Column Keyword">
    13                         </td>
    14                 </tr>
    15                 <tr>
    16                     <th><label><?php echo esc_html__( 'Column Label','woo-product-table' ); ?></label></th>
    17                         <td>
    18                             <input class="and_new_column_label wpt_data_filed_atts column-label ua_input" type="text" placeholder="Column Label">
    19                         </td>
    20                 </tr>
    21                 <tr>
    22                     <th><label><?php echo esc_html__( 'Column Type','woo-product-table' ); ?></label></th>
    23                         <td>
    24 
     2<!-- Add new Custom Column (Demo 1: Twin Left-Rail Picker - Table-less) -->
     3<div class="add_new_col_wrapper wpt-twin-modal" data-device="">
     4    <div class="section ultraaddons-panel add_new_column wpt-twin-panel">
     5
     6        <?php
     7        $is_pro_active       = wpt_is_pro();
     8        $default_column_type = $is_pro_active ? 'custom_field' : 'taxonomy';
     9
     10        $add_new_col_type = array(
     11            'taxonomy' => __( 'Taxonomy', 'woo-product-table' ),
     12            'default'  => __( 'Type None', 'woo-product-table' ),
     13        );
     14
     15        if ( $is_pro_active ) {
     16            $add_new_col_type = array(
     17                'custom_field' => __( 'Custom Field', 'woo-product-table' ),
     18                'taxonomy'     => __( 'Taxonomy', 'woo-product-table' ),
     19                'default'      => __( 'Type None', 'woo-product-table' ),
     20            );
     21        } else {
     22            $add_new_col_type[] = __( 'Custom Field', 'woo-product-table' );
     23            $add_new_col_type[] = __( 'Blank', 'woo-product-table' );
     24            $add_new_col_type[] = __( 'Advance Custom Field', 'woo-product-table' );
     25            $add_new_col_type[] = __( 'Action Hooks', 'woo-product-table' );
     26            $add_new_col_type[] = __( 'Array type Custom Field', 'woo-product-table' );
     27            $add_new_col_type[] = __( 'Audio File Type', 'woo-product-table' );
     28            $add_new_col_type[] = __( 'All Type Content', 'woo-product-table' );
     29        }
     30
     31        $add_new_col_type = apply_filters( 'wpto_addnew_col_arr', $add_new_col_type, $columns_array, $column_settings, $post );
     32
     33        $fallback_doc_url = 'https://wooproducttable.com/docs/doc/table-options/add-new-custom-column-in-woo-product-table/';
     34
     35        $type_meta_map = array(
     36            'taxonomy'         => array(
     37                'desc'      => __( 'Display categories, tags, brands, or WooCommerce product attributes.', 'woo-product-table' ),
     38                'ph'        => 'product_brand',
     39                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/add-custom-taxonomy-as-table-column/',
     40                'doc_title' => __( 'Taxonomy', 'woo-product-table' ),
     41            ),
     42            'custom_field'     => array(
     43                'desc'      => __( 'Display any post meta or WooCommerce custom field key directly.', 'woo-product-table' ),
     44                'ph'        => '_custom_meta',
     45                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/add-new-column-using-custom-field/',
     46                'doc_title' => __( 'Custom Field', 'woo-product-table' ),
     47            ),
     48            'default'          => array(
     49                'desc'      => __( 'Empty container column where you can group multiple sub-items together.', 'woo-product-table' ),
     50                'ph'        => 'custom_group',
     51                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/select-multiple-inner-items/',
     52                'doc_title' => __( 'Type None (Inner Items)', 'woo-product-table' ),
     53            ),
     54            'acf'              => array(
     55                'desc'      => __( 'Display Advanced Custom Fields (ACF) values, download files, images, or URLs.', 'woo-product-table' ),
     56                'ph'        => 'acf_field_name',
     57                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/how-to-download-file-in-column-using-acf/',
     58                'doc_title' => __( 'ACF', 'woo-product-table' ),
     59            ),
     60            'audio'            => array(
     61                'desc'      => __( 'Play product audio tracks stored in an ACF audio field or file URL.', 'woo-product-table' ),
     62                'ph'        => 'audio_file',
     63                'doc'       => 'https://wooproducttable.com/docs/doc/tutorials/how-to-create-a-audio-table-using-woo-product-table/',
     64                'doc_title' => __( 'Audio Type', 'woo-product-table' ),
     65            ),
     66            'all_content'      => array(
     67                'desc'      => __( 'Universal rich-content column supporting shortcodes, HTML, and dynamic product tags.', 'woo-product-table' ),
     68                'ph'        => 'custom_content',
     69                'doc'       => 'https://wooproducttable.com/docs/doc/advance-uses/add-multiple-content-column/',
     70                'doc_title' => __( 'All Type Content', 'woo-product-table' ),
     71            ),
     72            'single_variation' => array(
     73                'desc'      => __( 'Display a specific WooCommerce variation attribute inside a dedicated column.', 'woo-product-table' ),
     74                'ph'        => 'attribute_pa_color',
     75                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/show-variation-name-in-a-single-column/',
     76                'doc_title' => __( 'Single Variation', 'woo-product-table' ),
     77            ),
     78            'blank'            => array(
     79                'desc'      => __( 'Empty developer column wired to WordPress action hooks for custom PHP output.', 'woo-product-table' ),
     80                'ph'        => 'custom_blank_col',
     81                'doc'       => 'https://wooproducttable.com/docs/doc/advance-uses/how-to-add-custom-column-using-action-and-filter-hooks/',
     82                'doc_title' => __( 'Blank / Hook Column', 'woo-product-table' ),
     83            ),
     84            'hook_action'      => array(
     85                'desc'      => __( 'Execute a WooCommerce or WordPress do_action hook inside every table row.', 'woo-product-table' ),
     86                'ph'        => 'custom_hook_col',
     87                'doc'       => 'https://wooproducttable.com/docs/doc/advance-uses/action-hook-column/',
     88                'doc_title' => __( 'Action Hooks', 'woo-product-table' ),
     89            ),
     90            'array'            => array(
     91                'desc'      => __( 'Extract nested values from serialized array custom fields via comma-separated keys.', 'woo-product-table' ),
     92                'ph'        => 'array_meta_col',
     93                'doc'       => 'https://wooproducttable.com/docs/doc/table-options/add-new-column-using-custom-field/',
     94                'doc_title' => __( 'Array Custom Field', 'woo-product-table' ),
     95            ),
     96            'player-multi'     => array(
     97                'desc'      => __( 'Render a clean HTML5 audio player bar from an ACF audio file or audio URL field.', 'woo-product-table' ),
     98                'ph'        => 'audio_file',
     99                'doc'       => 'https://wooproducttable.com/docs/doc/tutorials/create-an-audio-player-table/',
     100                'doc_title' => __( 'Player 2', 'woo-product-table' ),
     101            ),
     102        );
     103
     104        $default_meta       = $type_meta_map[ $default_column_type ] ?? $type_meta_map['taxonomy'];
     105        $default_type_label = isset( $add_new_col_type[ $default_column_type ] ) ? $add_new_col_type[ $default_column_type ] : __( 'Taxonomy', 'woo-product-table' );
     106        ?>
     107
     108        <!-- Modal Header -->
     109        <div class="wpt-twin-head">
     110            <div class="wpt-twin-head-left">
     111                <span class="wpt-twin-head-icon" aria-hidden="true">
     112                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
     113                </span>
     114                <div>
     115                    <h3 class="wpt-twin-title"><?php echo esc_html__( 'Add Custom Column', 'woo-product-table' ); ?></h3>
     116                    <p class="wpt-twin-subtitle"><?php echo esc_html__( 'Pick a column type on the left, then name your column on the right', 'woo-product-table' ); ?></p>
     117                </div>
     118            </div>
     119            <button type="button" class="wpt-modal-close-btn" aria-label="<?php esc_attr_e( 'Close', 'woo-product-table' ); ?>">&times;</button>
     120        </div>
     121
     122        <!-- Twin Split Body: Left Type Rail + Right Form Workspace -->
     123        <div class="wpt-twin-split">
     124            <aside class="wpt-twin-rail" aria-label="<?php esc_attr_e( 'Column Types', 'woo-product-table' ); ?>">
     125                <div class="wpt-twin-rail-title"><?php esc_html_e( 'Column Type', 'woo-product-table' ); ?></div>
     126                <div class="custom-select-box-wrapper">
     127                    <input type="hidden" class="custom-select-box-input" id="selected_column_type" value="<?php echo esc_attr( $default_column_type ); ?>">
     128                    <?php
     129                    if ( is_array( $add_new_col_type ) && count( $add_new_col_type ) > 1 ) {
     130                        echo '<div class="wpt-custom-select-boxes">';
     131                        foreach ( $add_new_col_type as $an_key => $an_val ) {
     132                            $disable      = is_numeric( $an_key ) ? 'disabled' : '';
     133                            $active_class = ( $an_key == $default_column_type ) ? 'active' : '';
     134                            $meta         = $type_meta_map[ $an_key ] ?? array(
     135                                'desc' => __( 'Custom column data source.', 'woo-product-table' ),
     136                                'ph'   => 'custom_column',
     137                                'doc'  => $fallback_doc_url,
     138                            );
     139                            ?>
     140                            <div class="wpt-custom-select-box <?php echo esc_attr( $disable ); ?> <?php echo esc_attr( $active_class ); ?>"
     141                                 data-value="<?php echo esc_attr( $an_key ); ?>"
     142                                 data-desc="<?php echo esc_attr( $meta['desc'] ); ?>"
     143                                 data-ph="<?php echo esc_attr( $meta['ph'] ); ?>"
     144                                 data-doc="<?php echo esc_attr( $meta['doc'] ); ?>"><?php echo esc_html( $an_val ); ?></div>
     145                            <?php
     146                        }
     147                        echo '</div>';
     148                    }
     149                    ?>
     150                </div>
     151            </aside>
     152
     153            <div class="wpt-twin-workspace">
     154                <div class="wpt-twin-type-banner">
     155                    <div class="wpt-twin-banner-copy">
     156                        <strong id="wpt-twin-type-title"><?php echo esc_html( $default_type_label ); ?></strong>
     157                        <span id="wpt-twin-type-desc"><?php echo esc_html( $default_meta['desc'] ); ?></span>
     158                    </div>
     159                    <a href="<?php echo esc_url( $default_meta['doc'] ); ?>" target="_blank" rel="noopener noreferrer" id="wpt-twin-type-doc" class="wpt-twin-guide-link">
     160                        <?php esc_html_e( 'Guide', 'woo-product-table' ); ?> &rarr;
     161                    </a>
     162                </div>
     163
     164                <div class="wpt-twin-fields">
     165                    <div class="wpt-custom-field">
     166                        <label for="wpt-new-col-label"><?php echo esc_html__( 'Column Label', 'woo-product-table' ); ?></label>
     167                        <input id="wpt-new-col-label" class="and_new_column_label wpt_data_filed_atts column-label ua_input" type="text" placeholder="<?php esc_attr_e( 'e.g. Brand', 'woo-product-table' ); ?>" />
     168                        <span class="wpt-field-helper"><?php esc_html_e( 'Heading shown in the frontend table header', 'woo-product-table' ); ?></span>
     169                    </div>
     170                    <div class="wpt-custom-field">
     171                        <label for="wpt-new-col-key"><?php echo esc_html__( 'Column Keyword', 'woo-product-table' ); ?> <span class="wpt-req-mark">*</span></label>
     172                        <input id="wpt-new-col-key" class="and_new_column_key wpt_data_filed_atts column-keyword ua_input" type="text" placeholder="e.g. <?php echo esc_attr( $default_meta['ph'] ); ?>" />
     173                        <span class="wpt-field-helper"><?php esc_html_e( 'Exact taxonomy slug, meta key, or unique column identifier', 'woo-product-table' ); ?></span>
     174                    </div>
     175                </div>
     176
     177                <details class="wpt-twin-docs-accordion">
     178                    <summary><?php esc_html_e( 'All Tutorial Links', 'woo-product-table' ); ?> &#9662;</summary>
     179                    <div class="add-new-column-doc">
    25180                        <?php
    26                         $default_column_type = 'taxonomy';
    27                         if( wpt_is_pro() ){
    28                             $default_column_type = 'custom_field';
     181                        wpt_doc_link( $fallback_doc_url, __( 'Custom Column Overview', 'woo-product-table' ) );
     182                        $seen_docs = array( $fallback_doc_url => true );
     183                        foreach ( $type_meta_map as $type_meta ) {
     184                            if ( empty( $type_meta['doc'] ) || isset( $seen_docs[ $type_meta['doc'] ] ) ) {
     185                                continue;
     186                            }
     187                            $seen_docs[ $type_meta['doc'] ] = true;
     188                            wpt_doc_link( $type_meta['doc'], $type_meta['doc_title'] );
    29189                        }
    30190                        ?>
    31 
    32                             <div class="custom-select-box-wrapper">
    33                                 <input type="hidden" class="custom-select-box-input" id="selected_column_type" value="<?php echo esc_attr( $default_column_type ); ?>">
    34 
    35                             <?php
    36                                 $add_new_col_type = array(
    37                                     'taxonomy' => __( 'Taxonomy', 'woo-product-table' ),
    38                                     'default' => __( 'Type None', 'woo-product-table' ),
    39                                 );
    40                                
    41                                 if( wpt_is_pro() ){
    42                                     $add_new_col_type = array(
    43                                         'custom_field' => __( 'Custom Field', 'woo-product-table' ),
    44                                         'taxonomy' => __( 'Taxonomy', 'woo-product-table' ),
    45                                         'default' => __( 'Type None', 'woo-product-table' ),
    46                                     );
    47                                 }
    48                                 if( ! wpt_is_pro() ){
    49                                    
    50                                     $add_new_col_type[] = __( 'Custom Field', 'woo-product-table' );
    51                                     $add_new_col_type[] = __( 'Blank', 'woo-product-table' );
    52                                     $add_new_col_type[] = __( 'Advance Custom Field', 'woo-product-table' );
    53                                     $add_new_col_type[] = __( 'Action Hooks', 'woo-product-table' );
    54                                     $add_new_col_type[] = __( 'Array type Custom Field', 'woo-product-table' );
    55                                     $add_new_col_type[] = __( 'Audio File Type', 'woo-product-table' );
    56                                     $add_new_col_type[] = __( 'All Type Content', 'woo-product-table' );
    57                                 }
    58                                
    59                                 $add_new_col_type = apply_filters( 'wpto_addnew_col_arr', $add_new_col_type, $columns_array, $column_settings, $post );
    60                                 if( is_array( $add_new_col_type ) && count( $add_new_col_type ) > 1 ){
    61                                 echo '<div class="wpt-custom-select-boxes">';
    62                                 foreach($add_new_col_type as $an_key => $an_val){
    63                                     $disable = is_numeric($an_key) ? 'disabled' : '';
    64                                     // $pro = is_numeric($an_key) ? __( '(Pro)' ) : '';
    65                                     $active_class = ( $an_key == $default_column_type ) ? 'active' : '';
    66                                     ?>
    67 
    68                                     <div class="wpt-custom-select-box <?php echo esc_attr( $disable ); ?> <?php echo esc_attr( $active_class ); ?>" data-value="<?php echo esc_attr($an_key); ?>"><?php echo esc_html($an_val); ?></div>
    69                                     <?php
    70                                 }
    71                                 echo '</div>';
    72                                 }
    73                             ?> 
    74 
    75                             </div>
    76                            
    77                         </td>
    78                 </tr>
    79                 <tr>
    80                     <th><label><?php echo esc_html__( 'Tutorials','woo-product-table' ); ?></label></th>
    81                         <td class="add-new-column-doc">
    82                             <?php
    83                                 wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/add-new-column-using-custom-field/', 'Custom Field');
    84                                 wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/add-custom-taxonomy-as-table-column/', 'Taxonomy');
    85                                 wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/how-to-download-file-in-column-using-acf/', 'Advance Custom Field (ACF)');
    86                                 wpt_doc_link('#', 'Action Hooks');
    87                                 wpt_doc_link('#', 'Array Type Custom Field');
    88                                 wpt_doc_link('https://wooproducttable.com/docs/doc/tutorials/how-to-create-a-audio-table-using-woo-product-table/', 'Audio File Type');
    89                                 wpt_doc_link('#', 'All Type Content');
    90                                 wpt_doc_link('https://wooproducttable.com/docs/doc/table-options/show-variation-name-in-a-single-column/', 'Single Variation');
    91                              ?>
    92                         </td>
    93                 </tr>
    94             </tbody>
    95         </table>
    96         <button class="wpt-btn wpt-btn-small wpt-has-icon add_new_column_button">
    97             <span><i class="wpt-plus"></i></span>
    98             <strong class="form-submit-text">
    99                 <?php esc_html_e( 'Add New Column', 'woo-product-table' );?>
    100             </strong>
    101         </button>
     191                    </div>
     192                </details>
     193            </div>
     194        </div>
     195
     196        <!-- Modal Footer -->
     197        <div class="wpt-custom-footer">
     198            <span class="wpt-custom-target-badge"><?php esc_html_e( 'Device:', 'woo-product-table' ); ?> <strong id="wpt-custom-device-label"><?php esc_html_e( 'Default', 'woo-product-table' ); ?></strong></span>
     199            <div class="wpt-custom-footer-actions">
     200                <button type="button" class="wpt-custom-cancel-btn"><?php esc_html_e( 'Cancel', 'woo-product-table' ); ?></button>
     201                <button class="wpt-btn wpt-btn-small wpt-has-icon add_new_column_button">
     202                    <span><i class="wpt-plus"></i></span>
     203                    <strong class="form-submit-text"><?php esc_html_e( 'Add New Column', 'woo-product-table' ); ?></strong>
     204                </button>
     205            </div>
     206        </div>
    102207    </div>
    103208</div>
  • woo-product-table/trunk/admin/tabs/inc-column/available-column-list.php

    r3522314 r3837744  
    2929$available_column_array = array_merge( $enabledd_column_array, $available_column_array );
    3030$extra_character = [
    31     'action' => 'add to cart, added, cart, checkout, buy now, purchase, order',
    32     'audio_player' => 'audio, mp3, ogg, wav, music, song',
    33     'quick_qty' => 'quantity, amount, count',
    34     'variation_name' => 'variation, type, model',
    35     'viewed' => 'view, seen, observed, watched',
    36     'category' => 'category, categories, product category',
     31    'action'             => 'add to cart, added, cart, checkout, buy now, purchase, order',
     32    'audio_player'       => 'audio, mp3, ogg, wav, music, song',
     33    'quick_qty'          => 'quantity, amount, count',
     34    'variation_name'     => 'variation, type, model',
     35    'viewed'             => 'view, seen, observed, watched',
     36    'category'           => 'category, categories, product category',
    3737    'toggle_description' => 'toggle, show, hide, description, details',
    38     'stock' => 'stock, availability, in stock, out of stock, backorder, pre-order',
    39     'total' => 'total, total sales, sold, sold out',
    40     'sku' => 'sku, stock keeping unit, product code',
    41     'message' => 'message, note, comment',
    42     'short_description' => 'short description, product details, overview',
    43     'quantity' => 'quantity, amount, count, qty, minimum, maximum, min, max',
    44     'tick' => 'tick, sign, tik, yes, no, true, false',
    45     'check' => 'check,checkbox, yes, no, true, false, checked, unchecked',
    46 ];
     38    'stock'              => 'stock, availability, in stock, out of stock, backorder, pre-order',
     39    'total'              => 'total, total sales, sold, sold out',
     40    'sku'                => 'sku, stock keeping unit, product code',
     41    'message'            => 'message, note, comment',
     42    'short_description'  => 'short description, product details, overview',
     43    'quantity'           => 'quantity, amount, count, qty, minimum, maximum, min, max',
     44    'tick'               => 'tick, sign, tik, yes, no, true, false',
     45    'check'              => 'check,checkbox, yes, no, true, false, checked, unchecked',
     46];
     47
     48$column_category_map = [
     49    'tick'               => 'commerce',
     50    'check'              => 'commerce',
     51    'action'             => 'commerce',
     52    'buy_link'           => 'commerce',
     53    'price'              => 'commerce',
     54    'quantity'           => 'commerce',
     55    'quick_qty'          => 'commerce',
     56    'total'              => 'commerce',
     57    'stock'              => 'commerce',
     58    'quick'              => 'commerce',
     59    'quick_view'         => 'commerce',
     60    'quoterequest'       => 'commerce',
     61    'wishlist'           => 'commerce',
     62    'product_title'      => 'details',
     63    'sku'                => 'details',
     64    'category'           => 'details',
     65    'tags'               => 'details',
     66    'attribute'          => 'details',
     67    'variations'         => 'details',
     68    'variation_name'     => 'details',
     69    'short_description'  => 'details',
     70    'description'        => 'details',
     71    'content'            => 'details',
     72    'toggle_description' => 'details',
     73    'weight'             => 'details',
     74    'length'             => 'details',
     75    'width'              => 'details',
     76    'height'             => 'details',
     77    'rating'             => 'details',
     78    'date'               => 'details',
     79    'modified_date'      => 'details',
     80    'product_id'         => 'details',
     81    'serial_number'      => 'details',
     82    'thumbnails'         => 'media',
     83    'audio_player'       => 'media',
     84    'video'              => 'media',
     85    'message'            => 'media',
     86    'shortcode'          => 'media',
     87    'viewed'             => 'media',
     88    'blank'              => 'media',
     89];
     90
     91$column_descriptions = [
     92    'tick'               => __( 'Bulk selection checkbox', 'woo-product-table' ),
     93    'check'              => __( 'Selection checkbox column', 'woo-product-table' ),
     94    'thumbnails'         => __( 'Product image thumbnail', 'woo-product-table' ),
     95    'product_title'      => __( 'Product name & link', 'woo-product-table' ),
     96    'category'           => __( 'Assigned categories', 'woo-product-table' ),
     97    'tags'               => __( 'Product tag badges', 'woo-product-table' ),
     98    'sku'                => __( 'Unique SKU identifier', 'woo-product-table' ),
     99    'price'              => __( 'Regular & sale price', 'woo-product-table' ),
     100    'quantity'           => __( 'Quantity stepper input', 'woo-product-table' ),
     101    'quick_qty'          => __( 'Instant quantity control', 'woo-product-table' ),
     102    'total'              => __( 'Live line item total', 'woo-product-table' ),
     103    'stock'              => __( 'Inventory availability', 'woo-product-table' ),
     104    'action'             => __( 'Add to cart CTA button', 'woo-product-table' ),
     105    'buy_link'           => __( 'Direct purchase link', 'woo-product-table' ),
     106    'quick'              => __( 'Quick view popup trigger', 'woo-product-table' ),
     107    'quick_view'         => __( 'Quick view modal trigger', 'woo-product-table' ),
     108    'wishlist'           => __( 'Wishlist toggle button', 'woo-product-table' ),
     109    'quoterequest'       => __( 'Quote request action', 'woo-product-table' ),
     110    'rating'             => __( 'Star customer rating', 'woo-product-table' ),
     111    'short_description'  => __( 'Concise product summary', 'woo-product-table' ),
     112    'description'        => __( 'Full product details', 'woo-product-table' ),
     113    'content'            => __( 'Full editor content', 'woo-product-table' ),
     114    'toggle_description' => __( 'Expandable summary drawer', 'woo-product-table' ),
     115    'attribute'          => __( 'Product attributes list', 'woo-product-table' ),
     116    'variations'         => __( 'Inline variation selector', 'woo-product-table' ),
     117    'variation_name'     => __( 'Variation label & options', 'woo-product-table' ),
     118    'weight'             => __( 'Shipping weight value', 'woo-product-table' ),
     119    'length'             => __( 'Product length value', 'woo-product-table' ),
     120    'width'              => __( 'Product width value', 'woo-product-table' ),
     121    'height'             => __( 'Product height value', 'woo-product-table' ),
     122    'date'               => __( 'Publish date display', 'woo-product-table' ),
     123    'modified_date'      => __( 'Last updated date', 'woo-product-table' ),
     124    'product_id'         => __( 'Numeric WooCommerce ID', 'woo-product-table' ),
     125    'serial_number'      => __( 'Row serial counter', 'woo-product-table' ),
     126    'message'            => __( 'Shopper custom note input', 'woo-product-table' ),
     127    'shortcode'          => __( 'Embed inner shortcode', 'woo-product-table' ),
     128    'audio_player'       => __( 'Inline audio preview player', 'woo-product-table' ),
     129    'viewed'             => __( 'Product view counter', 'woo-product-table' ),
     130    'blank'              => __( 'Empty container for sub-items', 'woo-product-table' ),
     131];
     132
     133$category_svg_icons = [
     134    'commerce' => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>',
     135    'details'  => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>',
     136    'media'    => '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',
     137];
     138
     139$total_preset_count = count( $available_column_array );
     140$has_pro_presets    = ! empty( $premium_column );
    47141?>
    48142<!-- Enable Active Column -->
    … …  
    59153                <strong class="form-submit-text">Custom Column</strong>
    60154            </button>
    61             <div id="wpt-dropdown-container" class="wpt-dropdown-container" style="display:none;">
    62                 <div class="wpt-dropdown-container-insider">
    63                     <input type="text" id="wpt-search" placeholder="Search column..." class="wpt-column-search-box" />
    64                     <ul id="wpt-dropdown-list" class="wpt-dropdown-list">
    65                 <?php
    66 
    67                 foreach( $available_column_array as $keyword => $title ){
    68 
    69                     $updated_title = isset( $updated_columns_array[$keyword] ) ? $updated_columns_array[$keyword] : $title;
    70 
    71                     $enabled_class = '';
    72                     if( in_array( $keyword, array_keys( $enabledd_column_array ) ) ){
    73                         $enabled_class = 'item-enabled';
    74                     }
    75 
    76                     //eta specially pro badge dekhanor jonno ebong eta js er maddhome off kore dite hobe, jodi disabled thake
    77                     $premium = in_array( $keyword, array_keys( $premium_column ) ) ? 'premium' : '';
    78                    
    79                 ?>
    80                 <li class="switch-enable-item switch-enable-item-<?php echo esc_attr( $keyword . ' ' . $enabled_class . ' ' . $premium ); ?>"
    81                     data-character ="<?php echo esc_attr( $extra_character[$keyword] ?? '' ); ?>"
    82                     title="<?php echo esc_html( "key: $keyword & title: $updated_title" ); ?>"
    83                     data-column_keyword="<?php echo esc_attr( $keyword ); ?>">
    84                         <?php echo esc_html( $updated_title ); ?><i>[<?php echo esc_html( $keyword ); ?>]</i>
    85                 </li>
    86                 <?php }
    87 
    88                 ?>
    89                     </ul>
     155            <div id="wpt-dropdown-container" class="wpt-dropdown-container wpt-spotlight-modal" style="display:none;">
     156                <div class="wpt-dropdown-container-insider wpt-spotlight-insider">
     157                    <div class="wpt-spotlight-search-hero">
     158                        <span class="wpt-spotlight-search-icon" aria-hidden="true">
     159                            <svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
     160                        </span>
     161                        <input type="text" id="wpt-search" placeholder="<?php esc_attr_e( 'Search preset columns by name, key, or feature...', 'woo-product-table' ); ?>" class="wpt-column-search-box" />
     162                        <span class="wpt-kbd-hint">ESC</span>
     163                        <button type="button" class="wpt-modal-close-btn" aria-label="<?php esc_attr_e( 'Close', 'woo-product-table' ); ?>">&times;</button>
     164                    </div>
     165
     166                    <div class="wpt-preset-active-ribbon">
     167                        <span class="wpt-active-ribbon-label"><?php esc_html_e( 'Active:', 'woo-product-table' ); ?></span>
     168                        <div class="wpt-preset-active-chips"></div>
     169                    </div>
     170
     171                    <div class="wpt-spotlight-body">
     172                        <aside class="wpt-spotlight-rail" aria-label="<?php esc_attr_e( 'Column categories', 'woo-product-table' ); ?>">
     173                            <button type="button" class="wpt-rail-btn active" data-filter="all">
     174                                <span><?php esc_html_e( 'All Columns', 'woo-product-table' ); ?></span>
     175                                <span class="wpt-rail-count"><?php echo esc_html( $total_preset_count ); ?></span>
     176                            </button>
     177                            <button type="button" class="wpt-rail-btn" data-filter="commerce">
     178                                <span><?php esc_html_e( 'Commerce', 'woo-product-table' ); ?></span>
     179                                <span class="wpt-rail-count">0</span>
     180                            </button>
     181                            <button type="button" class="wpt-rail-btn" data-filter="details">
     182                                <span><?php esc_html_e( 'Product Info', 'woo-product-table' ); ?></span>
     183                                <span class="wpt-rail-count">0</span>
     184                            </button>
     185                            <button type="button" class="wpt-rail-btn" data-filter="media">
     186                                <span><?php esc_html_e( 'Media & Extra', 'woo-product-table' ); ?></span>
     187                                <span class="wpt-rail-count">0</span>
     188                            </button>
     189                            <?php if ( $has_pro_presets ) : ?>
     190                                <button type="button" class="wpt-rail-btn wpt-rail-btn--pro" data-filter="premium">
     191                                    <span><?php esc_html_e( 'Pro Columns', 'woo-product-table' ); ?></span>
     192                                    <span class="wpt-rail-count"><?php echo esc_html( count( $premium_column ) ); ?></span>
     193                                </button>
     194                            <?php endif; ?>
     195                        </aside>
     196
     197                        <div class="wpt-spotlight-grid-wrap">
     198                            <ul id="wpt-dropdown-list" class="wpt-dropdown-list">
     199                        <?php
     200
     201                        foreach( $available_column_array as $keyword => $title ){
     202
     203                            $updated_title = isset( $updated_columns_array[$keyword] ) ? $updated_columns_array[$keyword] : $title;
     204
     205                            $enabled_class = '';
     206                            if( in_array( $keyword, array_keys( $enabledd_column_array ) ) ){
     207                                $enabled_class = 'item-enabled';
     208                            }
     209
     210                            //eta specially pro badge dekhanor jonno ebong eta js er maddhome off kore dite hobe, jodi disabled thake
     211                            $premium = in_array( $keyword, array_keys( $premium_column ) ) ? 'premium' : '';
     212                            $col_cat = $column_category_map[ $keyword ] ?? 'media';
     213                            $col_desc = $column_descriptions[ $keyword ] ?? '';
     214                            $cat_icon = $category_svg_icons[ $col_cat ] ?? $category_svg_icons['media'];
     215
     216                        ?>
     217                        <li class="switch-enable-item switch-enable-item-<?php echo esc_attr( $keyword . ' ' . $enabled_class . ' ' . $premium ); ?>"
     218                            data-category="<?php echo esc_attr( $col_cat ); ?>"
     219                            data-character="<?php echo esc_attr( $extra_character[$keyword] ?? '' ); ?>"
     220                            data-label="<?php echo esc_attr( $updated_title ); ?>"
     221                            title="<?php echo esc_attr( "key: $keyword & title: $updated_title" ); ?>"
     222                            data-column_keyword="<?php echo esc_attr( $keyword ); ?>">
     223                                <span class="wpt-preset-card-icon" aria-hidden="true"><?php echo $cat_icon; ?></span>
     224                                <span class="wpt-preset-card-body">
     225                                    <span class="wpt-preset-card-title"><?php echo esc_html( $updated_title ); ?></span>
     226                                    <span class="wpt-preset-card-sub">
     227                                        <i>[<?php echo esc_html( $keyword ); ?>]</i>
     228                                        <?php if ( ! empty( $col_desc ) ) : ?>
     229                                            <span class="wpt-preset-card-desc"><?php echo esc_html( $col_desc ); ?></span>
     230                                        <?php endif; ?>
     231                                    </span>
     232                                </span>
     233                        </li>
     234                        <?php }
     235
     236                        ?>
     237                            </ul>
     238                            <div class="wpt-preset-empty" style="display:none;">
     239                                <?php esc_html_e( 'No matching columns found. Try a different keyword or category.', 'woo-product-table' ); ?>
     240                            </div>
     241                        </div>
     242                    </div>
     243
     244                    <div class="wpt-spotlight-footer">
     245                        <span class="wpt-spotlight-summary"><?php esc_html_e( 'Click any card to add or remove columns', 'woo-product-table' ); ?></span>
     246                        <button type="button" class="wpt-modal-done-btn"><?php esc_html_e( 'Done', 'woo-product-table' ); ?></button>
     247                    </div>
    90248                </div>
    91249            </div>
  • woo-product-table/trunk/admin/tabs/inc-column/column-list.php

    r3522314 r3837744  
    2828        }
    2929        $readOnly = ( $keyword == 'check' ? 'readonly' : false );
     30        $is_custom_col = in_array( $keyword, $additional_collumn ) ? 'wpt-custom-column-item' : '';
    3031    ?>
    31     <li class="wpt_sortable_peritem <?php echo esc_attr( $enabled_class ); ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">
     32    <li class="wpt_sortable_peritem <?php echo esc_attr( $enabled_class ); ?> <?php echo esc_attr( $is_custom_col ); ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">
    3233        <span title="<?php esc_attr_e( 'Move Handle', 'woo-product-table' );?>" class="handle"></span>
    3334        <div class="wpt_shortable_data">
    … …  
    5556            <?php } echo esc_html( $keyword ); ?>
    5657            </span>
     58           
     59           
    5760            <?php
    58            
    59             if( in_array($keyword,$additional_collumn) ){
    60             ?>
    61                 <span title='Remove this Column' onclick="return confirm('Deleting this Column\nAre you sure?');" class='wpt_column_cross'>X</span>
    62             <?php
     61            ob_start();
     62            $current_colum_settings = $column_settings[$keyword] ?? array();
     63            /**
     64             * @Hook wpto_column_basic_form global hook for All column
     65             * and it will show always automatically
     66             *
     67             * Used in free version at
     68             * wpml/admin-area.php to show Language Field based on WPML plugin.
     69             *
     70             *
     71             * @since 3.1.5.0
     72             * @author Saiful Islam <codersaiful@gmail.com>
     73             */
     74            do_action( 'wpto_column_basic_form' , $keyword, $_device_name, $current_colum_settings, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
     75
     76            /**
     77             * Adding Extra Features Based on Specific keyword
     78             *
     79             * *****************************
     80             * @HOOKED at includes/functions.php
     81             * wpto_column_setting_form_thumbnails wpt_thumbnails_column_add 10,2
     82             */
     83            do_action( 'wpto_column_setting_form_' . $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
     84            $single_extra_content = ob_get_clean();
     85            if( !empty( trim( $single_extra_content ) ) ){
     86                echo '<div class="wpt_column_setting_single_extra">' . $single_extra_content . '</div>';
    6387            }
    6488            ?>
    65            
    66            
    67             <div class="wpt_column_setting_single_extra">
    68 
    69                 <?php
    70                 $current_colum_settings = $column_settings[$keyword] ?? array();
    71                 /**
    72                  * @Hook wpto_column_basic_form global hook for All column
    73                  * and it will show always automatically
    74                  *
    75                  * Used in free version at
    76                  * wpml/admin-area.php to show Language Field based on WPML plugin.
    77                  *
    78                  *
    79                  * @since 3.1.5.0
    80                  * @author Saiful Islam <codersaiful@gmail.com>
    81                  */
    82                 do_action( 'wpto_column_basic_form' , $keyword, $_device_name, $current_colum_settings, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
    83 
    84                 /**
    85                  * Adding Extra Features Based on Specific keyword
    86                  *
    87                  * *****************************
    88                  * @HOOKED at includes/functions.php
    89                  * wpto_column_setting_form_thumbnails wpt_thumbnails_column_add 10,2
    90                  */
    91                 do_action( 'wpto_column_setting_form_' . $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ); ?>
    92             </div>
    9389            <span data-key="<?php echo esc_attr( $keyword ); ?>" class="extra_all_on_off on_now"><i class="on_off_icon"></i>Expand</span>
    94             <div class="wpt_column_setting_extra column_setting_form-default for_all extra_all_<?php echo esc_attr( $keyword ); ?>" data-wpt_column_setting_extra="extra_all_<?php echo esc_attr( $keyword ); ?>">
    95                 <?php do_action( 'wpto_column_setting_form_inside_' . $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ); ?>
    96                 <?php
    97                 /**
    98                  * Adding Extra Feature based on action hook
    99                  *
    100                  * *******************************
    101                  * @HOOKED at includes/functions.php
    102                  * wpt_column_add_extra_items 10,7
    103                  * wpt_column_tag_for_all 10,3
    104                  */
    105                
    106                 do_action( 'wpto_column_setting_form', $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data ); ?>
    107                
    108             </div>
    109             <div class="wpt_column_setting_extra for_all profeatures-message">
    110                
    111             </div>
     90            <?php
     91            ob_start();
     92            do_action( 'wpto_column_setting_form_inside_' . $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
     93            /**
     94             * Adding Extra Feature based on action hook
     95             *
     96             * *******************************
     97             * @HOOKED at includes/functions.php
     98             * wpt_column_add_extra_items 10,7
     99             * wpt_column_tag_for_all 10,3
     100             */
     101            do_action( 'wpto_column_setting_form', $keyword, $_device_name, $column_settings, $columns_array, $updated_columns_array, $post, $additional_data );
     102            $extra_content = trim( ob_get_clean() );
     103            ?>
     104            <div class="wpt_column_setting_extra column_setting_form-default for_all extra_all_<?php echo esc_attr( $keyword ); ?>" data-wpt_column_setting_extra="extra_all_<?php echo esc_attr( $keyword ); ?>"><?php echo $extra_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
    112105           
    113106
  • woo-product-table/trunk/admin/tabs/options.php

    r3522314 r3837744  
    143143                   
    144144                <div class="custom-select-box-wrapper sfl-auto-gen-box">
     145                    <?php $pagination_val = ! empty( $meta_basics['pagination'] ) ? $meta_basics['pagination'] : 'on'; ?>
    145146                    <input type="hidden" name="basics[pagination]"
    146                      value="<?php echo esc_attr( $meta_basics['pagination'] ?? 'on' ); ?>"
     147                     value="<?php echo esc_attr( $pagination_val ); ?>"
    147148                     class="custom-select-box-input" id="wpt_table_ajax_pagination">
    148149                    <div class="wpt-custom-select-boxes">
    149                         <div class="wpt-custom-select-box <?php echo isset( $meta_basics['pagination'] ) && $meta_basics['pagination'] == 'on' ? 'active' : ''; ?>"
     150                        <div class="wpt-custom-select-box <?php echo $pagination_val === 'on' ? 'active' : ''; ?>"
    150151                        data-value="on">
    151152                            <?php esc_html_e('Number/Paging','woo-product-table');?>
    152153                        </div>
    153                         <div class="wpt-custom-select-box <?php echo isset( $meta_basics['pagination'] ) && $meta_basics['pagination'] == 'off' ? 'active' : ''; ?>"
     154                        <div class="wpt-custom-select-box <?php echo $pagination_val === 'off' ? 'active' : ''; ?>"
    154155                        data-value="off">
    155156                            <?php esc_html_e('Disable','woo-product-table');?>
    … …  
    158159                        $disabled = ! defined('WPT_PRO_DEV_VERSION') ? 'disabled' : '';
    159160                        ?>
    160                         <div class="wpt-custom-select-box <?php echo esc_attr( $disabled ); ?> <?php echo isset( $meta_basics['pagination'] ) && $meta_basics['pagination'] == 'load_more' ? 'active' : ''; ?>"
     161                        <div class="wpt-custom-select-box <?php echo esc_attr( $disabled ); ?> <?php echo $pagination_val === 'load_more' ? 'active' : ''; ?>"
    161162                        data-value="load_more">
    162163                            <?php esc_html_e('Load More','woo-product-table');?>
    163164                        </div>
    164                         <div class="wpt-custom-select-box <?php echo esc_attr( $disabled ); ?> <?php echo isset( $meta_basics['pagination'] ) && $meta_basics['pagination'] == 'infinite_scroll' ? 'active' : ''; ?>"
     165                        <div class="wpt-custom-select-box <?php echo esc_attr( $disabled ); ?> <?php echo $pagination_val === 'infinite_scroll' ? 'active' : ''; ?>"
    165166                        data-value="infinite_scroll">
    166167                            <?php esc_html_e('Infinite Scroll','woo-product-table');?>
    … …  
    444445            <tr>
    445446                <th>
    446                     <label style="display: inline;width: inherit;" class="wpt_label wpt_column_hide_unhide_tab" for="wpt_wp_force"><?php esc_html_e( 'DataTable', 'woo-product-table' );?></label>
     447                    <label style="display: inline;width: inherit;" class="wpt_label wpt_column_hide_unhide_tab" for="wpt_datatable"><?php esc_html_e( 'DataTable', 'woo-product-table' );?></label>
    447448                </th>
    448449                <td>
  • woo-product-table/trunk/admin/tabs/query.php

    r3522314 r3837744  
    195195                        </select><span class="select2 select2-container select2-container--default select2-container--below" dir="ltr" data-select2-id="104" style="width: 1px;"><span class="selection"><span class="select2-selection select2-selection--multiple" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="-1" aria-disabled="false"><ul class="select2-selection__rendered"><li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" placeholder="" style="width: 0.75em;"></li></ul></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span><span class="select2 select2-container select2-container--default select2-container--focus select2-container--open select2-container--above" dir="ltr" data-select2-id="122" style="width: auto;"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>
    196196                        <p class="notice-for-variations" style="display: none;">Please select only variable products</p>
    197                         <p>Choose your selected product to make a table with selected product from your while store. To select multiple products at a time, Please press [CTRL + S]</p>
     197                        <p>Choose your selected product to make a table with selected product from your whole store. To select multiple products at a time, hold Ctrl (or Cmd) while clicking.</p>
    198198                    </td>
    199199                </tr>
  • woo-product-table/trunk/admin/tabs/search_n_filter.php

    r3522314 r3837744  
    530530                        ?>
    531531                    </select>
    532 
    533                    
    534                     </p>
    535532                </td>
    536533            </tr>
  • woo-product-table/trunk/admin/wpt_product_table_post.php

    r3522314 r3837744  
    8787
    8888        if ( 'wpt_product_table' == get_post_type() ){
    89         $default['wpt_shortcode'] = "Shortcode";
    90                 if(isset( $default['date'] )) unset($default['date']);
     89            $default['wpt_shortcode'] = __( 'Embed Shortcode (1-Click Copy)', 'woo-product-table' );
     90            if(isset( $default['date'] )) unset($default['date']);
    9191        }
    9292        return $default;
    … …  
    100100
    101101        if ($column_name == 'wpt_shortcode') {
    102             $post_title = get_the_title( $post_id );
    103             $post_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/',"$1", $post_title );
    104                         ?>
    105                         <input class='wpt_auto_select_n_copy' type='text'
    106                          value='[Product_Table id="<?php echo esc_attr( absint( $post_id ) ); ?>" name="<?php echo esc_attr( $post_title ); ?>"]' id='wpt_shotcode_content_<?php echo esc_attr( absint( $post_id ) ); ?>' readonly>
    107                          <a class="button button-primary wpt_copy_button_metabox wpt_copy_button_metabox-column" data-target_id="wpt_shotcode_content_<?php echo esc_attr( absint( $post_id ) ); ?>"><?php echo esc_html__( 'Copy','woo-product-table' ); ?></a>
    108                          <p class="wpt_shotcode_content_column wpt_shotcode_content_<?php echo esc_attr( absint( $post_id ) ); ?>"></p>
    109                         <?php
     102            $post_title  = get_the_title( $post_id );
     103            $clean_title = preg_replace( '/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/', '', $post_title );
     104            $shortcode   = sprintf( '[Product_Table id="%d" name="%s"]', absint( $post_id ), esc_attr( $clean_title ) );
     105            ?>
     106            <div class="wpt-shortcode-field">
     107                <code class="wpt-shortcode-text"><?php echo esc_html( $shortcode ); ?></code>
     108                <button type="button" class="wpt-copy-btn" title="<?php esc_attr_e( 'Click to Copy Shortcode', 'woo-product-table' ); ?>">
     109                    <i class="wpt-copy"></i> <?php esc_html_e( 'Copy', 'woo-product-table' ); ?>
     110                </button>
     111            </div>
     112            <input type="hidden" class="wpt_auto_select_n_copy" value="<?php echo esc_attr( $shortcode ); ?>" id="wpt_shotcode_content_<?php echo esc_attr( absint( $post_id ) ); ?>">
     113            <?php
    110114        } 
    111115    }
  • woo-product-table/trunk/assets/css/admin.css

    r3522314 r3837744  
    14291429
    14301430tr.user_can_not_edit>td:first-child:before {
    1431     content: "Pro";
    1432     background: #ff1100;
    1433     color: white;
    1434     padding: 0px 5px;
    1435     border-radius: 4px;
    1436     z-index: 2;
    1437     font-size: 10px;
    1438     position: absolute;
    1439     right: 0;
    1440     top: 0;
    1441     border: 0 navajowhite;
    1442     left: unset;
     1431    display: none;
    14431432}
    14441433.wpt-premium-feature-in-free-version tr.user_can_not_edit>td:first-child:before{display: none;}
    … …  
    16141603}
    16151604.wpt-header.wpt-clearfix:before {display:block}
    1616 form#wpt-main-configuration-form  .float-btn.wpt-btn {
    1617     opacity: 0;
    1618     /* top: 70px; */
    1619     right: -80px;
    1620     transition: .4s all;
    1621     display: none;
    1622 }
    1623 form#wpt-main-configuration-form  #stick_on_scroll-on {
    1624     position: fixed;
    1625     bottom: unset;
    1626     right: 0;
    1627     box-shadow: 0px 10px 30px 0 #00000061;
    1628     padding: 0 2px 0 0 !important;
    1629     font-size: 16px;
    1630     font-weight: normal;
    1631     border-radius: unset;
    1632     z-index: 99999;
    1633     display: none;
    1634     top: 450px;
    1635     left: unset;
    1636     margin: 0;
    1637     opacity: 1;
    1638 }
    1639 form#wpt-main-configuration-form #stick_on_scroll-on span {
    1640     width: 60px;
    1641     padding: 16 0;
    1642     margin-right: 0;
    1643 }
    1644 form#wpt-main-configuration-form #stick_on_scroll-on span i{
    1645     font-size: 22px;
    1646 }
    1647 form#wpt-main-configuration-form #stick_on_scroll-on>strong {
    1648     font-size: 10px;
    1649     font-weight: 100;
    1650     transform: rotate(90deg);
    1651     display: inline-block;
    1652     letter-spacing: 1px;
    1653     width: 28px;
    1654     text-align: center;
    1655 }
    1656 form#wpt-main-configuration-form  #stick_on_scroll-on.stick_on_scroll-on{
    1657     display: block;
     1605form#wpt-main-configuration-form  .float-btn.wpt-btn,
     1606form#wpt-main-configuration-form  #stick_on_scroll-on,
     1607form#wpt-main-configuration-form  #stick_on_scroll-on.stick_on_scroll-on {
     1608    display: none !important;
    16581609}
    16591610
    … …  
    23322283    content: attr(title);
    23332284    position: absolute;
    2334     top: 0;
    2335     min-width: 500px;
    2336     width: 100%;
    2337     max-width: 100%;
    2338     left: 25px;
    2339     background: #007694;
    2340     border: 1px solid #007694;
    2341     padding: 5px;
    2342     box-shadow: 0px 5px 19px 0 #00000040;
    2343     border-radius: 6px;
     2285    bottom: calc(100% + 8px);
     2286    top: auto;
     2287    right: 0;
     2288    left: auto;
     2289    min-width: 240px;
     2290    width: max-content;
     2291    max-width: 340px;
     2292    white-space: normal;
     2293    background: #0f172a;
     2294    border: 1px solid #0f172a;
     2295    padding: 8px 12px;
     2296    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.22);
     2297    border-radius: 8px;
    23442298    text-align: left;
    2345     color: white;
     2299    color: #ffffff;
    23462300    display: block !important;
    2347     line-height: 16px;
    2348     font-size: 14px;
     2301    line-height: 1.45;
     2302    font-size: 12.5px;
     2303    font-weight: 400;
     2304    z-index: 9999;
     2305    pointer-events: none;
    23492306}
    23502307span.wpt-help-icon:hover {
    … …  
    24142371    align-items: center;
    24152372}
    2416 .wpt-custom-select-boxes {
    2417     display: flex;
     2373/* Modern Option Segmented Control (Pill Button Groups) */
     2374.wpt-custom-select-boxes,
     2375.sfl-auto-gen-box .wpt-custom-select-boxes {
     2376    display: inline-flex;
    24182377    flex-wrap: wrap;
    2419     gap: 8px;
    2420     justify-content: flex-start;
    2421     align-items: stretch;
    2422 }
    2423 
    2424 .wpt-custom-select-box {
    2425     padding: 9px 13px;
    2426     border: 1px solid #656565;
     2378    align-items: center;
     2379    background: #f1f5f9;
     2380    padding: 3px;
     2381    border: 1px solid #e2e8f0;
     2382    border-radius: 9px;
     2383    gap: 3px;
     2384    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
     2385}
     2386
     2387.wpt-custom-select-box,
     2388.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box {
     2389    padding: 6px 14px;
     2390    border: none;
    24272391    border-radius: 6px;
    2428     /* transition: 0.3s; */
    24292392    cursor: pointer;
    2430     border-style: dashed;
     2393    font-size: 13px;
    24312394    font-weight: 500;
    2432     background: #0073aa14;
    2433     color: black;
    2434 }
    2435 
    2436 .wpt-custom-select-box:hover {
    2437     background-color: #0073aa36;
    2438 }
    2439 
    2440 .wpt-custom-select-box.active {
    2441     background-color: #0073aa;
    2442     color: #fff;
    2443     border-color: #0073aa;
    2444 }
    2445 
    2446 .wpt-custom-select-box.disabled {
    2447     background-color: #f1f1f1;
    2448     color: #999;
     2395    line-height: 1.35;
     2396    background: transparent;
     2397    color: #475569;
     2398    box-shadow: none;
     2399    transition: all 0.15s ease-in-out;
     2400    display: inline-flex;
     2401    align-items: center;
     2402    justify-content: center;
     2403    user-select: none;
     2404}
     2405
     2406.wpt-custom-select-box:hover,
     2407.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box:hover {
     2408    color: #0f172a;
     2409    background-color: rgba(255, 255, 255, 0.7);
     2410}
     2411
     2412.wpt-custom-select-box.active,
     2413.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box.active {
     2414    background: #2563eb;
     2415    color: #ffffff;
     2416    font-weight: 600;
     2417    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.28);
     2418}
     2419
     2420.wpt-custom-select-box.disabled,
     2421.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box.disabled {
     2422    background: transparent;
     2423    color: #94a3b8;
    24492424    cursor: not-allowed;
    2450     border-style: dashed;
    2451     position: relative;
    2452     opacity: 0.8;
    2453     border-color: #a7a7a7;
    2454 }
    2455 .wpt-custom-select-box.disabled:hover {
    2456     background-color: #e0e0e0;
    2457     color: #999;
    2458     cursor: not-allowed;
    2459     border-style: dashed;
    2460 }
    2461 .wpt-extra-content>* {
    2462     padding: 0;
    2463     margin: 0 !important;
    2464 }
    2465 .sfl-auto-gen-box .wpt-custom-select-boxes {
    2466     gap: 0;
    2467     border: 1px #0073aa;
    2468     border-style: double;
    2469     border-radius: 6px;
    2470     overflow: hidden;
    2471     flex-wrap: nowrap;
    2472     flex-direction: row;
    2473 }
    2474 .sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box {
    2475     border-radius: 0;
    2476     border: 0 none;
    2477 }
    2478 .sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box.active {
    2479     color: white;
    2480     background: #0073aa;
    2481 }
    2482 
    2483 .sfl-auto-gen-box .wpt-custom-select-boxes {
    2484     border-color: #0073aa;
    2485     border-radius: 2px;
    2486 }
    2487 
    2488 .sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box {
    2489     background: #ededed61;
    2490     color: black;
    2491     box-shadow: 1px 0px 1px #00000062;
     2425    opacity: 0.5;
     2426    box-shadow: none;
     2427}
     2428
     2429.wpt-custom-select-box.disabled:hover,
     2430.sfl-auto-gen-box .wpt-custom-select-boxes .wpt-custom-select-box.disabled:hover {
     2431    background: transparent;
     2432    color: #94a3b8;
    24922433}
    24932434
    … …  
    27532694span.wpt-query-selection-handle.type-pf-premium:after,
    27542695.wpt-custom-select-box.disabled::after,
    2755 .wpt-template-item.wpt-temp-type-limited:after,
    2756 .wpt-premium-feature-in-free-version>*:before {
     2696.wpt-template-item.wpt-temp-type-limited:after {
    27572697    content: "Pro";
    27582698    position: absolute;
    2759     background: red;
     2699    background: #7c3aed;
    27602700    right: 0;
    27612701    top: 0;
    … …  
    27742714    position: relative;
    27752715}
    2776 .wpt-premium-feature-in-free-version div,.wpt-premium-feature-in-free-version table, .wpt-premium-feature-in-free-version tr, .wpt-premium-feature-in-free-version td {
     2716.wpt-premium-feature-in-free-version div,
     2717.wpt-premium-feature-in-free-version table {
    27772718    background: transparent;
    27782719}
    … …  
    28892830}
    28902831.wpt-setting-search-input{
    2891     margin: 2px !important;
    2892     /* flex: 1; */
    2893     width: 400px;
    2894     max-width: 100%;
    2895     min-width: 300px;
    2896    
     2832    margin: 0 !important;
     2833    width: 220px;
     2834    max-width: 240px;
     2835    min-width: 180px;
    28972836    background: rgb(255, 255, 255) !important;
    28982837}
    28992838input#wpt-setting-search-input {
    29002839    padding: 3px 10px;
    2901     margin: 2px !important;
    2902     flex: 1;
     2840    margin: 0 !important;
     2841    flex: 0 0 auto;
    29032842}
    29042843.wpt_shotcode_content_column{color: green;font-weight:bold;display:none; padding-left: 12px;}
  • woo-product-table/trunk/assets/css/base-template.css

    r3522314 r3837744  
    528528 flex-wrap: wrap;
    529529 flex-direction: column;
     530 align-items: flex-start;
    530531 flex-basis: 100%;
    531532}
  • woo-product-table/trunk/assets/css/expert-services.css

    r3772120 r3837744  
    349349        background: #fff;
    350350        box-shadow: 0 10px 30px rgba(16, 42, 72, .08);
    351         opacity: 0.15;
    352         transition: opacity 0.3s ease-in-out;
     351        opacity: 1;
     352        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    353353}
    354354.caes-payment-section:hover {
    355         opacity: 1;
    356         cursor: pointer;
     355        border-color: #cbd5e1;
     356        box-shadow: 0 14px 34px rgba(16, 42, 72, .12);
    357357}
    358358
  • woo-product-table/trunk/assets/css/new-admin.css

    r3522314 r3837744  
    3535    background: #ffffff;
    3636    display: flow-root;
    37     /* flex-basis: 100%; */
    38 }
    39 .wpt-header.wpt-clearfix.topbar-fixed-on-scroll {
    40     position: fixed;
    41     width: 100%;
    42     background: white;
     37    position: -webkit-sticky;
     38    position: sticky;
     39    top: 32px;
    4340    z-index: 999;
    44     box-shadow: 0 4px 10px #0000001a;
    45 }
    46 @media (max-width: 779px) {
    47     .wpt-header.wpt-clearfix.topbar-fixed-on-scroll {
    48         top: 0;
     41    transition: box-shadow 0.2s ease;
     42}
     43@media (max-width: 782px) {
     44    .wpt-header {
     45        top: 46px;
    4946    }
    5047    .header-button-wrapper{
    … …  
    5249    }
    5350}
     51@media (max-width: 600px) {
     52    .wpt-header {
     53        top: 0;
     54    }
     55}
     56.wpt-header.wpt-clearfix.topbar-fixed-on-scroll {
     57    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
     58}
    5459.topbar-fixed-on-scroll-main-element{
    55     margin-top: 200px;
     60    margin-top: 0;
    5661}
    5762.wpt-clearfix:before, .wpt-clearfix:after {
    … …  
    264269
    265270a.wpt-button, button.wpt-button {
    266     padding: 11px 19px 12px 18px;
    267     font-weight: 600;
     271    padding: 8px 16px;
     272    font-weight: 500;
    268273    cursor: pointer;
    269274    text-align: center;
    270     text-transform: uppercase;
    271     letter-spacing: -0.023em;
    272     border: none;
    273     border-radius: 0;
    274     color: #fff;
    275     background-color: #607D8B;
     275    text-transform: none;
     276    letter-spacing: 0;
     277    border: 1px solid #cbd5e1;
     278    border-radius: 8px;
     279    color: #475569;
     280    background-color: #ffffff;
    276281    text-decoration: none;
     282    display: inline-flex;
     283    align-items: center;
     284    gap: 6px;
     285    transition: all 0.18s ease;
    277286}
    278287
    279288a.wpt-button:hover, button.wpt-button:hover {
    280     background-color: #0073aa;
     289    background-color: #f8fafc;
     290    color: #0f172a;
     291    border-color: #94a3b8;
    281292}
    282293a.wpt-button.reverse, button.wpt-button.reverse {
    283     background-color: #0073aa;
     294    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
     295    border-color: #1d4ed8;
     296    color: #ffffff;
     297    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
    284298}
    285299a.wpt-button.reverse:hover, button.wpt-button.reverse:hover {
    286     background-color: #607D8B;
     300    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
     301    color: #ffffff;
     302    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
    287303}
    288304a.wpt-button.reset {
    289     background: #e3e3e3;
    290     color: #747272;
     305    background: #ffffff;
     306    border: 1px solid #cbd5e1;
     307    color: #64748b;
    291308}
    292309a.wpt-button.reset:hover {
    293     background: #ebebeb;
    294     color: #3e3a3a;
     310    background: #fef2f2;
     311    border-color: #fca5a5;
     312    color: #ef4444;
    295313}
    296314.wpt-btn {
    297     display: inline-block;
     315    display: inline-flex;
     316    align-items: center;
     317    justify-content: center;
     318    gap: 8px;
    298319    vertical-align: middle;
    299320    margin: 0;
    300     font-family: "Open Sans", Arial, sans-serif;
    301     font-size: 14px;
    302     line-height: normal;
     321    font-family: inherit;
     322    font-size: 13.5px;
     323    line-height: 1.4;
    303324    cursor: pointer;
    304325    text-decoration: none;
    305     padding: 11px 19px 12px 18px;
    306     font-weight: 800;
     326    padding: 9px 20px;
     327    font-weight: 600;
    307328    text-align: center;
    308     text-transform: uppercase;
    309     letter-spacing: -0.025em;
    310     border: none;
    311     border-radius: 2px;
     329    text-transform: none;
     330    letter-spacing: 0;
     331    border: 1px solid #1d4ed8;
     332    border-radius: 8px;
    312333    color: #fff;
    313     background-color: #0073aa;
     334    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    314335    white-space: nowrap;
     336    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
     337    transition: all 0.18s ease;
    315338}
    316339.wpt-btn strong{
    317     font-weight: 800;
     340    font-weight: 600;
    318341}
    319342.wpt-btn.round {
    320     border-radius: 22px;
     343    border-radius: 9999px;
    321344}
    322345.wpt-btn.wpt-btn-small {
    323     padding: 9px 18px 9px 18px;
    324     font-weight: normal;
     346    padding: 7px 14px;
     347    font-size: 12.5px;
     348    font-weight: 500;
    325349    text-transform: none;
    326350}
    327351.wpt-btn.wpt-btn-tiny {
    328     padding: 8px 16px 8px 16px;
    329     font-weight: normal;
     352    padding: 5px 10px;
     353    font-size: 12px;
     354    font-weight: 500;
    330355    text-transform: none;
    331356}
    332357.wpt-btn.reset {
    333     background-color: #9E9E9E;
     358    background: #ffffff;
     359    border: 1px solid #cbd5e1;
     360    color: #64748b;
     361    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    334362}
    335363.wpt-btn:hover {
    336364    color: white;
    337     background-color: #607D8B;
     365    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
     366    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
     367    transform: translateY(-1px);
     368}
     369.wpt-btn.reset:hover {
     370    color: #ef4444;
     371    border-color: #fca5a5;
     372    background: #fef2f2;
     373    transform: translateY(-1px);
     374    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.15);
    338375}
    339376.wpt-btn.wpt-has-icon{
    340     padding: 0 30px 0 0;
     377    padding: 9px 20px;
    341378}
    342379.wpt-btn.wpt-btn-tiny.wpt-has-icon {
    343     padding: 0 8px 0 0;
     380    padding: 5px 10px;
    344381}
    345382.wpt-btn span {
    346     display: inline-block;
    347     text-align: center;
    348     width: 46px;
    349     padding: 14px 0;
    350     margin-right: 14px;
    351     border-radius: 4px 0 0 4px;
    352     background: #00000042;
     383    display: inline-flex;
     384    align-items: center;
     385    justify-content: center;
     386    width: auto;
     387    padding: 0;
     388    margin-right: 2px;
     389    border-radius: 0;
     390    background: transparent;
    353391}
    354392
    … …  
    468506    }
    469507    .topbar-fixed-on-scroll .header-button-wrapper {
    470         justify-content: flex-start;
     508        justify-content: flex-end;
    471509    }
    472510    .wrap.wpt_wrap.wpt-content {
    … …  
    572610    font-family: "wptfontelo";
    573611    text-align: center;
    574     padding-top: 6px !important;
     612    padding-top: 6px;
    575613    font-size: 10px;
    576614    color: white;
  • woo-product-table/trunk/assets/css/universal.css

    r3584643 r3837744  
    3939}
    4040.wpt-td-tag.wpt_action{
    41  text-align: right !important;
     41 text-align: left;
    4242}
    4343
    … …  
    19381938 }
    19391939}
     1940
     1941/* Keep Action variations and controls cleanly left-aligned when Action is not last */
     1942body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action form.variations_form.cart {
     1943  display: flex;
     1944  flex-direction: column;
     1945  align-items: flex-start;
     1946  flex-basis: 100%;
     1947  width: 100%;
     1948}
     1949
     1950body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action table.variations {
     1951  width: auto;
     1952  margin: 0 0 8px 0;
     1953}
     1954
     1955body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action table.variations th,
     1956body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action table.variations td {
     1957  text-align: left;
     1958  padding-left: 0;
     1959}
     1960
     1961body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action table.variations th {
     1962  padding-right: 10px;
     1963}
     1964
     1965body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action .wpt_varition_section {
     1966  display: inline-flex;
     1967  flex-wrap: wrap;
     1968  justify-content: flex-start;
     1969  align-items: center;
     1970  gap: 6px 10px;
     1971  margin: 0 0 8px 0;
     1972  width: auto;
     1973  max-width: 100%;
     1974}
     1975
     1976body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action .variation-wrapper {
     1977  display: inline-flex;
     1978  align-items: center;
     1979  justify-content: flex-start;
     1980  gap: 8px;
     1981}
     1982
     1983body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action .reset_variations[style*="hidden"],
     1984body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action .variation-wrapper.reset:has(.reset_variations[style*="hidden"]) {
     1985  display: none !important;
     1986}
     1987
     1988/* Right-align Action column header and controls only when it is the last column */
     1989body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-thead-tag .wpt-tr-tag.wpt_table_head > .wpt-th-tag.wpt_action:last-child {
     1990  text-align: right;
     1991}
     1992
     1993body.wpt_table_body div.wpt_column_sort #wpt_table.wpt-table-tag.wpt_product_table > .wpt-thead-tag > .wpt-tr-tag.wpt_table_head > .wpt-th-tag.wpt_action:last-child {
     1994  padding-right: 28px;
     1995}
     1996
     1997body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child,
     1998body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child p.stock,
     1999body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_message,
     2000body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .item_inside_cell {
     2001  text-align: right;
     2002}
     2003
     2004body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.td_or_cell.wpt_action:last-child > div,
     2005body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.product_type_simple > .wpt-td-tag.wpt_action:last-child > div,
     2006body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.inner-available.wpt_action:last-child,
     2007body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.cart,
     2008body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_varition_section,
     2009body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .variation-wrapper,
     2010body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap .woocommerce-variation-add-to-cart.variations_button {
     2011  justify-content: flex-end;
     2012}
     2013
     2014body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart,
     2015body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap,
     2016body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap .woocommerce-variation.single_variation {
     2017  align-items: flex-end;
     2018}
     2019
     2020body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations,
     2021body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_varition_section {
     2022  margin: 0 0 8px auto;
     2023}
     2024
     2025body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations th,
     2026body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations td {
     2027  text-align: right;
     2028}
     2029
     2030body.wpt_table_body .wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations td {
     2031  padding-right: 0;
     2032}
     2033
     2034@media only screen and (max-width: 767px) {
     2035  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child,
     2036  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child p.stock,
     2037  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_message,
     2038  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .item_inside_cell,
     2039  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations th,
     2040  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations td {
     2041    text-align: left;
     2042  }
     2043
     2044  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child table.variations,
     2045  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_varition_section {
     2046    margin-left: 0;
     2047  }
     2048
     2049  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.td_or_cell.wpt_action:last-child > div,
     2050  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.product_type_simple > .wpt-td-tag.wpt_action:last-child > div,
     2051  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.inner-available.wpt_action:last-child,
     2052  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.cart,
     2053  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .wpt_varition_section,
     2054  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child .variation-wrapper,
     2055  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap .woocommerce-variation-add-to-cart.variations_button {
     2056    justify-content: flex-start;
     2057  }
     2058
     2059  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart,
     2060  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap,
     2061  body.wpt_table_body .wpt-auto-responsive.wpt-wrap .wpt-table-tag .wpt-tbody-tag .wpt-tr-tag.wpt_row > .wpt-td-tag.wpt_action:last-child form.variations_form.cart .single_variation_wrap .woocommerce-variation.single_variation {
     2062    align-items: flex-start;
     2063  }
     2064}
  • woo-product-table/trunk/assets/js/admin.js

    r3522314 r3837744  
    105105
    106106            // Click behavior
    107             $boxesContainer.on('click', '.wpt-custom-select-box', function () {
     107            $boxesContainer.on('click', '.wpt-custom-select-box', function (e) {
     108                e.preventDefault();
     109                e.stopPropagation();
    108110                const $clicked = $(this);
    109111                if ($clicked.hasClass('disabled')) return;
    … …  
    121123(function($) {
    122124    'use strict';
     125
     126    function detect_responsive_stats(){
     127        var detect_responsive = [];
     128        $('body.wpt_admin_body #inside-tablet li.wpt_sortable_peritem.enabled .wpt_shortable_data input.colum_data_input,body.wpt_admin_body #inside-mobile li.wpt_sortable_peritem.enabled .wpt_shortable_data input.colum_data_input').each(function(Index) {
     129            detect_responsive[Index] = 1;
     130        });
     131
     132        var hid_respn_field = $('#hidden_responsive_data');
     133        if( detect_responsive.length > 0 ){
     134            hid_respn_field.val('no_responsive');
     135        }else{
     136            hid_respn_field.val('mobile_responsive');
     137        }
     138    }
     139
    123140    $(document).ready(function() {
    124141        if(! $('body').hasClass('wpt_admin_body')){
    125142            return false;
    126143        }
     144
     145        // Convert select dropdowns to custom buttons immediately to prevent FOUC / layout flash
     146        $('#wpt-main-configuration-form .wpt-form-control select,#wpt_table_footer_possition,#wpt_cf_search_box').customSelect();
     147        configureTabAreaAdded('#wpt-main-configuration-form'); //Specially for Configure Page
     148        configureTabAreaAdded('.fieldwrap.wpt_result_footer.ultraaddons.pro_version'); //From inside on Edit Table
     149
     150        // Restore exact scroll position after saving
     151        var savedScrollY = null;
     152        try {
     153            savedScrollY = sessionStorage.getItem('wpt_saved_scroll_y');
     154        } catch(e) {}
     155        if (savedScrollY !== null) {
     156            if ('scrollRestoration' in history) {
     157                history.scrollRestoration = 'manual';
     158            }
     159            var targetY = parseInt(savedScrollY, 10);
     160            if (!isNaN(targetY)) {
     161                window.scrollTo(0, targetY);
     162                setTimeout(function() {
     163                    window.scrollTo(0, targetY);
     164                }, 50);
     165                setTimeout(function() {
     166                    window.scrollTo(0, targetY);
     167                    try { sessionStorage.removeItem('wpt_saved_scroll_y'); } catch(e) {}
     168                }, 200);
     169            }
     170        }
     171
     172        // Show success notification after saving settings and restoring position
     173        try {
     174            if (sessionStorage.getItem('wpt_just_saved') === 'true') {
     175                sessionStorage.removeItem('wpt_just_saved');
     176                if (typeof WPT_ADMIN_CONTROL !== 'undefined' && typeof WPT_ADMIN_CONTROL.showNotification === 'function') {
     177                    WPT_ADMIN_CONTROL.showNotification('Settings saved successfully!', 'success');
     178                }
     179            }
     180        } catch(e) {}
    127181
    128182        $(document).on('click', '.wpt-offer-notice .notice-dismiss', function () {
    … …  
    230284       
    231285        $(document.body).on('click','a.my-inslide-close-button.button',function(){
    232             $('.inside-column-enabled').fadeOut().removeClass('inside-column-enabled');
     286            $('.inside-column-enabled').fadeOut(150, function(){
     287                $(this).removeClass('inside-column-enabled').css('display', '');
     288            });
    233289        });
    234290        $(document.body).on('click',function(event){
    235291            var inside_item = $('.inside-column-enabled').length;
    236292            if (inside_item > 0 && $(event.target).closest(".wpt_shortable_data").length === 0) {
    237                 $('.inside-column-enabled').fadeOut().removeClass('inside-column-enabled');
    238               }
     293                $('.inside-column-enabled').fadeOut(150, function(){
     294                    $(this).removeClass('inside-column-enabled').css('display', '');
     295                });
     296            }
    239297        });
    240298
    … …  
    327385        //code for Sortable
    328386        $( ".wpt_column_sortable" ).sortable({
    329             handle:'.handle',
     387            handle: '.handle:not(.checkbox_handle)',
     388            axis: 'y',
     389            tolerance: 'pointer',
    330390            stop: removeAjax,
    331391        });
    … …  
    337397       
    338398       
    339         $(document).on('click','.colum_data_input, .wpt-expand',function(){
    340             var parents = $(this).parents('.wpt_shortable_data');
     399        $(document).on('click','.wpt-expand, .extra_all_on_off',function(e){
     400            e.preventDefault();
     401            var parents = $(this).closest('.wpt_shortable_data');
     402            var li = $(this).closest('li.wpt_sortable_peritem');
    341403            var onOff = parents.children('.extra_all_on_off');
     404            var wptExpand = parents.children('.wpt-expand');
    342405            var extras = parents.children('.wpt_column_setting_extra');
    343             extras.toggle('medium',function(){
    344                 var status = $(this).attr('data-status');
    345                 if(status == 'expanded'){
    346                     onOff.removeClass('off_now');
    347                     onOff.addClass('on_now');
    348                     onOff.html("Expand");
    349                     onOff.attr('data-status','expanded');
    350                     extras.parents('li').removeClass('expanded_li');
    351                     $(this).attr('data-status','collapsed');
    352                 }else{
    353                    
    354                     onOff.removeClass('on_now');
    355                     onOff.addClass('off_now');
    356                     onOff.html("Collapse");
    357                     onOff.attr('data-status','collapsed');
    358                     extras.parents('li').addClass('expanded_li');
    359                     $(this).attr('data-status','expanded');
    360                 }
    361                
    362             });
     406            var isExpanded = li.hasClass('expanded_li');
     407
     408            if(isExpanded){
     409                li.removeClass('expanded_li');
     410                onOff.removeClass('off_now').addClass('on_now').html("Expand").attr('data-status','collapsed');
     411                wptExpand.html('<i class="wpt-expand-collapse"></i>Expand');
     412                extras.attr('data-status','collapsed');
     413            }else{
     414                li.addClass('expanded_li');
     415                onOff.removeClass('on_now').addClass('off_now').html("Collapse").attr('data-status','expanded');
     416                wptExpand.html('<i class="wpt-expand-collapse"></i>Collapse');
     417                extras.attr('data-status','expanded');
     418            }
    363419        });
    364420       
    … …  
    393449           
    394450        }
    395         $(document).on('click','span.extra_all_on_off',function(){
    396             var key = $(this).data('key');
    397             var thisExpand = $(this);
    398             $('.wpt_column_setting_extra.extra_all_' + key).toggle('medium',function(){
    399                 var status = thisExpand.attr('data-status');
    400                 if(status == 'expanded'){
    401                     thisExpand.removeClass('off_now');
    402                     thisExpand.addClass('on_now');
    403                     thisExpand.parents('li').removeClass('expanded_li');
    404                     thisExpand.html("Expand");
    405                     thisExpand.attr('data-status','collapsed');
    406                 }else{
    407                     thisExpand.removeClass('on_now');
    408                     thisExpand.addClass('off_now');
    409                     thisExpand.parents('li').addClass('expanded_li');
    410                     thisExpand.html("Collapse");
    411                     thisExpand.attr('data-status','expanded');
    412                 }
    413                
    414                
    415                
    416             });
    417            
    418         });
     451
    419452        $(document).on('click','ul#wpt_column_sortable>li.wpt_sortable_peritem.enabled .wpt_column_arrow',function(){
    420453            var target = $(this).attr('data-target');
    … …  
    466499        if (tabName && selectTabContent.length > 0) {
    467500            var currentTab = $('body.wpt_admin_body #wpt_configuration_form #' + tabName);
    468             if( ! currentTab.hasClass('tab-content-active')){
    469                 removingActiveClass();
    470                 currentTab.addClass('tab-content-active');
    471                 $('body.wpt_admin_body #wpt_configuration_form .nav-tab-wrapper a.wpt_nav_tab.wpt_nav_for_' + tabName).addClass('nav-tab-active');
    472             }
    473            
     501            if (currentTab.length > 0 && currentTab.hasClass('wpt_tab_content')) {
     502                if (!currentTab.hasClass('tab-content-active')) {
     503                    removingActiveClass();
     504                    currentTab.addClass('tab-content-active');
     505                    $('body.wpt_admin_body #wpt_configuration_form .nav-tab-wrapper a.wpt_nav_tab.wpt_nav_for_' + tabName).addClass('nav-tab-active');
     506                }
     507            }
     508        }
     509        if (selectTabContent.length > 0 && selectTabContent.filter('.tab-content-active').length === 0) {
     510            removingActiveClass();
     511            selectLinkTab.first().addClass('nav-tab-active');
     512            selectTabContent.first().addClass('tab-content-active');
    474513        }
    475514       
    … …  
    655694                });
    656695                $('.switch-enable-item-' + keyword).removeClass('item-enabled');
    657                 targetLiSelector.fadeOut(function(){
    658                     targetLiSelector.removeClass('enabled');
    659                 });
     696                if (targetLiSelector.hasClass('wpt-custom-column-item') || targetLiSelector.find('span.wpt_column_cross').length > 0) {
     697                    targetLiSelector.fadeOut('fast', function(){
     698                        $(this).remove();
     699                        detect_responsive_stats();
     700                    });
     701                } else {
     702                    targetLiSelector.fadeOut(function(){
     703                        targetLiSelector.removeClass('enabled');
     704                    });
     705                }
    660706            }
    661707            OptimizeColumnWithName();
    … …  
    672718
    673719            $mainWrapper.find('.wpt-col-selected-pre-value').html(enabledItemsText);
     720            syncPresetModalState($mainWrapper.find('.wpt-dropdown-container'));
    674721        });
    675722       
    676723        detect_responsive_stats();
    677         function detect_responsive_stats(){
    678             var detect_responsive;
    679             detect_responsive = [];
    680             $('body.wpt_admin_body #inside-tablet li.wpt_sortable_peritem.enabled .wpt_shortable_data input.colum_data_input,body.wpt_admin_body #inside-mobile li.wpt_sortable_peritem.enabled .wpt_shortable_data input.colum_data_input').each(function(Index) {
    681                 detect_responsive[Index] = 1;
    682             });
    683 
    684             var hid_respn_field = $('#hidden_responsive_data');
    685             if( detect_responsive.length > 0 ){
    686                 hid_respn_field.val('no_responsive');
    687             }else{
    688                 hid_respn_field.val('mobile_responsive');
    689             }
    690         }
    691724        /**
    692725         * For Hide on Mobile
    … …  
    722755            keyword = taxt_cf_type + taxt_cf_input;
    723756           
    724             html = '<li class="wpt_sortable_peritem column_keyword_' + keyword + ' enabled">';
     757            html = '<li class="wpt_sortable_peritem wpt-custom-column-item column_keyword_' + keyword + ' enabled">';
    725758                html += '<span title="Move Handle" class="handle ui-sortable-handle"></span>';
    726759                html += '<div class="wpt_shortable_data">';
    727760                    html += '<input name="column_array[' + keyword + ']" data-column_title="' + taxt_cf_title + '" data-keyword="' + keyword + '" class="colum_data_input product_id" type="text" value="' + taxt_cf_title + '">';
    728                     html += "<span class='wpt_column_cross'>X</span>";
    729761                html += '</div>';
    730762                html += '<span title="Move Handle" class="handle checkbox_handle ui-sortable-handle">';
    … …  
    753785        $('.wpt-design-tab-area-wrapper td select,.wpt_column select').customSelect();
    754786
    755         $(document.body).on('click','.wpt-custom-select-box', function() {
     787        $(document.body).on('click','.wpt-custom-select-box', function(e) {
     788            e.preventDefault();
    756789            if ($(this).hasClass('disabled')) return;
    757790            var wrapper = $(this).closest('.custom-select-box-wrapper');
    … …  
    806839
    807840            var html = '';
    808             html = '<li class="wpt_sortable_peritem column_keyword_' + keyword + ' enabled">';
     841            html = '<li class="wpt_sortable_peritem wpt-custom-column-item column_keyword_' + keyword + ' enabled">';
    809842                html += '<span title="Move Handle" class="handle ui-sortable-handle"></span>';
    810843                html += '<input type="hidden" name="column_settings' + device + '[' + keyword + '][type]" value="' + type + '">';
    … …  
    813846                    html += '<input name="column_array' + device + '[' + keyword + ']" data-column_title="' + label + '" data-keyword="' + keyword + '" class="colum_data_input ' + keyword + '" type="text" value="' + label + '">';
    814847                    html += '<span class="wpt_colunm_type">' + type_name_show + keyword + '</span>';
    815                     html += "<span class='wpt_column_cross'>X</span>";
    816848                html += '</div>';
    817849                html += '<span title="Move Handle" class="handle checkbox_handle ui-sortable-handle">';
    … …  
    837869                $('.and_new_column_label').val('');
    838870                $('.add_new_column_type_select').val('');
    839                 // return;
    840                 $('body.wpt_admin_body input#publish[name=save]').trigger('click');
     871                $('.add-new-custom-column-wrapper').addClass('wpt-default-hide').removeAttr('style');
     872                triggerTableFormSave();
    841873            }
    842874            return;
    … …  
    845877        });
    846878        $(document.body).on('change','#wpt_advance_search_taxonomy_choose',function(){
     879            $('.button,button').removeClass('wpt_ajax_update');
    847880            $('.wpt_astaxonomy_choose_notice').html('Submitting...');
    848881            WPT_ADMIN_CONTROL.showNotification('Submitting...', 'info');
    849             $('body.wpt_admin_body input#publish[name=save]').trigger('click');
    850         });
     882            triggerTableFormSave();
     883        });
     884
     885        function triggerTableFormSave(){
     886            var $saveBtn = $('#wpt_configuration_form .form_bottom.form_bottom_submit_button button[name="wpt_post_submit"], body.wpt_admin_body input#publish[name=save]').first();
     887            if($saveBtn.length > 0){
     888                $saveBtn.trigger('click');
     889            }
     890        }
     891
    851892        /**
    852893         * Data Save by Ctrl + S
    … …  
    854895        $(window).bind('keydown', function(event) {
    855896            if (event.ctrlKey || event.metaKey) {
    856                 if($('.form_bottom.form_bottom_submit_button').hasClass('wrapper_wpt_ajax_update') && String.fromCharCode(event.which).toLowerCase() === 's' ){
    857 
     897                if($('#wpt_configuration_form .form_bottom.form_bottom_submit_button button[name="wpt_post_submit"]').length > 0 && String.fromCharCode(event.which).toLowerCase() === 's' ){
    858898                    event.preventDefault();
    859                     $('body.wpt_admin_body input#publish[name=save]').trigger('click');
     899                    triggerTableFormSave();
    860900                }
    861901            }
    … …  
    884924            detect_responsive_stats();
    885925           
     926            $('.wpt_notify h1').html('Saving...');
    886927            $('.wpt_notify').css('display','block');
    887928           
    888             var 
    889             old_title   = $('button.button.wpt_ajax_update').attr('data-title'),
    890             new_title       = $('#title').val();
     929            var
     930            old_title   = $(this).attr('data-title'),
     931            new_title   = $('#title').val();
    891932           
    892933            if( old_title === new_title ){
    … …  
    903944            var data = $('form#post').serializeArray();
    904945            //Set a trigger for our save_post action
    905             data.push({wpt_ajax_save: true});
     946            data.push({name: 'wpt_ajax_save', value: 'true'});
    906947
    907948
    908949            //The XHR Goodness
    909950            $.post(postURL, data, function(response){}).done(function(){
     951                $(window).off('beforeunload.edit-post');
     952                if (typeof wp !== 'undefined' && wp.autosave && wp.autosave.server) {
     953                    wp.autosave.server.suspend();
     954                }
    910955                $('.wpt_notify h1').html('Saved Product Table');
    911956                $('.wpt_notify').fadeOut();
    … …  
    916961            return false;
    917962
     963        });
     964
     965        // Handle standard post submit when saving via custom Save button (without WP #submitdiv)
     966        $(document).on('submit', 'body.post-type-wpt_product_table form#post', function(e){
     967            if (e.isDefaultPrevented()) {
     968                return;
     969            }
     970            detect_responsive_stats();
     971
     972            if (typeof wp !== 'undefined' && wp.autosave && wp.autosave.server) {
     973                wp.autosave.server.suspend();
     974            }
     975            $(window).off('beforeunload.edit-post');
     976
     977            var origStatus = $('#original_post_status').val();
     978            if (origStatus === 'auto-draft' && window.history && window.history.replaceState) {
     979                var loc = window.location.href;
     980                if (loc.indexOf('wp-post-new-reload=true') === -1) {
     981                    loc += (loc.indexOf('?') !== -1) ? '&' : '?';
     982                    loc += 'wp-post-new-reload=true';
     983                    window.history.replaceState(null, null, loc);
     984                }
     985            }
     986
     987            try {
     988                sessionStorage.setItem('wpt_just_saved', 'true');
     989                if (origStatus === 'publish') {
     990                    var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     991                    sessionStorage.setItem('wpt_saved_scroll_y', y);
     992                }
     993            } catch(err) {}
     994
     995            if (typeof WPT_ADMIN_CONTROL !== 'undefined' && typeof WPT_ADMIN_CONTROL.showNotification === 'function') {
     996                WPT_ADMIN_CONTROL.showNotification('Saving .... !', 'success');
     997            }
    918998        });
    919999       
    … …  
    10141094
    10151095    $(document.body).on('submit', 'form#wpt-main-configuration-form', function (e){
     1096        try {
     1097            var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     1098            sessionStorage.setItem('wpt_saved_scroll_y', y);
     1099            sessionStorage.setItem('wpt_just_saved', 'true');
     1100        } catch(err) {}
    10161101
    10171102        let submitBtn = $(this).find('button.configure_submit');
    … …  
    10221107        // submitBtnIcon.attr('class', 'wpt-floppy');
    10231108        WPT_ADMIN_CONTROL.showNotification('Saving .... !', 'success');
     1109    });
     1110
     1111    $(document.body).on('click', 'button.configure_submit, .configure_submit', function (e){
     1112        try {
     1113            var y = window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0;
     1114            sessionStorage.setItem('wpt_saved_scroll_y', y);
     1115            sessionStorage.setItem('wpt_just_saved', 'true');
     1116        } catch(err) {}
    10241117    });
    10251118
    … …  
    10391132    if( colSetsLen > 0 ){
    10401133
    1041         var saveChangeText = 'Save';
    1042         var btnHtml = '<div class="">';
    1043         btnHtml += '<button type="submit" name="configure_submit" class="float-btn wpt-btn wpt-has-icon configure_submit"><span><i class="wpt-floppy"></i></span><strong>' + saveChangeText + '</strong></button>';
    1044         btnHtml += '</div>';
    1045 
    1046         $('#wpt-main-configuration-form').append(btnHtml);
    1047 
    10481134        $(window).on('scroll',function(){
    10491135
    1050             let targetElement = $('.float-btn');
    10511136            let topbarElement = $('div.wpt-header.wpt-clearfix');
    1052             // if(targetElement.length < 1) return;
    1053            
    1054             let bodyHeight = $('#wpbody').height();
    10551137            let scrollTop = $(this).scrollTop();
    1056             let screenHeight = $(this).height();
    10571138   
    10581139            let configFormElement = $('form#wpt-main-configuration-form');
    10591140            if(configFormElement.length < 1) return;
    10601141   
    1061             let conPass = bodyHeight - screenHeight - 100 - targetElement.height();
    1062             let leftWill = configFormElement.width() - targetElement.width() - 20;
    1063            
    1064             if(scrollTop < conPass){
    1065                 targetElement.addClass('stick_on_scroll-on');
    1066             }else{
    1067                 targetElement.removeClass('stick_on_scroll-on');
    1068             }
    10691142            if(scrollTop > 90){
    10701143                configFormElement.addClass('topbar-fixed-on-scroll-main-element');
    … …  
    10741147                topbarElement.removeClass('topbar-fixed-on-scroll');
    10751148            }
    1076             if(scrollTop > 100 && colSetsLen > 0){
    1077                 targetElement.attr('id','stick_on_scroll-on');
    1078             }else if(colSetsLen > 0){
    1079                 targetElement.removeAttr('id');
    1080             }
    1081            
    1082    
    10831149        });
    10841150
    … …  
    10861152   
    10871153
    1088     var postColSetsLen = $('#column_settings').length;
    1089 
    10901154    /**
    1091      * This is for Product Table post Edit and Add new page.
    1092      * actually for configure page and post edit page,
    1093      * we did it separately.
    1094      * Here for Product Table edit, and for configure page, we did it at the up of this comment.
     1155     * Product Table post Edit and Add New page save bar now uses
     1156     * CSS sticky positioning (.form_bottom.form_bottom_submit_button)
     1157     * so no duplicate .stick_on_scroll button injection is needed.
    10951158     */
    1096    
    1097     var status = $('#original_post_status').val();
    1098 
    1099     if( postColSetsLen > 0 && status === 'publish'){
    1100         var saveChangeText = $('button.button[name="wpt_post_submit"]').text(); //Save Change
    1101         var myHtml = '<div class="wrapper_wpt_ajax_update ultraaddons-button-wrapper">';
    1102         myHtml += '<button type="submit" name="wpt_post_submit" data-title="hello" class="stick_on_scroll button-primary button-primary primary button wpt_ajax_update">'+ saveChangeText +'</button>';
    1103         myHtml += '</div>';
    1104         $('#wpt_configuration_form').append(myHtml);
    1105         $(window).on('scroll',function(){
    1106 
    1107             let targetElement = $('.stick_on_scroll');
    1108             if(targetElement.length < 1) return;
    1109            
    1110            
    1111             let bodyHeight = $('#wpbody').height();
    1112             let scrollTop = $(this).scrollTop();
    1113             let screenHeight = $(this).height();
    1114    
    1115             let configFormElement = $('#wpt_configuration_form');
    1116             if(configFormElement.length < 1) return;
    1117    
    1118             let conPass = bodyHeight - screenHeight - 300 - targetElement.height();
    1119             let leftWill = configFormElement.width() - targetElement.width() - 20;
    1120            
    1121    
    1122             targetElement.css({
    1123                 left: leftWill,
    1124                 right: 'unset'
    1125             });
    1126             if(scrollTop < conPass){
    1127                 targetElement.attr('id','stick_on_scroll-on');
    1128             }else{
    1129                 targetElement.removeAttr('id');
    1130             }
    1131 
    1132             if(scrollTop > 100 && postColSetsLen > 0){
    1133                 targetElement.attr('id','stick_on_scroll-on');
    1134             }else if(postColSetsLen > 0){
    1135                 targetElement.removeAttr('id');
    1136             }
    1137            
    1138    
    1139         });
    1140 
    1141 
    1142     }
    11431159   
    11441160
    … …  
    11471163     * Tab Area Handle
    11481164     */
    1149     configureTabAreaAdded('#wpt-main-configuration-form'); //Specially for Configure Page
    1150     configureTabAreaAdded('.fieldwrap.wpt_result_footer.ultraaddons.pro_version'); //From inside on Edit Table
    11511165    function configureTabAreaAdded( mainSelector = '#wpt-main-configuration-form' ){
    11521166        var tabSerial = 0;
    11531167        var tabArray = new Array();
    1154         var tabHtml = ""
     1168        var tabHtml = "";
    11551169        var tabArea = $(mainSelector + ' .wpt-configure-tab-wrapper');
    11561170        if(tabArea.length < 1){
    … …  
    11581172            tabArea = $(mainSelector + ' .wpt-configure-tab-wrapper');
    11591173        }
    1160         var sectionPanel = $(mainSelector + ' div.wpt-section-panel');
     1174        var sectionPanel = $(mainSelector + ' div.wpt-section-panel').not('.wpt-configure-tab-wrapper').not('.wpt-full-form-submit-wrapper');
     1175        if(sectionPanel.length === 0) return;
     1176
     1177        var isMainConfigPage = (mainSelector === '#wpt-main-configuration-form');
     1178        var savedTab = '';
     1179        if (isMainConfigPage) {
     1180            try {
     1181                savedTab = localStorage.getItem('wpt_active_config_tab') || '';
     1182            } catch (e) {}
     1183        }
     1184
     1185        var currentHash = window.location.hash;
     1186        var targetHash = (currentHash && $(mainSelector + ' ' + currentHash).length > 0) || (isMainConfigPage && currentHash === '#show-all')
     1187            ? currentHash
     1188            : savedTab;
     1189        var hasValidHash = targetHash && ((isMainConfigPage && targetHash === '#show-all') || $(mainSelector + ' ' + targetHash).length > 0);
     1190        var activeTarget = hasValidHash ? targetHash : '';
     1191
     1192        if (isMainConfigPage && activeTarget && !currentHash) {
     1193            try {
     1194                history.replaceState(null, null, activeTarget);
     1195            } catch (e) {}
     1196        }
     1197
    11611198        sectionPanel.each(function(index, content){
    1162            
    11631199            let table = $(this).find('table');
    11641200            let tableCount = table.length;
    11651201            if(tableCount > 0){
    1166                
    11671202                let firstTable = table.first();
    11681203                let tableId = $(this).attr('id');
    1169                 let tableTitle = firstTable.find('thead tr th:first-child h3').text();
     1204                let tableTitle = firstTable.find('thead tr th:first-child h3').text().trim();
    11701205                tabArray[tableId] = tableTitle;
    11711206
    1172                 if(tabSerial !== 0){
    1173                     $(this).hide();
    1174                     tabHtml += "<a href='#" + tableId + "' class='tab-button wpt-button link-" + tableId + "'>" + tableTitle + "</a>"
    1175                 }else{
    1176                     $(this).addClass('active');
    1177                     tabHtml += "<a href='#" + tableId + "' class='tab-button wpt-button link-" + tableId + " active'>" + tableTitle + "</a>"
     1207                let isThisActive = false;
     1208                if(activeTarget === '#show-all'){
     1209                    isThisActive = false;
     1210                } else if(activeTarget !== ''){
     1211                    isThisActive = ('#' + tableId === activeTarget);
     1212                } else {
     1213                    isThisActive = (tabSerial === 0);
     1214                }
     1215
     1216                if(isThisActive || activeTarget === '#show-all'){
     1217                    $(this).show().addClass('active');
     1218                    tabHtml += "<a href='#" + tableId + "' class='tab-button wpt-button link-" + tableId + (isThisActive ? " active" : "") + "'>" + tableTitle + "</a>";
     1219                } else {
     1220                    $(this).hide().removeClass('active');
     1221                    tabHtml += "<a href='#" + tableId + "' class='tab-button wpt-button link-" + tableId + "'>" + tableTitle + "</a>";
    11781222                }
    11791223
    11801224                tabSerial++;
    1181 
    1182             }
    1183            
    1184         });
     1225            }
     1226        });
     1227
    11851228        if(tabSerial > 1){
    1186             tabHtml += "<a href='#show-all' class='tab-button wpt-button'>Show All</a>";
     1229            let isShowAllActive = (activeTarget === '#show-all');
     1230            tabHtml += "<a href='#show-all' class='tab-button wpt-button" + (isShowAllActive ? " active" : "") + "'>Show All</a>";
    11871231            tabArea.html(tabHtml);
    11881232        }
    1189        
    1190         $(document.body).on('click','.wpt-configure-tab-wrapper a.tab-button',function(e){
     1233
     1234        if(activeTarget === '#show-all'){
     1235            sectionPanel.show().addClass('active');
     1236        }
     1237
     1238        // Clean up instant style once jQuery states are fully applied
     1239        $('#wpt-instant-tab-css').remove();
     1240
     1241        var savedScrollY = null;
     1242        try { savedScrollY = sessionStorage.getItem('wpt_saved_scroll_y'); } catch(e){}
     1243        if (savedScrollY !== null) {
     1244            var targetY = parseInt(savedScrollY, 10);
     1245            if (!isNaN(targetY)) {
     1246                window.scrollTo(0, targetY);
     1247            }
     1248        }
     1249
     1250        $(document.body).off('click', mainSelector + ' .wpt-configure-tab-wrapper a.tab-button').on('click', mainSelector + ' .wpt-configure-tab-wrapper a.tab-button', function(e){
    11911251            e.preventDefault();
    1192             $('.wpt-configure-tab-wrapper a').removeClass('active');
     1252            $(mainSelector + ' .wpt-configure-tab-wrapper a').removeClass('active');
    11931253            $(this).addClass('active');
    1194             $(mainSelector + ' div.wpt-section-panel.active').hide();
    11951254            let target = $(this).attr('href');
    1196             if(target == '#show-all'){
    1197                 sectionPanel.fadeIn();
    1198 
     1255
     1256            if (isMainConfigPage) {
     1257                try {
     1258                    localStorage.setItem('wpt_active_config_tab', target);
     1259                } catch (e) {}
     1260            }
     1261
     1262            if(target === '#show-all'){
     1263                sectionPanel.show().addClass('active');
    11991264            }else{
    1200                 $(mainSelector + ' ' + target).fadeIn().addClass('active');
    1201             }
    1202            
    1203 
    1204             //Address replace
    1205             var currentUrl = new URL(window.location.href);
    1206             currentUrl.hash = target;
    1207             history.replaceState(null, null, currentUrl);
    1208            
    1209         });
    1210 
    1211         var tabName = window.location.hash;
    1212 
    1213         setTimeout(function(){
    1214             if(sectionPanel.length > 0 && tabName.length > 0){
    1215                 $(mainSelector + ' .wpt-configure-tab-wrapper a.tab-button').removeClass('active');
    1216                 $(mainSelector + ' .wpt-configure-tab-wrapper a[href="' + tabName + '"]').addClass('active');
    1217                
    1218                 if(tabName == '#show-all'){
    1219                     sectionPanel.fadeIn();
    1220                     return;
    1221                 }
    1222                 $(mainSelector + ' .wpt-section-panel').not('.wpt-configure-tab-wrapper').hide().removeClass('active');
    1223 
    1224                 $(mainSelector + ' ' + tabName).show().addClass('active');
    1225             }
    1226         },100);
     1265                sectionPanel.not(target).hide().removeClass('active');
     1266                $(mainSelector + ' ' + target).show().addClass('active');
     1267            }
     1268
     1269            // Ensure submit buttons remain visible
     1270            $(mainSelector + ' .wpt-full-form-submit-wrapper').show();
     1271
     1272            if (isMainConfigPage) {
     1273                // Address replace
     1274                try {
     1275                    history.replaceState(null, null, target);
     1276                } catch (e) {
     1277                    window.location.hash = target;
     1278                }
     1279
     1280                // Preserve active tab on form submit
     1281                $(mainSelector).attr('action', target);
     1282            }
     1283        });
    12271284    }
    12281285
    … …  
    14121469   
    14131470   
    1414     $(document.body).on('click','.wpt-add-preset-column', function(e) {
    1415         e.preventDefault();
    1416         var $button = $(this);
    1417         var $mainWrapper = $button.closest('.add_new_column_main_wrapper');
    1418         var $dropdownContainer = $mainWrapper.find('.wpt-dropdown-container');
    1419         $dropdownContainer.toggle(); // show/hide dropdown
    1420          
    1421     });
    1422     $(document.body).on('click','.wpt-add-new-custom-column-btn', function(e) {
    1423         e.preventDefault();
    1424         var $button = $(this);
    1425         var $mainWrapper = $button.closest('.add_new_column_main_wrapper');
    1426         var $_device = $mainWrapper.data('device'); 
    1427         $('.add_new_col_wrapper').attr('data-device', $_device);
    1428         $('.add-new-custom-column-wrapper').toggleClass('wpt-default-hide'); // show/hide dropdown
    1429         $dropdownContainer.hide(); 
    1430     });
     1471        /**
     1472         * Spotlight Preset Modal & Split Custom Column Studio Helpers
     1473         */
     1474        function syncPresetModalState($container) {
     1475            if (!$container || $container.length < 1) {
     1476                return;
     1477            }
     1478            var $items = $container.find('.wpt-dropdown-list > li.switch-enable-item');
     1479            var $enabled = $items.filter('.item-enabled');
     1480
     1481            // Update left category rail counts
     1482            $container.find('.wpt-rail-btn').each(function() {
     1483                var $btn = $(this);
     1484                var filter = $btn.data('filter');
     1485                var count = 0;
     1486                if (filter === 'all') {
     1487                    count = $items.length;
     1488                } else if (filter === 'premium') {
     1489                    count = $items.filter('.premium').length;
     1490                } else {
     1491                    count = $items.filter('[data-category="' + filter + '"]').length;
     1492                }
     1493                $btn.find('.wpt-rail-count').text(count);
     1494            });
     1495
     1496            // Sync active columns chip ribbon safely via DOM text nodes
     1497            var $chipsWrap = $container.find('.wpt-preset-active-chips');
     1498            $chipsWrap.empty();
     1499            if ($enabled.length === 0) {
     1500                $chipsWrap.append($('<span class="wpt-active-strip-empty"></span>').text('None selected yet'));
     1501            } else {
     1502                $enabled.each(function() {
     1503                    var $item = $(this);
     1504                    var kw = $item.data('column_keyword');
     1505                    var label = $item.attr('data-label') || $item.find('.wpt-preset-card-title').text() || kw;
     1506                    var $chip = $('<button type="button" class="wpt-active-chip"></button>').attr('data-keyword', kw);
     1507                    $chip.append($('<span></span>').text(label));
     1508                    $chip.append($('<span class="wpt-chip-x" aria-hidden="true">&times;</span>'));
     1509                    $chipsWrap.append($chip);
     1510                });
     1511            }
     1512
     1513            var visibleCount = $items.not('.wpt-filter-hidden').length;
     1514            $container.find('.wpt-spotlight-summary').text(visibleCount + ' columns shown · ' + $enabled.length + ' active');
     1515        }
     1516
     1517        function filterPresetModalList($container) {
     1518            if (!$container || $container.length < 1) {
     1519                return;
     1520            }
     1521            var searchTerm = ($container.find('.wpt-column-search-box').val() || '').toLowerCase().trim();
     1522            var activeFilter = $container.find('.wpt-rail-btn.active').data('filter') || 'all';
     1523            var $dropdownLi = $container.find('.wpt-dropdown-list > li.switch-enable-item');
     1524            var visibleCount = 0;
     1525
     1526            $dropdownLi.each(function() {
     1527                var $li = $(this);
     1528                var text = $li.text().toLowerCase();
     1529                var character = String($li.data('character') || '').toLowerCase();
     1530                var matchesSearch = !searchTerm || text.indexOf(searchTerm) > -1 || character.indexOf(searchTerm) > -1;
     1531                var matchesCat = true;
     1532
     1533                if (activeFilter === 'premium') {
     1534                    matchesCat = $li.hasClass('premium');
     1535                } else if (activeFilter !== 'all') {
     1536                    matchesCat = ($li.attr('data-category') === activeFilter);
     1537                }
     1538
     1539                if (matchesSearch && matchesCat) {
     1540                    $li.removeClass('wpt-filter-hidden').show();
     1541                    visibleCount++;
     1542                } else {
     1543                    $li.addClass('wpt-filter-hidden').hide();
     1544                }
     1545            });
     1546
     1547            $container.find('.wpt-preset-empty').toggle(visibleCount === 0);
     1548            var enabledCount = $dropdownLi.filter('.item-enabled').length;
     1549            $container.find('.wpt-spotlight-summary').text(visibleCount + ' columns shown · ' + enabledCount + ' active');
     1550        }
     1551
     1552        function syncCustomTypeBanner() {
     1553            var $modal = $('.add_new_col_wrapper');
     1554            if ($modal.length < 1) {
     1555                return;
     1556            }
     1557            var $active = $modal.find('.wpt-custom-select-box.active').first();
     1558            if ($active.length < 1) {
     1559                return;
     1560            }
     1561            var title = $active.text().trim();
     1562            var desc = $active.attr('data-desc') || '';
     1563            var ph = $active.attr('data-ph') || 'column_keyword';
     1564            var doc = $active.attr('data-doc') || 'https://wooproducttable.com/docs/doc/table-options/add-new-custom-column-in-woo-product-table/';
     1565
     1566            $('#wpt-twin-type-title').text(title);
     1567            $('#wpt-twin-type-desc').text(desc);
     1568            $('#wpt-twin-type-doc').attr('href', doc);
     1569            $('#wpt-new-col-key').attr('placeholder', 'e.g. ' + ph);
     1570        }
     1571
     1572        // Open Preset Column Spotlight Modal
     1573        $(document.body).on('click','.wpt-add-preset-column', function(e) {
     1574            e.preventDefault();
     1575            var $button = $(this);
     1576            var $mainWrapper = $button.closest('.add_new_column_main_wrapper');
     1577            var $targetContainer = $mainWrapper.find('.wpt-dropdown-container');
     1578            $targetContainer.toggle();
     1579            if ($targetContainer.is(':visible')) {
     1580                syncPresetModalState($targetContainer);
     1581                filterPresetModalList($targetContainer);
     1582                $targetContainer.find('.wpt-column-search-box').trigger('focus');
     1583            }
     1584        });
     1585
     1586        // Open Custom Column Twin Left-Rail Modal
     1587        $(document.body).on('click','.wpt-add-new-custom-column-btn', function(e) {
     1588            e.preventDefault();
     1589            var $button = $(this);
     1590            var $mainWrapper = $button.closest('.add_new_column_main_wrapper');
     1591            var $_device = $mainWrapper.data('device') || '';
     1592            var deviceLabel = 'Default (All Device)';
     1593            if ($_device === '_tablet') {
     1594                deviceLabel = 'Tablet';
     1595            } else if ($_device === '_mobile') {
     1596                deviceLabel = 'Mobile';
     1597            }
     1598            $('.add_new_col_wrapper').attr('data-device', $_device);
     1599            $('#wpt-custom-device-label').text(deviceLabel);
     1600            $('.add-new-custom-column-wrapper').toggleClass('wpt-default-hide');
     1601            $dropdownContainer.hide();
     1602            syncCustomTypeBanner();
     1603            if (!$('.add-new-custom-column-wrapper').hasClass('wpt-default-hide')) {
     1604                $('.add_new_col_wrapper .and_new_column_label').trigger('focus');
     1605            }
     1606        });
     1607
     1608        $(document).on('change', '.add_new_col_wrapper #selected_column_type', syncCustomTypeBanner);
     1609
     1610        // Category rail & active chip clicks inside Preset Spotlight Modal
     1611        $(document).on('click', '.wpt-rail-btn', function(e) {
     1612            e.preventDefault();
     1613            e.stopPropagation();
     1614            var $btn = $(this);
     1615            var $container = $btn.closest('.wpt-dropdown-container');
     1616            $container.find('.wpt-rail-btn').removeClass('active');
     1617            $btn.addClass('active');
     1618            filterPresetModalList($container);
     1619        });
     1620
     1621        $(document).on('click', '.wpt-active-chip', function(e) {
     1622            e.preventDefault();
     1623            e.stopPropagation();
     1624            var kw = $(this).attr('data-keyword');
     1625            var $container = $(this).closest('.wpt-dropdown-container');
     1626            $container.find('.wpt-dropdown-list > li.switch-enable-item[data-column_keyword="' + kw + '"]').trigger('click');
     1627        });
    14311628
    14321629    function findOnlyText(Element){
    … …  
    14911688        });
    14921689    });
    1493     // Search filter 
    1494     $('.wpt-column-search-box').on('input', function() {
    1495         var searchTerm = $(this).val().toLowerCase();
    1496         var $dropdown_li = $(this).closest('.wpt-dropdown-container').find('.wpt-dropdown-list li');
    1497         $dropdown_li.each(function() {
    1498             var text = $(this).text().toLowerCase();
    1499             var character = $(this).data('character').toLowerCase();
    1500             if (text.indexOf(searchTerm) > -1 || character.indexOf(searchTerm) > -1) {
    1501                 $(this).show();
    1502             } else {
    1503                 $(this).hide();
    1504             }
    1505         });
    1506     });
    1507 
    1508     // When an item is selected
     1690    // Search filter inside Preset Spotlight modal
     1691    $(document).on('input', '.wpt-column-search-box', function() {
     1692        filterPresetModalList($(this).closest('.wpt-dropdown-container'));
     1693    });
     1694
     1695    // When a preset item is clicked
    15091696    $(document).on('click', '.wpt-dropdown-list li', function() {
    15101697        if ($(this).hasClass('premium')) {return;}
    1511         var selectedKeyword = $(this).data('column_keyword');
    1512 
    1513         if ($(this).hasClass('item-enabled')) {
    1514 
    1515             // e.g., remove from active list, update UI, etc.
    1516             $(this).removeClass('item-enabled');
    1517         } else {
    1518             $(this).addClass('item-enabled');
    1519         }
    1520 
    1521         var $mainWrapper = $(this).closest('.inside-column-settings-wrapper .inside_tab_content.tab-content.tab-content-active');
    1522         var $listWrapper = $(this).closest('.wpt-dropdown-list');
    1523         // Get all enabled items in the dropdown
     1698        var $item = $(this);
     1699        var selectedKeyword = $item.data('column_keyword');
     1700        var $tabContent = $item.closest('.tab-content');
     1701        var $targetCheckbox = $tabContent.find('.wpt_column_sortable li.wpt_sortable_peritem input.checkbox_handle_input[data-column_keyword="' + selectedKeyword + '"]');
     1702        var isDesktopMinLocked = ($tabContent.attr('id') === 'inside-desktop')
     1703            && $item.hasClass('item-enabled')
     1704            && $tabContent.find('.wpt_column_sortable li.wpt_sortable_peritem.enabled').length < 2;
     1705
     1706        if (!isDesktopMinLocked) {
     1707            $item.toggleClass('item-enabled');
     1708        }
     1709
     1710        var $mainWrapper = $item.closest('.inside-column-settings-wrapper .inside_tab_content.tab-content.tab-content-active');
     1711        var $listWrapper = $item.closest('.wpt-dropdown-list');
    15241712        var $enabledItems = $listWrapper.find('li.item-enabled');
    1525        
    1526         // Get text values of enabled items in one line
    15271713        var enabledItemsText = $enabledItems.map(function() {
    15281714            return $(this).data('column_keyword');
    … …  
    15301716
    15311717        $mainWrapper.find('.wpt-col-selected-pre-value').html(enabledItemsText);
    1532        
    1533         $(this).closest('.tab-content').find('.wpt_column_sortable li.wpt_sortable_peritem input.checkbox_handle_input[data-column_keyword="' + selectedKeyword + '"]').trigger('click');
    1534 
    1535     });
    1536 
    1537    
    1538     // Click outside to close dropdown
     1718        $targetCheckbox.trigger('click');
     1719        syncPresetModalState($item.closest('.wpt-dropdown-container'));
     1720    });
     1721
     1722    // Click outside or Close / Done / Cancel buttons to close modals
     1723    $(document).on('click', '.wpt-dropdown-container .wpt-modal-close-btn, .wpt-dropdown-container .wpt-modal-done-btn', function(e) {
     1724        e.preventDefault();
     1725        e.stopPropagation();
     1726        $(this).closest('.wpt-dropdown-container').hide();
     1727    });
     1728    $(document).on('click', '.add-new-custom-column-wrapper .wpt-modal-close-btn, .add-new-custom-column-wrapper .wpt-custom-cancel-btn', function(e) {
     1729        e.preventDefault();
     1730        e.stopPropagation();
     1731        $(this).closest('.add-new-custom-column-wrapper').addClass('wpt-default-hide').removeAttr('style');
     1732    });
     1733    $(document).on('keydown', function(e) {
     1734        if (e.key === 'Escape' || e.keyCode === 27) {
     1735            $dropdownContainer.hide();
     1736            $('.add-new-custom-column-wrapper').addClass('wpt-default-hide').removeAttr('style');
     1737        }
     1738    });
    15391739    $(document).on('click', function(e) {
    15401740        if (!$(e.target).closest('.wpt-dropdown-container-insider,.wpt_column_sortable, #wpt-add-preset-column').length) {
    … …  
    15431743    });
    15441744    var $addCustomColWrapperContainer = $('.add-new-custom-column-wrapper');
    1545     // Click outside to close dropdown
     1745    // Click outside to close custom column modal
    15461746    $(document).on('click', function(e) {
    15471747        if (!$(e.target).closest('.add_new_col_wrapper,.wpt_column_sortable,.inside_tab_content').length) {
    … …  
    16361836    $(document).ready(function() {
    16371837        WPT_ADMIN_CONTROL.init();
     1838
     1839        // Move Ctrl+S save pill directly into Table Modification postbox-header for clean alignment
     1840        var $ctrlSPill = $('#wpt_configuration_form p.wpt_ctrl_s');
     1841        var $configHeader = $('#wpt_shortcode_configuration_metabox_id .postbox-header');
     1842        if ($ctrlSPill.length && $configHeader.length) {
     1843            $configHeader.append($ctrlSPill);
     1844        }
     1845
     1846        // Demo 1: Fast Single-Request & Non-Destructive Live Table Preview
     1847        var $previewBackdrop = $('#wpt-live-preview-backdrop');
     1848        var $previewIframe = $('#wpt-lp-iframe');
     1849        var $previewViewport = $('#wpt-lp-viewport');
     1850        var $previewLoading = $('#wpt-lp-loading');
     1851        var $previewLoadingText = $('#wpt-lp-loading-text');
     1852        var $previewStatus = $('#wpt-lp-status');
     1853        var $previewExternalLink = $('#wpt-lp-external-link');
     1854        var $postForm = $('body.post-type-wpt_product_table form#post');
     1855        var isExpectingIframeLoad = false;
     1856        var hasLoadedPreviewOnce = false;
     1857        var hasUserModifiedForm = false;
     1858        var isNewUnsavedPost = $('body').hasClass('post-new-php');
     1859        var previewFallbackTimer = null;
     1860        var wptSubmitFieldPattern = /^(post_title|wpt_shortcode_nonce_value)$|^(column_array|column_array_tablet|column_array_mobile|enabled_column_array|enabled_column_array_tablet|enabled_column_array_mobile|column_settings|column_settings_tablet|column_settings_mobile|basics|table_style|conditions|mobile|search_n_filter|pagination|config|responsive|_cf_filter|text_data)(\[|$)/;
     1861
     1862        function getSerializedPreviewFields() {
     1863            if ($postForm.length < 1) {
     1864                return [];
     1865            }
     1866            detect_responsive_stats();
     1867            return $postForm.serializeArray().filter(function(field) {
     1868                return wptSubmitFieldPattern.test(field.name);
     1869            });
     1870        }
     1871
     1872        function getFormFingerprint(fields) {
     1873            return $.param(fields.filter(function(field) {
     1874                return field.name !== 'wpt_shortcode_nonce_value';
     1875            }));
     1876        }
     1877
     1878        var initialSavedFingerprint = $postForm.length > 0 ? getFormFingerprint(getSerializedPreviewFields()) : '';
     1879        var lastPreviewFingerprint = null;
     1880
     1881        $(window).on('load', function() {
     1882            if (!hasUserModifiedForm && $postForm.length > 0) {
     1883                initialSavedFingerprint = getFormFingerprint(getSerializedPreviewFields());
     1884            }
     1885        });
     1886
     1887        $postForm.on('input change sortupdate sortstop', ':input, .wpt_column_sortable', function() {
     1888            hasUserModifiedForm = true;
     1889        });
     1890
     1891        $postForm.on('click', '.wpt-preset-chip, .add_new_col_btn, .wpt_column_sortable .wpt-col-remove', function() {
     1892            hasUserModifiedForm = true;
     1893        });
     1894
     1895        function setPreviewStatus(state, text) {
     1896            $previewStatus
     1897                .removeClass('is-syncing is-synced is-unsaved is-error')
     1898                .addClass('is-' + state)
     1899                .find('.wpt-lp-status-text')
     1900                .text(text);
     1901        }
     1902
     1903        function updateReadyBadge() {
     1904            var isUnsavedState = isNewUnsavedPost || hasUserModifiedForm || (lastPreviewFingerprint !== null && lastPreviewFingerprint !== initialSavedFingerprint);
     1905            if (isUnsavedState) {
     1906                setPreviewStatus('unsaved', 'Previewing unsaved edits');
     1907            } else {
     1908                setPreviewStatus('synced', 'Live preview ready');
     1909            }
     1910        }
     1911
     1912        function markPreviewFrameReady() {
     1913            if (!isExpectingIframeLoad) {
     1914                return;
     1915            }
     1916            isExpectingIframeLoad = false;
     1917            hasLoadedPreviewOnce = true;
     1918            if (previewFallbackTimer) {
     1919                clearTimeout(previewFallbackTimer);
     1920                previewFallbackTimer = null;
     1921            }
     1922            $previewLoading.addClass('is-hidden').hide();
     1923            updateReadyBadge();
     1924        }
     1925
     1926        function updateModalHeaderAndLinks() {
     1927            var rawTitle = ($('#title').val() || '').trim();
     1928            $('#wpt-lp-table-title').text(rawTitle ? '— ' + rawTitle : '');
     1929            var externalUrl = $previewBackdrop.attr('data-external-url') || '';
     1930            if (externalUrl) {
     1931                $previewExternalLink.attr('href', externalUrl);
     1932            }
     1933
     1934            // Sync shortcode in modal toolbar
     1935            var shortcodeVal = $('#wpt-shortcode-text').val() || '';
     1936            if (!shortcodeVal) {
     1937                var cleanTitle = rawTitle.replace(/[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]/g, '');
     1938                var currentPostId = $('#post_ID').val() || $('input[name="post_ID"]').val() || '';
     1939                if (currentPostId) {
     1940                    shortcodeVal = "[Product_Table id='" + currentPostId + "' name='" + cleanTitle + "']";
     1941                }
     1942            }
     1943            if (shortcodeVal) {
     1944                $('#wpt-lp-shortcode-val').text(shortcodeVal);
     1945                $('#wpt-lp-copy-shortcode').attr('data-shortcode', shortcodeVal);
     1946                $('#wpt-lp-shortcode-wrap').show();
     1947            }
     1948        }
     1949
     1950        function closeLivePreviewModal() {
     1951            if ($previewBackdrop.length < 1 || $previewBackdrop.prop('hidden')) {
     1952                return;
     1953            }
     1954            if (previewFallbackTimer) {
     1955                clearTimeout(previewFallbackTimer);
     1956                previewFallbackTimer = null;
     1957            }
     1958            isExpectingIframeLoad = false;
     1959            $previewBackdrop.prop('hidden', true).removeClass('is-open');
     1960            $('body').removeClass('wpt-lp-modal-open');
     1961            try {
     1962                var iframeDoc = $previewIframe[0] && $previewIframe[0].contentDocument;
     1963                if (iframeDoc) {
     1964                    iframeDoc.querySelectorAll('audio, video').forEach(function(media) {
     1965                        if (!media.paused) {
     1966                            media.pause();
     1967                        }
     1968                    });
     1969                }
     1970            } catch (err) {}
     1971        }
     1972
     1973        function submitLivePreviewToIframe(fields, embedBaseUrl) {
     1974            if (previewFallbackTimer) {
     1975                clearTimeout(previewFallbackTimer);
     1976            }
     1977            isExpectingIframeLoad = true;
     1978            $previewLoading.removeClass('is-error is-hidden').show();
     1979            $previewLoadingText.text('Rendering live table preview...');
     1980            setPreviewStatus('syncing', 'Loading preview...');
     1981
     1982            var sep = embedBaseUrl.indexOf('?') !== -1 ? '&' : '?';
     1983            var actionUrl = embedBaseUrl + sep + '_wpt_pv=' + Date.now();
     1984
     1985            var $tempForm = $('<form>', {
     1986                method: 'POST',
     1987                action: actionUrl,
     1988                target: 'wpt_lp_iframe',
     1989                style: 'display:none;'
     1990            });
     1991
     1992            $.each(fields, function(_, field) {
     1993                if (typeof field.value === 'string' && field.value.indexOf('\n') !== -1) {
     1994                    $tempForm.append($('<textarea>', { name: field.name }).val(field.value));
     1995                } else {
     1996                    $tempForm.append($('<input>', { type: 'hidden', name: field.name, value: field.value }));
     1997                }
     1998            });
     1999
     2000            $('body').append($tempForm);
     2001            $tempForm[0].submit();
     2002            $tempForm.remove();
     2003
     2004            previewFallbackTimer = setTimeout(function() {
     2005                if (isExpectingIframeLoad) {
     2006                    isExpectingIframeLoad = false;
     2007                    $previewLoading.addClass('is-hidden').hide();
     2008                    updateReadyBadge();
     2009                }
     2010            }, 25000);
     2011        }
     2012
     2013        function openLivePreview(forceReload) {
     2014            if ($previewBackdrop.length < 1) {
     2015                return;
     2016            }
     2017            var embedBaseUrl = $previewBackdrop.attr('data-embed-url') || '';
     2018            if (!embedBaseUrl) {
     2019                return;
     2020            }
     2021
     2022            updateModalHeaderAndLinks();
     2023            $previewBackdrop.prop('hidden', false).addClass('is-open');
     2024            $('body').addClass('wpt-lp-modal-open');
     2025
     2026            var fields = getSerializedPreviewFields();
     2027            var currentFingerprint = getFormFingerprint(fields);
     2028            if (!hasLoadedPreviewOnce && !hasUserModifiedForm) {
     2029                initialSavedFingerprint = currentFingerprint;
     2030            }
     2031
     2032            // Instant 0ms re-open if form inputs have not changed since last rendered preview.
     2033            if (!forceReload && hasLoadedPreviewOnce && currentFingerprint === lastPreviewFingerprint) {
     2034                $previewLoading.addClass('is-hidden').hide();
     2035                updateReadyBadge();
     2036                return;
     2037            }
     2038
     2039            // Refresh without edits: skip re-posting form and reload transient-backed GET URL directly.
     2040            if (forceReload && hasLoadedPreviewOnce && currentFingerprint === lastPreviewFingerprint) {
     2041                if (previewFallbackTimer) {
     2042                    clearTimeout(previewFallbackTimer);
     2043                }
     2044                isExpectingIframeLoad = true;
     2045                $previewLoading.removeClass('is-error is-hidden').show();
     2046                $previewLoadingText.text('Refreshing live table preview...');
     2047                setPreviewStatus('syncing', 'Refreshing preview...');
     2048                var sep = embedBaseUrl.indexOf('?') !== -1 ? '&' : '?';
     2049                $previewIframe.attr('src', embedBaseUrl + sep + '_wpt_pv=' + Date.now());
     2050                return;
     2051            }
     2052
     2053            lastPreviewFingerprint = currentFingerprint;
     2054            submitLivePreviewToIframe(fields, embedBaseUrl);
     2055        }
     2056
     2057        $(window).on('message', function(e) {
     2058            var nativeEvent = e.originalEvent || e;
     2059            if (!nativeEvent || nativeEvent.origin !== window.location.origin) {
     2060                return;
     2061            }
     2062            if (nativeEvent.data && nativeEvent.data.type === 'wptLivePreviewReady') {
     2063                markPreviewFrameReady();
     2064            }
     2065        });
     2066
     2067        $previewIframe.on('load', function() {
     2068            markPreviewFrameReady();
     2069        });
     2070
     2071        function fallbackCopy(text, callback) {
     2072            var $temp = $('<textarea>');
     2073            $temp.css({ position: 'absolute', left: '-9999px', top: (window.pageYOffset || document.documentElement.scrollTop) + 'px' });
     2074            $('body').append($temp);
     2075            $temp.val(text).select();
     2076            try {
     2077                document.execCommand('copy');
     2078                if (callback) callback();
     2079            } catch (err) {}
     2080            $temp.remove();
     2081        }
     2082
     2083        $(document).on('click', '#wpt-lp-copy-shortcode, #wpt-lp-shortcode-val', function(e) {
     2084            e.preventDefault();
     2085            var shortcode = $('#wpt-lp-copy-shortcode').attr('data-shortcode') || $('#wpt-lp-shortcode-val').text();
     2086            if (!shortcode) return;
     2087
     2088            var $btn = $('#wpt-lp-copy-shortcode');
     2089            var $label = $btn.find('.wpt-copy-text');
     2090            var originalText = $label.text() || 'Copy';
     2091
     2092            function showCopied() {
     2093                $btn.addClass('copied');
     2094                $label.text('Copied!');
     2095                setTimeout(function() {
     2096                    $btn.removeClass('copied');
     2097                    $label.text(originalText);
     2098                }, 2000);
     2099            }
     2100
     2101            if (navigator.clipboard && navigator.clipboard.writeText) {
     2102                navigator.clipboard.writeText(shortcode).then(showCopied).catch(function() {
     2103                    fallbackCopy(shortcode, showCopied);
     2104                });
     2105            } else {
     2106                fallbackCopy(shortcode, showCopied);
     2107            }
     2108        });
     2109
     2110        // Click Ctrl+S shortcut pill to save table
     2111        $(document).on('click', 'p.wpt_ctrl_s', function(e) {
     2112            e.preventDefault();
     2113            $('#publish, #save-post, input[name="save"]').first().trigger('click');
     2114        });
     2115
     2116        // Trigger Live Preview directly from All Tables & Dashboard tables
     2117        $(document).on('click', '.wpt-table-preview-btn', function(e) {
     2118            e.preventDefault();
     2119            var $btn = $(this);
     2120            var embedUrl = $btn.attr('data-embed-url') || '';
     2121            var externalUrl = $btn.attr('data-external-url') || '';
     2122            var tableTitle = $btn.attr('data-table-title') || '';
     2123            var shortcode = $btn.attr('data-shortcode') || '';
     2124
     2125            if (!embedUrl) {
     2126                return;
     2127            }
     2128
     2129            $previewBackdrop.attr('data-embed-url', embedUrl);
     2130            $previewBackdrop.attr('data-external-url', externalUrl);
     2131            $('#wpt-lp-table-title').text(tableTitle ? '— ' + tableTitle : '');
     2132            $previewExternalLink.attr('href', externalUrl || '#');
     2133
     2134            if (shortcode) {
     2135                $('#wpt-lp-shortcode-val').text(shortcode);
     2136                $('#wpt-lp-copy-shortcode').attr('data-shortcode', shortcode);
     2137                $('#wpt-lp-shortcode-wrap').show();
     2138            } else {
     2139                $('#wpt-lp-shortcode-wrap').hide();
     2140            }
     2141
     2142            $previewBackdrop.prop('hidden', false).addClass('is-open');
     2143            $('body').addClass('wpt-lp-modal-open');
     2144
     2145            isExpectingIframeLoad = true;
     2146            $previewLoading.removeClass('is-error is-hidden').show();
     2147            $previewLoadingText.text('Rendering live table preview...');
     2148            setPreviewStatus('syncing', 'Loading preview...');
     2149
     2150            var sep = embedUrl.indexOf('?') !== -1 ? '&' : '?';
     2151            $previewIframe.attr('src', embedUrl + sep + '_wpt_pv=' + Date.now());
     2152
     2153            if (previewFallbackTimer) {
     2154                clearTimeout(previewFallbackTimer);
     2155            }
     2156            previewFallbackTimer = setTimeout(function() {
     2157                if (isExpectingIframeLoad) {
     2158                    isExpectingIframeLoad = false;
     2159                    $previewLoading.addClass('is-hidden').hide();
     2160                    setPreviewStatus('synced', 'Live preview ready');
     2161                }
     2162            }, 25000);
     2163        });
     2164
     2165        $(document).on('click', '#wpt-open-preview-btn, #wpt-top-preview-btn', function(e) {
     2166            e.preventDefault();
     2167            openLivePreview(false);
     2168        });
     2169
     2170        $(document).on('click', '#wpt-lp-refresh-btn', function(e) {
     2171            e.preventDefault();
     2172            openLivePreview(true);
     2173        });
     2174
     2175        $(document).on('click', '.wpt-lp-device-btn', function(e) {
     2176            e.preventDefault();
     2177            var device = $(this).attr('data-device') || 'desktop';
     2178            $('.wpt-lp-device-btn').removeClass('active');
     2179            $(this).addClass('active');
     2180            $previewViewport.removeClass('is-desktop is-tablet is-mobile').addClass('is-' + device);
     2181        });
     2182
     2183        $(document).on('click', '#wpt-lp-close-btn', function(e) {
     2184            e.preventDefault();
     2185            closeLivePreviewModal();
     2186        });
     2187
     2188        $previewBackdrop.on('click', function(e) {
     2189            if (e.target === this) {
     2190                closeLivePreviewModal();
     2191            }
     2192        });
     2193
     2194        $(document).on('keydown', function(e) {
     2195            if (e.key === 'Escape' && $previewBackdrop.hasClass('is-open')) {
     2196                closeLivePreviewModal();
     2197            }
     2198        });
    16382199    });
    16392200
  • woo-product-table/trunk/inc/handle/enable-column.php

    r3522314 r3837744  
    4242         */
    4343        if( $shortcode->table_type == 'advance_table' ){
    44             self::$message_col = isset( $shortcode->_enable_cols['message'] ); //If available, value will be true
     44            self::$message_col = is_array( $shortcode->_enable_cols ) && isset( $shortcode->_enable_cols['message'] ); //If available, value will be true
    4545           
    46             self::$inner_items = array_column( $shortcode->column_settings, 'items' );
     46            if( is_array( $shortcode->column_settings ) && ! empty( $shortcode->column_settings ) ){
     47                self::$inner_items = array_column( $shortcode->column_settings, 'items' );
    4748
    48             foreach( $shortcode->column_settings as $key=>$items){
    49                 if( ! isset( $items['items'] ) ) continue;
     49                foreach( $shortcode->column_settings as $key=>$items){
     50                    if( ! isset( $items['items'] ) || ! is_array( $items['items'] ) ) continue;
    5051
    51                 $m_index = array_search( 'message', $items['items'] );
    52                
    53                 if( is_int( $m_index ) ){
     52                    $m_index = array_search( 'message', $items['items'] );
    5453                   
    55                     unset($shortcode->column_settings[$key]['items'][$m_index]);
    56                     self::$message_col = true;
    57                     break;
     54                    if( is_int( $m_index ) ){
     55                       
     56                        unset($shortcode->column_settings[$key]['items'][$m_index]);
     57                        self::$message_col = true;
     58                        break;
     59                    }
     60                   
    5861                }
    59                
     62            } else {
     63                self::$inner_items = [];
    6064            }
    6165
    62             if( self::$message_col ){
     66            if( self::$message_col && is_array( $shortcode->_enable_cols ) ){
    6367                unset($shortcode->_enable_cols['message']);
    6468                add_action( 'woocommerce_before_add_to_cart_quantity', 'wpt_add_custom_message_field' );
    … …  
    6670        }
    6771        //If set Only Product Variation
    68         if( $shortcode->req_product_type == 'product_variation' ){
     72        if( $shortcode->req_product_type == 'product_variation' && is_array( $shortcode->_enable_cols ) ){
    6973            /**
    7074             * We have remove @version 3.3.8.1 because, in category item
  • woo-product-table/trunk/inc/shortcode.php

    r3772120 r3837744  
    580580        set_query_var( $this->req_post_type, $this->table_id );
    581581
    582         $this->is_table = $this->table_id && $this->post_type == $this->req_post_type && $this->status == 'publish';
     582        $is_preview_request   = is_preview() || wp_doing_ajax() || ! empty( $_GET['wpt_embed_preview'] ) || ! empty( $_GET['wpt_live_preview'] ) || ! empty( $atts['preview_mode'] );
     583        $is_authorized_preview = is_user_logged_in()
     584            && in_array( $this->status, array( 'draft', 'pending', 'future', 'private', 'auto-draft' ), true )
     585            && current_user_can( 'edit_post', $this->table_id )
     586            && $is_preview_request;
     587
     588        $this->is_table = $this->table_id && $this->post_type == $this->req_post_type && ( 'publish' === $this->status || $is_authorized_preview );
    583589        if( ! $this->is_table && ! empty( $this->atts ) ){
    584590            return Msg::not_found($this);
     591        }
     592
     593        if ( ( ! empty( $_GET['wpt_live_preview'] ) || ! empty( $atts['preview_mode'] ) ) && function_exists( 'wpt_activate_live_preview_context' ) ) {
     594            wpt_activate_live_preview_context( $this->table_id );
    585595        }
    586596
    … …  
    716726
    717727        $this->column_settings = apply_filters( 'wpto_column_settings', $column_settings, $this->table_id, $this->_enable_cols );
     728        if( ! is_array( $this->column_settings ) ){
     729            $this->column_settings = [];
     730        }
     731        if( ! is_array( $this->_enable_cols ) ){
     732            $this->_enable_cols = [];
     733        }
     734        if( ! is_array( $this->column_array ) ){
     735            $this->column_array = [];
     736        }
    718737       
    719738        /**
  • woo-product-table/trunk/includes/enqueue.php

    r3772120 r3837744  
    1616   function wpt_enqueue(){
    1717        global $post;
    18         $pass = is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'Product_Table') || is_woocommerce() || ( is_a($post, 'WP_Post') && $post->post_type === 'wpt_product_table' ) || ( is_a($post, 'WP_Post') && strpos( $post->post_content, 'wpt' ) !== false );
     18        $is_live_preview  = ! empty( $_GET['wpt_live_preview'] ) && is_user_logged_in();
     19        $is_embed_preview = $is_live_preview && ! empty( $_GET['wpt_embed_preview'] );
     20        $pass = $is_live_preview || ( is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'Product_Table') ) || is_woocommerce() || ( is_a($post, 'WP_Post') && $post->post_type === 'wpt_product_table' ) || ( is_a($post, 'WP_Post') && strpos( $post->post_content, 'wpt' ) !== false );
    1921
    2022        if( ! $pass ) return;
    … …  
    2931       //jQuery file including. jQuery is a already registerd to WordPress
    3032       wp_enqueue_script( 'jquery' );
    31        wp_enqueue_script( 'wc-cart-fragments' );
     33       if ( ! $is_embed_preview ) {
     34           wp_enqueue_script( 'wc-cart-fragments' );
     35       }
    3236       wp_enqueue_script( 'wc-add-to-cart-variation' );
    3337
     38       $wpt_custom_deps = $is_embed_preview
     39           ? array( 'jquery', 'wc-add-to-cart-variation' )
     40           : array( 'jquery', 'wc-cart-fragments', 'wc-add-to-cart-variation' );
     41
    3442       //register wpt-custom-js
    35        wp_register_script( 'wpt-custom-js', WPT_Product_Table::getPath('BASE_URL') . 'assets/js/custom.js', array( 'jquery','wc-cart-fragments','wc-add-to-cart-variation' ), WPT_DEV_VERSION, true );
     43       wp_register_script( 'wpt-custom-js', WPT_Product_Table::getPath('BASE_URL') . 'assets/js/custom.js', $wpt_custom_deps, WPT_DEV_VERSION, true );
    3644
    3745       // Enqueue the registered script
  • woo-product-table/trunk/includes/functions.php

    r3522314 r3837744  
    327327            <label for="nolink<?php echo esc_attr( $_device_name ); ?>"><input type="radio" id="nolink<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[title_variation]" value="nolink" <?php echo $title_variation == 'nolink' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Link Disable', 'woo-product-table' ); ?></label>
    328328            <label for="ca_quick_view<?php echo esc_attr( $_device_name ); ?>" class="tooltip"><input type="radio" id="ca_quick_view<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[title_variation]" value="ca_quick_view" <?php echo $title_variation == 'ca_quick_view' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Quick View - BizzView', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/ca-quick-view/" target="_blank"><?php echo esc_html__( 'BizzView - Quick View', 'woo-product-table' ); ?></a></span></label>
    329             <label for="yith<?php echo esc_attr( $_device_name ); ?>" style="opacity:0.041" class="tooltip"><input type="radio" id="yith<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[title_variation]" value="yith" <?php echo $title_variation == 'yith' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Link Disable + Quick View', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/yith-woocommerce-quick-view/" target="_blank"><?php echo esc_html__( 'YITH WooCommerce Quick View', 'woo-product-table' ); ?></a></span></label>
     329            <label for="yith<?php echo esc_attr( $_device_name ); ?>" class="tooltip wpt-legacy-quick-view"><input type="radio" id="yith<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[title_variation]" value="yith" <?php echo $title_variation == 'yith' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Link Disable + Quick View (YITH)', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/yith-woocommerce-quick-view/" target="_blank"><?php echo esc_html__( 'YITH WooCommerce Quick View', 'woo-product-table' ); ?></a></span></label>
    330330        </div>       
    331331
    … …  
    368368           
    369369            <label for="ca_quick_view_thumb<?php echo esc_attr( $_device_name ); ?>" class="tooltip"><input type="radio" id="ca_quick_view_thumb<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[thumb_variation]" value="ca_quick_view" <?php echo $thumb_variation == 'ca_quick_view' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Quick View - BizzView', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/ca-quick-view/" target="_blank"><?php echo esc_html__( 'BizzView - Quick View', 'woo-product-table' ); ?></a></span></label>
    370             <label for="quick_view<?php echo esc_attr( $_device_name ); ?>" style="opacity:0.041;" class="tooltip"><input type="radio" id="quick_view<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[thumb_variation]" value="quick_view" <?php echo $thumb_variation == 'quick_view' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Quick View', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/yith-woocommerce-quick-view/" target="_blank"><?php echo esc_html__( 'YITH WooCommerce Quick View', 'woo-product-table' ); ?></a></span></label>
     370            <label for="quick_view<?php echo esc_attr( $_device_name ); ?>" class="tooltip wpt-legacy-quick-view"><input type="radio" id="quick_view<?php echo esc_attr( $_device_name ); ?>" name="column_settings<?php echo esc_attr( $_device_name ); ?>[thumb_variation]" value="quick_view" <?php echo $thumb_variation == 'quick_view' ? 'checked' : ''; ?>> <?php echo esc_html__( 'Quick View (YITH)', 'woo-product-table' ); ?><span class="tooltip-hover down-arrow"><?php echo esc_html__( 'You have to install', 'woo-product-table' ); ?> <a href="https://wordpress.org/plugins/yith-woocommerce-quick-view/" target="_blank"><?php echo esc_html__( 'YITH WooCommerce Quick View', 'woo-product-table' ); ?></a></span></label>
    371371        </div>
    372372       
  • woo-product-table/trunk/includes/items/quick.php

    r3522314 r3837744  
    44    echo do_shortcode( '[bizzview id="' . esc_attr( $product_id ) . '"]' ); 
    55}else{
    6     $text = $config_value['quick_view_btn_text'] ?? __( 'Qiuck View', 'woo-product-table' );
     6    $text = $config_value['quick_view_btn_text'] ?? __( 'Quick View', 'woo-product-table' );
    77
    88    /**
  • woo-product-table/trunk/readme.txt

    r3772130 r3837744  
    55Requires at least: 6.2
    66Tested up to: 7.1
    7 Stable tag: 6.1.5
     7Stable tag: 6.1.6
    88Requires PHP: 7.4
    99License: GPLv2 or later
    … …  
    309309== Changelog ==
    310310
     311= 6.1.6 =
     312* New: Live Preview added.
     313* Update: Dashboard design updated.
     314* Code optimized.
     315
    311316= 6.1.5 =
    312317* Try live demo link updated to new demo site.
  • woo-product-table/trunk/templates/table-preview.php

    r2839777 r3837744  
     1<?php
     2$wpt_preview_post_id = get_queried_object_id();
     3if ( empty( $wpt_preview_post_id ) && ! empty( $_GET['wpt_table_id'] ) ) {
     4    $wpt_preview_post_id = absint( $_GET['wpt_table_id'] );
     5}
     6$is_embed_preview    = ! empty( $_GET['wpt_embed_preview'] ) && is_user_logged_in() && ( $wpt_preview_post_id ? current_user_can( 'edit_post', $wpt_preview_post_id ) : current_user_can( 'edit_wpt_product_tables' ) );
     7if ( $is_embed_preview ) {
     8    show_admin_bar( false );
     9}
     10?>
    111<!doctype html>
    212<html <?php language_attributes(); ?>>
    … …  
    414        <meta charset="<?php bloginfo( 'charset' ); ?>">
    515        <meta name="viewport" content="width=device-width, initial-scale=1">
    6         <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    716        <link rel="profile" href="https://gmpg.org/xfn/11">
    817        <style id="wpt-wpt-page">
    … …  
    2332                max-width: 100%;
    2433            }
     34            <?php if ( $is_embed_preview ) : ?>
     35            html { margin-top: 0 !important; }
     36            body.wpt-table-preview-body { background: #ffffff !important; margin: 0 !important; }
     37            body.wpt-table-preview-body div#page { padding: 16px 20px !important; }
     38            body.wpt-table-embed-preview .wpt_edit_table { display: none !important; }
     39            <?php endif; ?>
    2540        </style>
    2641        <?php wp_head(); ?>
    2742</head>
    2843
    29 <body <?php body_class( 'wpt-table-preview-body' ); ?>>
     44<body <?php body_class( $is_embed_preview ? 'wpt-table-preview-body wpt-table-embed-preview' : 'wpt-table-preview-body' ); ?>>
    3045<?php wp_body_open(); ?>
    3146
    … …  
    3348<div id="page" class="hfeed site wpt-fullwidth">
    3449<?php
    35     if ( have_posts() ) : while ( have_posts() ) : the_post();
    36     $id = get_the_ID();
    37     $title = get_the_title();
     50    $id = ! empty( $wpt_preview_post_id ) ? absint( $wpt_preview_post_id ) : get_the_ID();
     51    $title = $id ? get_the_title( $id ) : '';
    3852
    39 
     53    if ( ! $is_embed_preview ) :
    4054    ?>
    4155    <div class="wpt-preview-title">
    42         <h2 class="wpt-preview-heading"><?php the_title(); ?></h2>
     56        <h2 class="wpt-preview-heading"><?php echo esc_html( $title ); ?></h2>
    4357
    4458        <?php if( is_user_logged_in() ){ ?>
    … …  
    5872
    5973    <?php
     74    endif;
    6075
     76    if ( $id ) {
     77        $preview_attr = ! empty( $_GET['wpt_live_preview'] ) ? " preview_mode='1'" : '';
     78        echo do_shortcode( "[Product_Table id='{$id}'{$preview_attr}]" );
     79    }
    6180
    62     echo do_shortcode("[Product_Table id='{$id}']");
    63     endwhile;
     81    if ( $is_embed_preview && $id ) :
     82    ?>
     83    <script>
     84    if ( window.parent && window.parent !== window ) {
     85        try {
     86            window.parent.postMessage( { type: 'wptLivePreviewReady', tableId: <?php echo (int) $id; ?> }, window.location.origin );
     87        } catch (err) {}
     88    }
     89    </script>
     90    <?php
    6491    endif;
    6592
  • woo-product-table/trunk/woo-product-table.php

    r3772130 r3837744  
    99 * Tags: wooproducttable, woocommerce product list,woocommerce product table, wc product table, product grid view, inventory, shop product table
    1010 *
    11  * Version: 6.1.5
     11 * Version: 6.1.6
    1212 * Requires at least:    6.2
    1313 * Tested up to:         7.1
    … …  
    4545
    4646if( ! defined( 'WPT_DEV_VERSION' ) ){
    47     define( 'WPT_DEV_VERSION', '6.1.5.0' );
     47    define( 'WPT_DEV_VERSION', '6.1.6.0' );
    4848}
    4949
    … …  
    9191$wpt_old_pro_dir = trailingslashit( WP_PLUGIN_DIR ) . 'woo-product-table-pro';
    9292
    93 
     93//an example notice added at Dashbord, no need condition. just want to show a notice
     94add_action( 'admin_notices', function() {
     95    if( is_plugin_active( 'woo-product-table-pro/woo-product-table-pro.php' ) ){
     96        ?>
     97        <div class="notice notice-error is-dismissible">
     98            <p><?php echo esc_html__( 'You have installed the old version of Woo Product Table Pro plugin. Please deactivate it and use the new version of Woo Product Table Pro plugin.', 'woo-product-table' ); ?></p>
     99        </div>
     100        <?php
     101    }
     102} );
    94103
    95104/**
    … …  
    513522             */
    514523            //include_once $this->path('BASE_DIR','includes/wpt_product_table_post.php');
     524            include_once $this->path('BASE_DIR','includes/live-preview.php');
    515525            include_once $this->path('BASE_DIR','includes/enqueue.php');
    516526           
    … …  
    572582         * Getting Device Object Info by Using Mobile_Detect Class
    573583         *
    574          * @param type $userAgent
     584         * @param null|string $userAgent
    575585         * @return \Mobile_Detect Object
    576586         */
    … …  
    582592         * Set Path
    583593         *
    584          * @param type $path_array
     594         * @param array $path_array
    585595         *
    586596         * @since 1.0.0
    … …  
    597607         * Name should like Constant and full Capitalize
    598608         *
    599          * @param type $name
     609         * @param string $name
    600610         * @return string
    601611         */
Note: See TracChangeset for help on using the changeset viewer.