Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AshlinRejo/d16e622b6c87df8e7b675cbd6fa4f56a to your computer and use it in GitHub Desktop.
Save AshlinRejo/d16e622b6c87df8e7b675cbd6fa4f56a to your computer and use it in GitHub Desktop.
Discount rule v2: Get matched rule range/table info based on product in product page
if(class_exists('\Wdr\App\Router')) {
global $product;
$discountManager = \Wdr\App\Router::$manage_discount;
$discountCalculator = $discountManager::$calculator;
$is_variant = false;
$bulk_discounts_ranges = $discountCalculator->getDefaultLayoutMessagesByRules($product, $is_variant);
//$bulk_discounts_ranges Here you get rule range info
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment