e; } $order = wc_get_order( get_post()->ID ); if ( ! $order ) { return false; } // At this point (no packaging data), only show if there's at least one existing and shippable product. foreach ( $order->get_items() as $item ) { if ( $item instanceof \WC_Order_Item_Product ) { $product = $item->get_product(); if ( $product && $product->needs_shipping() ) { return true; } } } return false; } /** * Checks if the store is in the US and has its default currency set to USD. * * @return bool */ private function store_in_us_and_usd() { $base_currency = get_woocommerce_currency(); $base_location = wc_get_base_location(); return in_array( $base_currency, $this->supported_currencies, true ) && in_array( $base_location['country'], $this->supported_countries, true ); } /** * Checks if WooCommerce Shipping & Tax is not installed. * * @return bool */ private function wcs_not_installed() { return ! $this->wcs_version; } /** * Checks if WooCommerce Shipping & Tax is up to date. */ private function wcs_up_to_date() { return $this->wcs_version && version_compare( $this->wcs_version, $this->min_wcs_version, '>=' ); } }