How can I edit Order Details Table in Thank You page in Woocommerce?
I tried the edit order-details template but it didnt work. Where does it get the information from?
Thanks.
CodePudding user response:
The core template for Thank You page is located in templates/checkout/thankyou.php
(basic order meta data).
The order details table is however loaded as a different template, located in templates/order/order-details.php
. This template is loaded via pluggable function woocommerce_order_details_table()
, so you can either override this function (not recommended), or override the order-details
template (recommended).
DO NOT edit the WooCommerce core files (including templates) in the plugin's folders. Instead, override them in your theme/child-theme (learn how to override WooCommerce templates from the docs).
However, if you only need to add or modify some parts of the code inside this template, check if there are available hooks (actions and filters) inside, that would suit your use case. It is always better to use hooks if they are available, that way you can reduce the risk of template incompatibility in future WooCommerce releases.