WC_Product::has_weight PHP Метод

has_weight() публичный Метод

Returns whether or not the product has weight set.
public has_weight ( ) : boolean
Результат boolean
    public function has_weight()
    {
        return $this->get_weight() && !$this->get_virtual();
    }

Usage Example

/**
 * Outputs a list of product attributes for a product.
 * @since  2.7.0
 * @param  WC_Product $product
 */
function wc_display_product_attributes($product)
{
    wc_get_template('single-product/product-attributes.php', array('product' => $product, 'attributes' => array_filter($product->get_attributes(), 'wc_attributes_array_filter_visible'), 'display_dimensions' => apply_filters('wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions())));
}
All Usage Examples Of WC_Product::has_weight
WC_Product