You appear to be a bot. Output may be restricted
Description
Get discount by key with or without precision.
Usage
$float = WC_Discounts::get_discount( $key, $in_cents );
Parameters
- $key
- ( string ) required – name of discount row to return.
- $in_cents
- ( bool ) optional – Should the totals be returned in cents, or without precision.
Returns
float
Source
File name: woocommerce/includes/class-wc-discounts.php
Lines:
1 to 4 of 4
public function get_discount( $key, $in_cents = false ) { $item_discount_totals = $this->get_discounts_by_item( $in_cents ); return isset( $item_discount_totals[ $key ] ) ? $item_discount_totals[ $key ] : 0; }