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
        15 kB
        Arun Patidar
      2. OFBIZ-4528.patch
        13 kB
        Arun Patidar

        Activity

        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.
        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.
        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
        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
        Arun Patidar added a comment -

        Attached is a patch for same.

        Show
        Arun Patidar added a comment - Attached is a patch for same.
        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development