• Resolved osositno

    (@osositno)


    Hi
    I have used the woocommerce widgets to add latest products via the WPbakery page builder. Not sure if it has anyting to do with that. But, suddenly our Recent products are OLD products. THe modified date of the products are the same. Have not altered those.
    I do not know what the issue is?
    I had this widget /or selection via Woocommerce in WPbakery editor for some time, but suddenlig it is showing very old products instead of our new once.

    (ps. I have tried to remove it, saved, and added it again, but no difference. Same old products appear.
    The modified date of the actual products that are showing in the “recent product part” is several years ago.

    Any tips guys?
    Regards
    osositno

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter osositno

    (@osositno)

    If I remember correctly, Woocommerc Block were recently updated. It this the problem?

    Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    Just to check: Are you seeing the same thing when disabling WP Bakery’s pagebuilder and using WooCommerce Blocks instead?

    In addition, please share a copy of your system status report as well (you can find that under **WooCommerce > System Status**) as this will give us a much better overview on how your site is configured ??

    Thanks!

    Thread Starter osositno

    (@osositno)

    Hi
    Just found the problem. It was a custom sorting code that was added to functions.php file. The code worked like it should (sort products alphabetical based on title), but it did something with the Recently added products. It was working in all product categories, sorting it alphabetical.
    The code was:
    add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘custom_woocommerce_get_catalog_ordering_args’ );

    function custom_woocommerce_get_catalog_ordering_args( $args ) {
    $orderby_value = isset( $_GET[‘orderby’] ) ? woocommerce_clean( $_GET[‘orderby’] ) : apply_filters( ‘woocommerce_default_catalog_orderby’, get_option( ‘woocommerce_default_catalog_orderby’ ) );

    if ( ‘alphabetical’ == $orderby_value || ‘menu_order’ == $orderby_value ) {
    $args[‘orderby’] = ‘title’;
    $args[‘order’] = ‘ASC’;
    }

    return $args;
    }

    add_filter( ‘woocommerce_default_catalog_orderby_options’, ‘custom_woocommerce_catalog_orderby’ );
    add_filter( ‘woocommerce_catalog_orderby’, ‘custom_woocommerce_catalog_orderby’ );

    function custom_woocommerce_catalog_orderby( $sortby ) {
    $sortby[‘alphabetical’] = __( ‘Alfabetisk’ );
    return $sortby;
    }

    I removed the code, then the recent products appeared correctly again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Woocommerce recent products all wrong’ is closed to new replies.