Merge pull request #22846 from teloconf/master

[ADD] Do Action before cart is emptied
This commit is contained in:
Mike Jolley 2019-03-01 10:04:25 +00:00 committed by GitHub
commit c655c2e38a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -634,6 +634,9 @@ class WC_Cart extends WC_Legacy_Cart {
* @param bool $clear_persistent_cart Should the persistant cart be cleared too. Defaults to true.
*/
public function empty_cart( $clear_persistent_cart = true ) {
do_action( 'woocommerce_before_cart_emptied' );
$this->cart_contents = array();
$this->removed_cart_contents = array();
$this->shipping_methods = array();