Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display all applied coupon labels in cart/checkout #427

Draft
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*** WooCommerce Subscriptions Core Changelog ***

= 5.6.0 - 2023-xx-xx =
* Fix - Display labels for all coupons applied to cart and checkout. #427

= 5.5.0 - 2023-03-10 =
* Fix - When HPOS is enabled, changing your address while paying for a renewal order will update the address on the subscription. #413
* Fix - Prevent admin error notices being shown for the "subscription trial end" event that was caused by no callbacks being attached to this scheduled action. #414
Expand Down
20 changes: 8 additions & 12 deletions templates/checkout/recurring-coupon-totals.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
/**
* Recurring cart subtotals totals
*
* @author WooCommerce
* @package WooCommerce Subscriptions/Templates
* @version 1.0.0 - Migrated from WooCommerce Subscriptions v3.1.0
*/

defined( 'ABSPATH' ) || exit;
$display_heading = true;

foreach ( WC()->cart->get_coupons() as $code => $coupon ) {
foreach ( $recurring_carts as $recurring_cart_key => $recurring_cart ) {
Expand All @@ -17,18 +15,16 @@
continue;
} ?>
<tr class="cart-discount coupon-<?php echo esc_attr( $code ); ?> recurring-total">
<?php if ( $display_heading ) { ?>
<?php $display_heading = false; ?>
<th rowspan="<?php echo esc_attr( count( $recurring_carts ) ); ?>"><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
<td data-title="<?php wc_cart_totals_coupon_label( $coupon ); ?>"><?php
wcs_cart_totals_coupon_html( $recurring_coupon, $recurring_cart );
echo '&nbsp;';
wcs_cart_coupon_remove_link_html( $recurring_coupon );?>
<td data-title="<?php wc_cart_totals_coupon_label( $coupon ); ?>">
<?php
wcs_cart_totals_coupon_html( $recurring_coupon, $recurring_cart );
echo '&nbsp;';
wcs_cart_coupon_remove_link_html( $recurring_coupon );
?>
</td>
<?php } else { ?>
<td><?php wcs_cart_totals_coupon_html( $recurring_coupon, $recurring_cart ); ?></td>
<?php } ?>
</tr> <?php
</tr>
<?php
}
}
}