HEX
Server: LiteSpeed
System: Linux cpir1.prohostdns.com 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: pelakir (2976)
PHP: 8.2.31
Disabled: exec, shell_exec, system, passthru, proc_open, proc_close, proc_terminate, proc_get_status, popen, pclose, pcntl_exec
Upload Files
File: /home/pelakir/www/wp-content/plugins/persian-woocommerce-shipping/includes/class-product.php
<?php
/**
 * Developer : MahdiY
 * Web Site  : MahdiY.IR
 * E-Mail    : M@hdiY.IR
 */

defined( 'ABSPATH' ) || exit;

class PWS_Product {

	public static function get_weight( WC_Product $product ): float {

		if ( $product->is_virtual() ) {
			$weight = 0;
		} else if ( $product->has_weight() ) {
			$weight = wc_get_weight( $product->get_weight(), 'g' );
		} else {
			$weight = PWS()->get_option( 'tools.product_weight', 500 );
		}

		return floatval( apply_filters( 'pws_product_weight', $weight, $product ) );
	}

}