Skip to content

Commit

Permalink
Do not unset package contents for shipping subscriptions with free tr…
Browse files Browse the repository at this point in the history
…ials
  • Loading branch information
asumaran committed Dec 13, 2024
1 parent 1692c41 commit 4aa8554
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions includes/class-wc-subscriptions-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,6 @@ public static function set_cart_shipping_packages( $packages ) {

if ( 'none' === self::$calculation_type ) {
foreach ( $packages as $index => $package ) {
foreach ( $package['contents'] as $cart_item_key => $cart_item ) {
if ( WC_Subscriptions_Product::get_trial_length( $cart_item['data'] ) > 0 ) {
unset( $packages[ $index ]['contents'][ $cart_item_key ] );
}
}

if ( empty( $packages[ $index ]['contents'] ) ) {
unset( $packages[ $index ] );
}
Expand Down

0 comments on commit 4aa8554

Please sign in to comment.