• Resolved vetalp

    (@vetalp)


    Starting with update 4.1.3, products in categories no longer open. I open the “Sort by categories” tab, then from the drop-down list I select the category I need, but the products are not displayed. It doesn’t show me any product in any category. Before this update everything was working fine. What happened?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Aslam Doctor

    (@aslamdoctor)

    @vetalp I have published the fixes with new updates. Please update the plugin and let me know if you are still facing any issues.

    I am experiencing the same issue: No products are shown/listed after selecting a category from the category drop-down list. The plugin version is the latest 4.1.5. The plugin used to work without such issues in the previous versions.

    I had the same problem today, so I discovered the dropdown hasn’t any event attached.

    In the file rearrange-woocommerce-products.php line 116 function enqueue assets the $hook expected value was rearrange-products_page_rwpp-sortby-categories-page and the received $hook was reordenar-los-productos_page_rwpp-sortby-categories-page

    Somehow the value of $hook has been translated by my Translatepress plugin, you can change the expected hook values at line 118 or comment out the lines 118, 119 and 120 as a temporal dirty hack.

    • This reply was modified 1 year, 3 months ago by automatix.
    Plugin Author Aslam Doctor

    (@aslamdoctor)

    @automatix I have implemented a fix locally. Can you try replacing this method code and let me know if that fixes the issue for you before I publish an update?

    public function enqueue_assets( $hook ) {
    			$pagenow = get_current_screen();
    			// die( print_r( $pagenow ) );
    
    			if ( $pagenow && ( 'toplevel_page_rwpp-page' !== $pagenow->base && 'rearrange-products_page_rwpp-sortby-categories-page' !== $pagenow->base && 'rearrange-products_page_rwpp-troubleshooting-page' !== $pagenow->base ) ) {
    				return;
    			}
    
    			// Stylesheets.
    			wp_register_style( 'rwpp_css', ( RWPP_LOCATION_URL . '/dist/css/main.css' ), false, '3.0.8' );
    			wp_enqueue_style( 'rwpp_css' );
    
    			// Javascripts.
    			wp_register_script( 'rwpp_js', ( RWPP_LOCATION_URL . '/dist/js/main.js' ), array( 'jquery', 'jquery-ui-sortable' ), '3.0.8', true );
    			wp_localize_script(
    				'rwpp_js',
    				'rwpp_ajax_var',
    				array(
    					'url'   => admin_url( 'admin-ajax.php' ),
    					'nonce' => wp_create_nonce( 'rwpp-ajax-nonce' ),
    				)
    			);
    			wp_enqueue_script( 'rwpp_js' );
    		}

    No, the dump for $pagenow is:

    WP_Screen Object
    (
        [action] => 
        [base] => reordenar-los-productos_page_rwpp-sortby-categories-page
        [columns:WP_Screen:private] => 0
        [id] => reordenar-los-productos_page_rwpp-sortby-categories-page
        [in_admin:protected] => site
        [is_network] => 
        [is_user] => 
        [parent_base] => 
        [parent_file] => 
        [post_type] => 
        [taxonomy] => 
        [_help_tabs:WP_Screen:private] => Array
            (
            )
    
        [_help_sidebar:WP_Screen:private] => 
        [_screen_reader_content:WP_Screen:private] => Array
            (
            )
    
        [_options:WP_Screen:private] => Array
            (
            )
    
        [_show_screen_options:WP_Screen:private] => 
        [_screen_settings:WP_Screen:private] => 
        [is_block_editor] => 
    )

    I disabled the Translatepress and the result is the same, so it’s not related to that plugin.

    • This reply was modified 1 year, 3 months ago by automatix.
    Plugin Author Aslam Doctor

    (@aslamdoctor)

    That’s strange. Translatepress isn’t supposed to do that. If I remove that page check code, the assets will load on all the pages under Admin. I will look into this later today. Meanwhile can you also ask Translatepress support why they are translating the URLs too?

    I disabled Translatepress, and the result is the same.

    Plugin Author Aslam Doctor

    (@aslamdoctor)

    @automatix What happens when you disable this code?

    if ( $pagenow && ( 'toplevel_page_rwpp-page' !== $pagenow->base && 'rearrange-products_page_rwpp-sortby-categories-page' !== $pagenow->base && 'rearrange-products_page_rwpp-troubleshooting-page' !== $pagenow->base ) ) {
    				return;
    			}

    It works,

    I’ve tried this:

    $pagenow = $_REQUEST["page"];
    if ( $pagenow && ( 'rwpp-page' !== $pagenow && 'rwpp-sortby-categories-page' !== $pagenow && 'rwpp-troubleshooting-page' !== $pagenow ) ) {
    return;
    }

    And it’s working.

    Plugin Author Aslam Doctor

    (@aslamdoctor)

    That’s great if it is showing categories now. I thought of doing it but using $_REQUEST is not a very safe way. I will try to make it more safer and will publish an update by tomorrow.

    Thanks @automatix

    One more thing, it’s very strange that the original translation for the plugin’s name is in Spanish “Reorganizar los productos de Woocommerce” but I’m seeing “Reordenar los productos”.

    I don’t have any custom code related to that, and I can’t find with LOCO translate any string that contains the string “Reordenar”. To be fair IDK how the translation of the menu

    • This reply was modified 1 year, 3 months ago by automatix.
    Plugin Author Aslam Doctor

    (@aslamdoctor)

    Ok, found old .mo and .po files on /wp-content/languages/plugins/ , deleted it and then the dump for $pagenow is

    WP_Screen Object
    (
        [action] => 
        [base] => reorganizar-productos_page_rwpp-sortby-categories-page
        [columns:WP_Screen:private] => 0
        [id] => reorganizar-productos_page_rwpp-sortby-categories-page
        [in_admin:protected] => site
        [is_network] => 
        [is_user] => 
        [parent_base] => 
        [parent_file] => 
        [post_type] => 
        [taxonomy] => 
        [_help_tabs:WP_Screen:private] => Array
            (
            )
    
        [_help_sidebar:WP_Screen:private] => 
        [_screen_reader_content:WP_Screen:private] => Array
            (
            )
    
        [_options:WP_Screen:private] => Array
            (
            )
    
        [_show_screen_options:WP_Screen:private] => 
        [_screen_settings:WP_Screen:private] => 
        [is_block_editor] => 
    )
    Plugin Author Aslam Doctor

    (@aslamdoctor)

    OK, cool. I will be publishing an update tomorrow morning after further testing. Thanks for the help in testing @automatix

    Thank you for your time.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Products are no longer displayed in categories’ is closed to new replies.