Skip to content

Commit

Permalink
feat: add downloads details to checkout (#2162)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurelfulford authored Jul 21, 2023
1 parent 64bf6c1 commit 81c52f5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
7 changes: 2 additions & 5 deletions newspack-theme/sass/plugins/woocommerce.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,8 @@ table.woocommerce-table--order-details.shop_table,
.woocommerce-product-attributes,
.woocommerce-grouped-product-list.group_table,
.woocommerce-cart-form .woocommerce-cart-form__contents,
.cart-collaterals .shop_table_responsive {
.cart-collaterals .shop_table_responsive,
.woocommerce-table--order-downloads {
border-top: 1px solid var( --newspack-theme-color-border );

thead {
Expand Down Expand Up @@ -1556,10 +1557,6 @@ table.woocommerce-table--order-details.shop_table,
tr {
margin: 0 0 1.5rem;

&:first-child {
border-top: 1px solid;
}

&:last-child {
margin-bottom: 0;
}
Expand Down
17 changes: 17 additions & 0 deletions newspack-theme/woocommerce/checkout/thankyou.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,23 @@
}
?>
<?php endif; ?>

<?php
$downloads = $order->get_downloadable_items();
if ( $downloads ) {
?>
<h4><?php esc_html_e( 'Download your purchase', 'newspack' ); ?></h4>

<?php
wc_get_template(
'order/order-downloads.php',
array(
'downloads' => $downloads,
)
);
}
?>

<?php else : ?>

<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received">
Expand Down

0 comments on commit 81c52f5

Please sign in to comment.