How can I get all sale products on the site, taking into account discounts from dynamic rules?
I reviewed the B2BKing classes, particularly B2bking_Globalhelper, and found a function for retrieving all dynamic rules, as well as fetching “global data” via:
B2bking_Globalhelper::get_global_data(false, false, $user_id);
Inside this function, I noticed some keys related to product IDs, such as:
- b2bking_discount_everywhere
- b2bking_discount_everywhere_parent
- b2bking_discount_everywhere_user_applicable_rules
Could you please explain what these array keys represent?
And overall, could you help me figure out how to properly retrieve all sale products for a specific user, so I can later pass this array of products further in the logic?