WC_Abstract_Order::has_free_item()
Returns true if the order contains a free product.
Description Description
Return Return
(bool)
Source Source
File: includes/abstracts/abstract-wc-order.php
public function has_free_item() { foreach ( $this->get_items() as $item ) { if ( ! $item->get_total() ) { return true; } } return false; }
Changelog Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |