HEX
Server: LiteSpeed
System: Linux sg-cp4.cloudnetwork.vn 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64
User: thu28850 (1134)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/thu28850/public_html/wp-content/plugins/woocommerce-deals/includes/deal-functions.php
<?php
/**
 * WooCommerce deal functions
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Check if a product is a deal
 *
 * @param int|object $product
 *
 * @return bool
 */
function tawc_is_deal_product( $product ) {
	$product = is_numeric( $product ) ? wc_get_product( $product ) : $product;

	// It must be a sale product first
	if ( ! $product->is_on_sale() ) {
		return false;
	}

	// Only support product type "simple" and "external"
	if ( ! $product->is_type( 'simple' ) && ! $product->is_type( 'external' ) ) {
		return false;
	}

	$deal_quantity = get_post_meta( $product->get_id(), '_deal_quantity', true );

	if ( $deal_quantity > 0 ) {
		return true;
	}

	return false;
}