Try scoping the per page before the includes and distinct_by_product_ids