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

feat: add downloads details to checkout #2162

Merged
merged 6 commits into from
Jul 21, 2023

Conversation

laurelfulford
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR adds the downloads table to the thank you screen in the WooCommerce checkout.

It's normally shown by default, but our simplified thankyou.php template removes the hooks where that and other information are normally inserted. So this PR re-adds it by adding a check for downloads, and then manually inserts what's normally the contents of the woocommerce/order/order-downloads.php template.

See 1200550061930446-as-1204781973711258

How to test the changes in this Pull Request:

  1. If your test site doesn't have one yet, create a downloadable product.
  2. Apply this PR and run npm run build.
  3. Go to your /shop screen, add your downloadable product to the cart, and run through the checkout process; on the final Thank You screen, confirm that a table with the download appears below the order information:

image

  1. Set up a page with the Checkout button, with your downloadable product.
  2. Run through the checkout using the Checkout button, and confirm you get to download your product from the thank you screen:

image

  1. To make sure this change doesn't cause any other issues, repeat steps 3 and 5 with non-downloadable products, and with carts with both a non-downloadable and a downloadable product.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@laurelfulford laurelfulford added the [Status] Needs Review The issue or pull request needs to be reviewed label Jul 17, 2023
@laurelfulford laurelfulford requested a review from a team as a code owner July 17, 2023 20:57
Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests well! 🙌

Non-blocking: if this template is copied from Woo, should we use wc_get_template() instead?

E.g.:

		<?php
		$downloads = $order->get_downloadable_items();
		if ( $downloads ) {
			wc_get_template(
				'order/order-downloads.php',
				array(
					'downloads'  => $downloads,
					'show_title' => true,
				)
			);
		}
		?>

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Jul 20, 2023
@laurelfulford
Copy link
Contributor Author

Non-blocking: if this template is copied from Woo, should we use wc_get_template() instead?

Oh, that's a much better idea 🙂 Will make that update before merging!

@laurelfulford laurelfulford merged commit 81c52f5 into master Jul 21, 2023
@laurelfulford laurelfulford deleted the feat/add-downloads-details-to-checkout branch July 21, 2023 19:45
matticbot pushed a commit that referenced this pull request Aug 8, 2023
# [1.77.0-alpha.1](v1.76.0...v1.77.0-alpha.1) (2023-08-08)

### Bug Fixes

* add padding to the file block when it has a background ([#2168](#2168)) ([5a29efa](5a29efa))
* improve new search setting appearance for WP 6.3 ([#2167](#2167)) ([a87f7e5](a87f7e5))

### Features

* add downloads details to checkout ([#2162](#2162)) ([81c52f5](81c52f5))
* add styles for the details block ([#2165](#2165)) ([25832c3](25832c3))
* add styles for the footnote block ([#2166](#2166)) ([22732f5](22732f5))
* add Threads logo to the social links menu ([#2158](#2158)) ([64bf6c1](64bf6c1))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.77.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Aug 8, 2023
# [1.77.0](v1.76.0...v1.77.0) (2023-08-08)

### Bug Fixes

* add padding to the file block when it has a background ([#2168](#2168)) ([5a29efa](5a29efa))
* improve new search setting appearance for WP 6.3 ([#2167](#2167)) ([a87f7e5](a87f7e5))

### Features

* add downloads details to checkout ([#2162](#2162)) ([81c52f5](81c52f5))
* add styles for the details block ([#2165](#2165)) ([25832c3](25832c3))
* add styles for the footnote block ([#2166](#2166)) ([22732f5](22732f5))
* add Threads logo to the social links menu ([#2158](#2158)) ([64bf6c1](64bf6c1))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.77.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants