Nop_ProductLoadAllPaged small issue

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 anni tempo fa
Hi,

Nop_ProductLoadAllPaged is considering ProductVariants which Deleted=1 leading to problems with sorting.

I've fixed it by simply putting an "AND pv.Deleted=0" in the where clause.

Thanks
13 anni tempo fa
I've just noticed things are a bit more complicated than that. Actually we can indeed have products and no productvariant. The only problem is that when trying to sort, the stored procedure will take in consideration deleted product variants.

So instead of only adding:

AND
      (
        pv.Deleted=0
      )

it will only work with

AND
      (
        @OrderBy=0 OR pv.Deleted=0
      )
13 anni tempo fa
Correction:

AND
      (
        @OrderBy<>0 AND pv.Deleted=0
      )
13 anni tempo fa
Correction # 2:


    AND
      (
        @OrderBy=0 OR (@OrderBy<>0 AND pv.Deleted=0)
      )

My bad! :P
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.