• I’m experiencing a reproducible bug with RWPP where adding new products to a sorted category causes the sort order to scramble for products immediately after the insertion point.

    Environment:

    • WordPress with WooCommerce
    • Woodmart theme + Elementor
    • 56 products per page in RWPP
    • Affected categories have 800-12000 products

    Reproduction steps:

    1. Set up a custom sort order for a category using RWPP (
    2. Bulk add new products to that category
    3. New products appear at the top (assigned menu_order 0 by WooCommerce)
    4. Open RWPP admin for the category and drag the new products down to page 2
    5. Save the new order

    Result:
    The sort order for products immediately after the insertion point is scrambled. The damage is localised and it does not affect the entire category, only the products after where the new products were inserted. In our case approximately 2.5 pages worth of products around the insertion point were affected, while products further away remained in the correct order.

    The rwpp_sortorder_{term_id} meta values for the affected products appear to be renumbered incorrectly at the page boundary. Our diagnosis is that RWPP is recalculating positions relative to the current page rather than the full category, causing numbering collisions at page boundaries when an insertion spans multiple pages.

    Debug evidence:
    We have PHP error log evidence showing RWPP firing correctly on the affected categories (“FORCED custom table sorting for category 175”) but the Meta Query returning empty after the scramble occurs:

    PHP message: === RWPP Frontend Query Debug ===
    PHP message: Orderby: menu_order title
    PHP message: Meta Query: Array()
    PHP message: Expected Meta Key: rwpp_sortorder_175

    We also have a pre_get_posts hook at priority 9999 applied as a workaround to force the correct orderby on the main query for these categories, which confirms the meta values themselves are being corrupted rather than just the query.

    The rwpp_sortorder_* meta count across the database (44,514 records across 380 categories) confirms the meta is present and healthy before the scramble and it is the renumbering on insertion that causes the corruption.

    Could you investigate whether the position recalculation on insertion is page-aware rather than category-wide, and whether this is causing boundary collisions when products are moved across page breaks?

You must be logged in to reply to this topic.