Skip to content

Commit

Permalink
Convert cart max weight to packaging weight unit.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Apr 22, 2024
1 parent f716026 commit 4f4fece
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PickupDelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public static function register_classic_checkout_scripts() {
}

public static function get_pickup_delivery_cart_args() {
$max_weight = wc()->cart->get_cart_contents_weight();
$max_weight = wc_get_weight( (float) wc()->cart->get_cart_contents_weight(), wc_gzd_get_packaging_weight_unit() );
$shipping_method = wc_gzd_get_current_shipping_provider_method();
$max_dimensions = array(
'length' => 0.0,
Expand Down
2 changes: 1 addition & 1 deletion src/ShippingProvider/Auto.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public function get_pickup_locations( $address, $query_args = array() ) {
$pickup_locations = get_transient( $cache_key );
$address = $this->parse_pickup_location_address_args( $address );

if ( false === $pickup_locations ) {
if ( false === $pickup_locations && ( ! empty( $address['postcode'] ) || ! empty( $address['city'] ) ) ) {
$pickup_locations = $this->fetch_pickup_locations( $address, $query_args );

if ( ! is_null( $pickup_locations ) ) {
Expand Down

0 comments on commit 4f4fece

Please sign in to comment.