order/order-details.php
Omschrijving
The order/order-details.php template in WooCommerce is used to display the details of a customer’s order. It’s designed to be overridden by copying it to your theme directory, which allows you to customize it without losing changes on a WooCommerce update.
Here are some highlights about the functionality and structure of the order/order-details.php template:
- Order Retrieval: The template retrieves the order details based on the order ID provided, ensuring that the order exists before proceeding.
- Displaying Items: It iterates over each item in the order to display detailed information such as product name, quantity, and total price. Each item is handled by calling a separate template (
order-details-item.php), which can also be customized. - Security and Access: It includes checks to ensure that the page does not execute outside of WordPress (
ABSPATH) and confirms that the order belongs to the current user, thus enhancing privacy and security. - Customization Points: Several actions and filters are available for hooking into the template. This includes hooks before and after the order table, and around item listings, which allows for extending the template’s functionality or injecting additional data as needed.
- Versioning and Updates: The template file includes version information, which WooCommerce uses to manage compatibility and updates. You are advised to keep track of changes in template files with each WooCommerce update to ensure that your overrides remain compatible.
- Additional Features: Depending on the settings and the status of the order, the template can also handle and display downloads associated with the products purchased and any customer notes attached to the order.
This structure is part of WooCommerce’s template system, which is designed to be highly customizable. For detailed information and to view the source code, you can visit the WooCommerce Code Reference for order/order-details.php.
Locaties
The order/order-details.php template in WooCommerce is used primarily on the “Order Received” page, which is also known as the “Thank You” page that customers see after placing an order. This page provides customers with a summary of their order details, including items purchased, their quantities, prices, and total cost, as well as any customer notes or special instructions.
Additionally, this template may appear in other contexts where detailed order information needs to be displayed, such as in customer account sections under order history, where customers can view past orders and see detailed item listings for each order.
This setup helps enhance the shopping experience by keeping customers informed about what they’ve purchased and providing a clear record of transaction details. It’s an essential part of the post-purchase customer experience in WooCommerce-enabled shops.
Relations
| Item | Type |
|---|
Pointing items
| Item | Type | Category | Tags |
|---|
| Categorie | File, Template, Woo |
| Tags | 9.6.0, bedankt-pagina, myaccount, orders, thank-you, woo-9.7.1, woocommerce-template |
| URL | https://woocommerce.github.io/code-reference/files/woocommerce-templates-order-order-details.html |
| Type | File |
| Time | |
| Price |