A category has four manually arranged products. Two new arrivals change the order on the storefront. Record the existing SKUs and their Position values so you can place the additions and preserve the relative order of the other products.
Read the positions after assignment
In Magento 2.4.9, assigning a product through CategoryLinkManagement sets position 0 on the new link. With the listing sorted by ascending position, those items can appear ahead of products with positions from 1. Check the actual values after your own import or save. Assignment code in Magento 2.4.9
| SKU | Before adding | After assignment | To save after reordering |
|---|---|---|---|
| R-01 | 1 | 1 | 1 |
| R-02 | 2 | 2 | 2 |
| R-03 | 3 | 3 | 5 |
| R-04 | 4 | 4 | 6 |
| R-05 | Unassigned | 0 | 3 |
| R-06 | Unassigned | 0 | 4 |
Arrange the six rows together
In a test category, show all six assigned rows on a single grid page. Place R-05 and R-06 after R-02. Draggable Sort Product 1.0.1 numbers displayed rows from 1 and submits the positions of checked products when the category is saved. Draggable Sort Product documentation
Save and reopen the category, then compare its Position column with the last column in the table. On the storefront, sort by ascending position. Check that R-01, R-02, R-03, and R-04 retain their relative order. In a larger category, also check positions outside the grid page you changed. Adobe documentation on category assignments
Kowal Draggable Sort Product for Magento 2 · Basics of arranging category products manually
