Plugin Directory

Changeset 2975753


Ignore:
Timestamp:
10/07/2023 01:36:43 AM (2 years ago)
Author:
thanhtd
Message:

Update

Location:
bulky-bulk-edit-products-for-woo/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • bulky-bulk-edit-products-for-woo/trunk/CHANGELOG.txt

    r2933105 r2975753  
     1/** 1.1.5 - 2023.10.07 **/
     2– Added: Filter multiple SKU with comma separate
     3– Fixed: Sort by SKU
     4
    15/** 1.1.4 - 2023.07.03 **/
    26– Updated: Compatible with WooCommerce HPOS(COT)
  • bulky-bulk-edit-products-for-woo/trunk/admin/ajax.php

    r2901636 r2975753  
    123123
    124124        $args = [
    125             'posts_per_page' => $settings['products_per_page'],
     125            'posts_per_page' => 10,
    126126            'paged'          => $page,
    127127            'paginate'       => true,
    128128            'order'          => $settings['order'],
    129             'orderby'        => $settings['order_by'],
     129            'orderby'        => 'ID',
    130130            'status'         => array( 'publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit' ),
    131131        ];
    132132
    133         if ( $orderby == 'price' ) {
    134             $args['orderby'] = [ 'meta_value_num' => $settings['order'] ];
    135             add_filter( 'woocommerce_product_data_store_cpt_get_products_query', [ $this, 'orderby_price' ] );
    136         }
     133        switch ( $orderby ) {
     134            case 'price':
     135                $args['orderby'] = [ 'meta_value_num' => $settings['order'] ];
     136                add_filter( 'woocommerce_product_data_store_cpt_get_products_query', [ $this, 'orderby_price' ] );
     137                break;
     138
     139            case 'sku':
     140                $args['orderby']  = 'meta_value';
     141                $args['meta_key'] = '_sku';
     142                break;
     143
     144            default:
     145                $args['orderby'] = $orderby;
     146
     147                break;
     148        }
     149
     150        remove_all_filters( 'woocommerce_product_object_query_args' );
     151        remove_all_filters( 'woocommerce_product_object_query' );
    137152
    138153        $args   = $filter->set_args( $args );
  • bulky-bulk-edit-products-for-woo/trunk/admin/editor.php

    r2790645 r2975753  
    5858        $full_screen_icon  = get_option( 'vi_wbe_full_screen_option' ) ? 'window close outline' : 'external alternate';
    5959        $full_screen_title = get_option( 'vi_wbe_full_screen_option' ) ? esc_html__( 'Exit full screen', 'bulky-woocommerce-bulk-edit-products' ) : esc_html__( 'Full screen', 'bulky-woocommerce-bulk-edit-products' );
     60
     61        add_filter( 'bulky_filter_behaviors_list', [ $this, 'add_sku_behavior' ], 10, 2 );
    6062
    6163        ?>
     
    769771        ];
    770772
     773        $behaviors = apply_filters( 'bulky_filter_behaviors_list', $behaviors, $id );
     774
    771775        $saved_behavior = $this->filter_saved['behavior'][ $id ] ?? '';
    772776        ob_start();
     
    803807        return ob_get_clean();
    804808    }
     809
     810
     811    public function add_sku_behavior( $behaviors, $id ) {
     812        if ( $id == 'sku' ) {
     813            $behaviors = [ 'in' => 'In' ] + $behaviors;
     814        }
     815
     816        return $behaviors;
     817    }
    805818}
  • bulky-bulk-edit-products-for-woo/trunk/admin/filters.php

    r2823303 r2975753  
    295295
    296296            $type  = $item['type'];
    297             $value = sanitize_text_field( wp_specialchars_decode( trim(  $item['value'] ) ) );
     297            $value = sanitize_text_field( wp_specialchars_decode( trim( $item['value'] ) ) );
    298298
    299299            $query = '';
     
    357357            }
    358358
    359             $sku           = sanitize_text_field( wp_specialchars_decode( trim(  $sku ) ) );
     359            $sku           = sanitize_text_field( wp_specialchars_decode( trim( $sku ) ) );
    360360            $sku_condition = '';
    361361
     
    377377                    break;
    378378
     379                case 'like':
     380                    $sku_condition .= "postmeta.meta_value LIKE '%{$sku}%'";
     381                    break;
     382
    379383                default:
    380                     $sku_condition .= "postmeta.meta_value LIKE '%{$sku}%'";
     384                    $skus          = explode( ',', $sku );
     385                    $skus          = array_map( 'trim', $skus );
     386                    $skus          = implode( "','", $skus );
     387                    $sku_condition .= "postmeta.meta_value IN ('{$skus}') ";
    381388                    break;
    382389            }
  • bulky-bulk-edit-products-for-woo/trunk/bulky-bulk-edit-products-for-woo.php

    r2933105 r2975753  
    44 * Plugin URI: https://villatheme.com/extensions/bulky-woocommerce-bulk-edit-products/
    55 * Description: Bulky - Bulk Edit Products for WooCommerce helps easily work with products in bulk. The plugin offers sufficient simple and advanced tools to help filter various available attributes of simple and variable products such as  ID, Title, Content, Excerpt, Slugs, SKU, Post date, range of regular price and sale price, Sale date, range of stock quantity, Product type, Categories.... Users can quickly search for wanted products fields and work with the product fields in bulk. The plugin promises to help users to save time and optimize manipulation when working with products in bulk.
    6  * Version: 1.1.4
     6 * Version: 1.1.5
    77 * Author: VillaTheme
    88 * Author URI: https://villatheme.com
     
    1111 * Copyright 2021-2022 VillaTheme.com. All rights reserved.
    1212 * Requires at least: 5.0
    13  * Tested up to: 6.2
     13 * Tested up to: 6.3
    1414 * WC requires at least: 5.0
    1515 * WC tested up to: 7.7
     
    3737        public $plugin_name = 'Bulky - Bulk Edit Products for WooCommerce';
    3838
    39         public $version = '1.1.4';
     39        public $version = '1.1.5';
    4040
    4141        public $conditional = '';
  • bulky-bulk-edit-products-for-woo/trunk/includes/data.php

    r2738966 r2975753  
    377377                [
    378378                    'edit_fields'          => [],
    379                     'products_per_page'    => 20,
     379                    'products_per_page'    => 10,
    380380                    'load_variations'      => 'yes',
    381381                    'order_by'             => 'ID',
  • bulky-bulk-edit-products-for-woo/trunk/readme.txt

    r2933105 r2975753  
    261261== Changelog ==
    262262
     263/** 1.1.5 - 2023.10.07 **/
     264– Added: Filter multiple SKU with comma separate
     265– Fixed: Sort by SKU
     266
    263267/** 1.1.4 - 2023.07.03 **/
    264268– Updated: Compatible with WooCommerce HPOS(COT)
  • bulky-bulk-edit-products-for-woo/trunk/support/support.php

    r2933105 r2975753  
    10191019
    10201020                        case 'install':
    1021                             $this->notices[] = sprintf( "%s to be installed. <a href='%s' target='_blank' class='button button-primary' style='vertical-align: middle'>Install %s</a>",
     1021                            $this->notices[] = sprintf( "%s to be installed. <br><a href='%s' target='_blank' class='button button-primary' style='vertical-align: middle; margin-top: 5px;'>Install %s</a>",
    10221022                                esc_html( $require_plugin_name ),
    10231023                                esc_url( ! empty( $status['url'] ) ? $status['url'] : '#' ),
     
    10381038                                );
    10391039
    1040                                 $this->notices[] = sprintf( "%s is installed and activated. <a href='%s' target='_blank' class='button button-primary' style='vertical-align: middle'>Active %s</a>",
     1040                                $this->notices[] = sprintf( "%s is installed and activated. <br> <a href='%s' target='_blank' class='button button-primary' style='vertical-align: middle; margin-top: 5px;'>Active %s</a>",
    10411041                                    esc_html( $require_plugin_name ),
    10421042                                    esc_url( $activate_url ),
Note: See TracChangeset for help on using the changeset viewer.