OFBiz
  1. OFBiz
  2. OFBIZ-4528

Out of stock products screw up the pagination during category browsing

    Details

      Description

      Pagination is handled in getProductCategoryAndLimitedMembers
      Then the out of stock filtering is done in CategoryDetail.groovy.
      Hence the pagination is screwed up. Certain pages might show less records or no records based upon data condition.

      1. OFBIZ-4528.patch
        13 kB
        Arun Patidar
      2. OFBIZ-4528.patch
        15 kB
        Arun Patidar

        Activity

        Kiran Gawde created issue -
        Arun Patidar made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Arun Patidar added a comment -

        Steps to reproduce and test:

        1. Set 'showOutOfStockProducts' flag in ProductStore entity to 'N'
        2. Make some products of any category 'Out Of Stock' by reducing inventory and set it to zero

        Test case for ecommerce store:

        1. Go to ecommerce http://localhost:8080/ecommerce/control/main
        2. Browse products by clicking 'Categories' from left nav
        3. Observe the counts of pagination and actual products display

        Test case for ordermgr:

        1. Go to ordermgr -> Order Entry (https://localhost:8443/ordermgr/control/orderentry)
        2. On 'Add To Order' page of sales order creation page
        3. Select products to add by selecting 'Browse Categories' from left nav.
        4. Observe the counts of pagination and actual products display

        Expected Result: Pagination count and number of products display should be same

        Show
        Arun Patidar added a comment - Steps to reproduce and test: 1. Set 'showOutOfStockProducts' flag in ProductStore entity to 'N' 2. Make some products of any category 'Out Of Stock' by reducing inventory and set it to zero Test case for ecommerce store: 1. Go to ecommerce http://localhost:8080/ecommerce/control/main 2. Browse products by clicking 'Categories' from left nav 3. Observe the counts of pagination and actual products display Test case for ordermgr: 1. Go to ordermgr -> Order Entry ( https://localhost:8443/ordermgr/control/orderentry ) 2. On 'Add To Order' page of sales order creation page 3. Select products to add by selecting 'Browse Categories' from left nav. 4. Observe the counts of pagination and actual products display Expected Result: Pagination count and number of products display should be same
        Ashish Vijaywargiya made changes -
        Assignee Ashish Vijaywargiya [ toashishvijay ]
        Ashish Vijaywargiya made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Arun Patidar added a comment -

        Attached is a patch for same.

        Show
        Arun Patidar added a comment - Attached is a patch for same.
        Arun Patidar made changes -
        Attachment OFBIZ-4528.patch [ 12675660 ]
        Hide
        Mridul Pathak added a comment -

        I reviewed the patch and have couple suggestions,
        1. filterOutOfStockProducts() method should be moved to ProductWorker.java and made public.
        2. In the method calls there is additional white space before opening bracket.

        Show
        Mridul Pathak added a comment - I reviewed the patch and have couple suggestions, 1. filterOutOfStockProducts() method should be moved to ProductWorker.java and made public. 2. In the method calls there is additional white space before opening bracket.
        Hide
        Mridul Pathak added a comment -

        Additional details around the actual problem and solution in the patch,

        Actual Problem - The out of stock products were being filtered in CategoryDetail.groovy after receiving the product list from getProductCategoryAndLimitedMembers, while pagination values were being set and returned by the mentioned service. The list size at the end was changing and the pagination values returned were not in sync with the final list size.

        Solution - The filtering of out of stock product must be done in getProductCategoryAndLimitedMembers service itself before setting the pagination values.

        Show
        Mridul Pathak added a comment - Additional details around the actual problem and solution in the patch, Actual Problem - The out of stock products were being filtered in CategoryDetail.groovy after receiving the product list from getProductCategoryAndLimitedMembers, while pagination values were being set and returned by the mentioned service. The list size at the end was changing and the pagination values returned were not in sync with the final list size. Solution - The filtering of out of stock product must be done in getProductCategoryAndLimitedMembers service itself before setting the pagination values.
        Hide
        Arun Patidar added a comment -

        Thanks Mridul for reviewing. I have attached modified patch.

        Show
        Arun Patidar added a comment - Thanks Mridul for reviewing. I have attached modified patch.
        Arun Patidar made changes -
        Attachment OFBIZ-4528.patch [ 12675667 ]
        Ashish Vijaywargiya made changes -
        Affects Version/s Release Branch 13.07 [ 12324879 ]
        Affects Version/s Release Branch 11.04 [ 12316420 ]
        Ashish Vijaywargiya made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Ashish Vijaywargiya added a comment -

        Thanks Arun for the contribution. Commited changes in trunk at r1632750 and in Release Branch 13.07 at r1632760.

        Show
        Ashish Vijaywargiya added a comment - Thanks Arun for the contribution. Commited changes in trunk at r1632750 and in Release Branch 13.07 at r1632760.
        Ashish Vijaywargiya made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Jacques Le Roux made changes -
        Fix Version/s Upcoming Branch [ 12327361 ]
        Fix Version/s 13.07.02 [ 12328788 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        1058d 8h 11m 1 Arun Patidar 20/Sep/14 07:55
        Patch Available Patch Available Open Open
        1d 22h 36m 1 Ashish Vijaywargiya 22/Sep/14 06:32
        Open Open In Progress In Progress
        26d 5h 52m 1 Ashish Vijaywargiya 18/Oct/14 12:24
        In Progress In Progress Closed Closed
        1m 13s 1 Ashish Vijaywargiya 18/Oct/14 12:26

          People

          • Assignee:
            Ashish Vijaywargiya
            Reporter:
            Kiran Gawde
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development