• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_Cart::get_discounted_amount() – Get Discounted Amount.

You appear to be a bot. Output may be restricted

Description

Get Discounted Amount.

Usage

$float|mixed|void = EDD_Cart::get_discounted_amount( $discounts );

Parameters

$discounts
( bool ) optional – Discount codes

Returns

float|mixed|void Total discounted amount

Source

File name: easy-digital-downloads/includes/cart/class-edd-cart.php
Lines:

1 to 15 of 15
  public function get_discounted_amount( $discounts = false ) {
    $amount = 0.00;
    $items  = $this->get_contents_details();

    if ( $items ) {
      $discounts = wp_list_pluck( $items, 'discount' );

      if ( is_array( $discounts ) ) {
        $discounts = array_map( 'floatval', $discounts );
        $amount    = array_sum( $discounts );
      }
    }

    return apply_filters( 'edd_get_cart_discounted_amount', $amount );
  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 8th April 2020

Primary Sidebar

Information

Function name: EDD_Cart::get_discounted_amount
Class ref: EDD_Cart
Plugin ref: Easy Digital Downloads
Version: 2.11.6
Sourcefile: includes/cart/class-edd-cart.php
File ref: includes/cart/class-edd-cart.php
Deprecated?: No
API Letters: A,C,D,E,G

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.9.3
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2022. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites