ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ.cart->get_shipping_total(); } if ( 'shipping_taxes' === $name ) { return WC()->cart->get_shipping_taxes(); } } /** * Initialize shipping. */ public function __construct() { $this->enabled = wc_shipping_enabled(); if ( $this->enabled ) { $this->init(); } } /** * Initialize shipping. */ public function init() { do_action( 'woocommerce_shipping_init' ); } /** * Shipping methods register themselves by returning their main class name through the woocommerce_shipping_methods filter. * * @return array */ public function get_shipping_method_class_names() { // Unique Method ID => Method Class name. $shipping_methods = array( 'flat_rate' => 'WC_Shipping_Flat_Rate', 'free_shipping' => 'WC_Shipping_Free_Shipping', 'local_pickup' => 'WC_Shipping_Local_Pickup', ); // For backwards compatibility with 2.5.x we load any ENABLED legacy shipping methods here. $maybe_load_legacy_methods = array( 'flat_rate', 'free_shipping', 'international_delivery', 'local_delivery', 'local_pickup' ); foreach ( $maybe_load_legacy_methods as $method ) { $options = get_option( 'woocommerce_' . $method . '_settings' ); if ( $options && isset( $options['enabled'] ) && 'yes' === $options['enabled'] ) { $shipping_methods[ 'legacy_' . $method ] = 'WC_Shipping_Legacy_' . $method; } } return apply_filters( 'woocommerce_shipping_methods', $shipping_methods ); } /** * Loads all shipping methods which are hooked in. * If a $package is passed, some methods may add themselves conditionally and zones will be used. * * @param array $package Package information. * @return WC_Shipping_Method[] */ public function load_shipping_methods( $package = array() ) { if ( ! empty( $package ) ) { $debug_mode = 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ); $shipping_zone = WC_Shipping_Zones::get_zone_matching_package( $package ); $this->shipping_methods = $shipping_zone->get_shipping_methods( true ); // translators: %s: shipping zone name. $matched_zone_notice = sprintf( __( 'Customer matched zone "%s"', 'woocommerce' ), $shipping_zone->get_zone_name() ); // Debug output. if ( $debug_mode && ! Constants::is_defined( 'WOOCOMMERCE_CHECKOUT' ) && ! Constants::is_defined( 'WC_DOING_AJAX' ) && ! wc_has_notice( $matched_zone_notice ) ) { wc_add_notice( $matched_zone_notice ); } } else { $this->shipping_methods = array(); } // For the settings in the backend, and for non-shipping zone methods, we still need to load any registered classes here. foreach ( $this->get_shipping_method_class_names() as $method_id => $method_class ) { $this->register_shipping_method( $method_class ); } // Methods can register themselves manually through this hook if necessary. do_action( 'woocommerce_load_shipping_methods', $package ); // Return loaded methods. return $this->get_shipping_methods(); } /** * Register a shipping method. * * @param object|string $method Either the name of the method's class, or an instance of the method's class. * * @return bool|void */ public function register_shipping_method( $method ) { if ( ! is_object( $method ) ) { if ( ! class_exists( $method ) ) { return false; } $method = new $method(); } if ( is_null( $this->shipping_methods ) ) { $this->shipping_methods = array(); } $this->shipping_methods[ $method->id ] = $method; } /** * Unregister shipping methods. */ public function unregister_shipping_methods() { $this->shipping_methods = null; } /** * Returns all registered shipping methods for usage. * * @return WC_Shipping_Method[] */ public function get_shipping_methods() { if ( is_null( $this->shipping_methods ) ) { $this->load_shipping_methods(); } return $this->shipping_methods; } /** * Get an array of shipping classes. * * @return array */ public function get_shipping_classes() { if ( empty( $this->shipping_classes ) ) { $classes = get_terms( 'product_shipping_class', array( 'hide_empty' => '0', 'orderby' => 'name', ) ); $this->shipping_classes = ! is_wp_error( $classes ) ? $classes : array(); } return apply_filters( 'woocommerce_get_shipping_classes', $this->shipping_classes ); } /** * Calculate shipping for (multiple) packages of cart items. * * @param array $packages multi-dimensional array of cart items to calc shipping for. * @return array Array of calculated packages. */ public function calculate_shipping( $packages = array() ) { $this->packages = array(); if ( ! $this->enabled || empty( $packages ) ) { return array(); } // Calculate costs for passed packages. foreach ( $packages as $package_key => $package ) { $this->packages[ $package_key ] = $this->calculate_shipping_for_package( $package, $package_key ); } /** * Allow packages to be reorganized after calculating the shipping. * * This filter can be used to apply some extra manipulation after the shipping costs are calculated for the packages * but before WooCommerce does anything with them. A good example of usage is to merge the shipping methods for multiple * packages for marketplaces. * * @since 2.6.0 * * @param array $packages The array of packages after shipping costs are calculated. */ $this->packages = array_filter( (array) apply_filters( 'woocommerce_shipping_packages', $this->packages ) ); return $this->packages; } /** * See if package is shippable. * * Packages are shippable until proven otherwise e.g. after getting a shipping country. * * @param array $package Package of cart items. * @return bool */ public function is_package_shippable( $package ) { // Packages are shippable until proven otherwise. if ( empty( $package['destination']['country'] ) ) { return true; } $allowed = array_keys( WC()->countries->get_shipping_countries() ); return in_array( $package['destination']['country'], $allowed, true ); } /** * Calculate shipping rates for a package, * * Calculates each shipping methods cost. Rates are stored in the session based on the package hash to avoid re-calculation every page load. * * @param array $package Package of cart items. * @param int $package_key Index of the package being calculated. Used to cache multiple package rates. * * @return array|bool */ public function calculate_shipping_for_package( $package = array(), $package_key = 0 ) { // If shipping is disabled or the package is invalid, return false. if ( ! $this->enabled || empty( $package ) ) { return false; } $package['rates'] = array(); // If the package is not shippable, e.g. trying to ship to an invalid country, do not calculate rates. if ( ! $this->is_package_shippable( $package ) ) { return $package; } // Check if we need to recalculate shipping for this package. $package_to_hash = $package; // Remove data objects so hashes are consistent. foreach ( $package_to_hash['contents'] as $item_id => $item ) { unset( $package_to_hash['contents'][ $item_id ]['data'] ); } // Get rates stored in the WC session data for this package. $wc_session_key = 'shipping_for_package_' . $package_key; $stored_rates = WC()->session->get( $wc_session_key ); // Calculate the hash for this package so we can tell if it's changed since last calculation. $package_hash = 'wc_ship_' . md5( wp_json_encode( $package_to_hash ) . WC_Cache_Helper::get_transient_version( 'shipping' ) ); if ( ! is_array( $stored_rates ) || $package_hash !== $stored_rates['package_hash'] || 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ) ) { foreach ( $this->load_shipping_methods( $package ) as $shipping_method ) { if ( ! $shipping_method->supports( 'shipping-zones' ) || $shipping_method->get_instance_id() ) { /** * Fires before getting shipping rates for a package. * * @since 4.3.0 * @param array $package Package of cart items. * @param WC_Shipping_Method $shipping_method Shipping method instance. */ do_action( 'woocommerce_before_get_rates_for_package', $package, $shipping_method ); // Use + instead of array_merge to maintain numeric keys. $package['rates'] = $package['rates'] + $shipping_method->get_rates_for_package( $package ); /** * Fires after getting shipping rates for a package. * * @since 4.3.0 * @param array $package Package of cart items. * @param WC_Shipping_Method $shipping_method Shipping method instance. */ do_action( 'woocommerce_after_get_rates_for_package', $package, $shipping_method ); } } /** * Filter the calculated shipping rates. * * @see https://gist.github.com/woogists/271654709e1d27648546e83253c1a813 for cache invalidation methods. * @param array $package['rates'] Package rates. * @param array $package Package of cart items. */ $package['rates'] = apply_filters( 'woocommerce_package_rates', $package['rates'], $package ); // Store in session to avoid recalculation. WC()->session->set( $wc_session_key, array( 'package_hash' => $package_hash, 'rates' => $package['rates'], ) ); } else { $package['rates'] = $stored_rates['rates']; } return $package; } /** * Get packages. * * @return array */ public function get_packages() { return $this->packages; } /** * Reset shipping. * * Reset the totals for shipping as a whole. */ public function reset_shipping() { unset( WC()->session->chosen_shipping_methods ); $this->packages = array(); } /** * Deprecated * * @deprecated 2.6.0 Was previously used to determine sort order of methods, but this is now controlled by zones and thus unused. */ public function sort_shipping_methods() { wc_deprecated_function( 'sort_shipping_methods', '2.6' ); return $this->shipping_methods; } }