My Account Order view page in WooCommerce
- Code goes in the function.php file of your active child theme (or active theme). Tested and works.
add_action( 'woocommerce_view_order', 'my_custom_tracking' );
function my_custom_tracking( $order_id ){
// Get an instance of the `WC_Order` Object
$order = wc_get_order( $order_id );
// Get the order number
$order_number = $order->get_order_number();
// Get the formatted order date created
$date_created = wc_format_datetime( $order->get_date_created() );
// Get the order status name
$status_name = wc_get_order_status_name( $order->get_status() );
// Display the order status
echo '<p>' . __("Order Status:") . ' ' . $status_name . '</p>';
}
If you want to change the yellow underline texts.
you will have to make changes to myaccount/view-order.php
template file.
First, read official documentation to understand “how to Override templates via a theme”.
Once done and once copied WooCommerce templates to your active theme as explained in the documentation, open the edit myaccount/view-order.php
template file.
The changes to make are located in lines from 26 to 34:
<p><?php
/* translators: 1: order number 2: order date 3: order status */
printf(
__( 'Order #%1$s was placed on %2$s and is currently %3$s.', 'woocommerce' ),
'<mark class="order-number">' . $order->get_order_number() . '</mark>',
'<mark class="order-date">' . wc_format_datetime( $order->get_date_created() ) . '</mark>',
'<mark class="order-status">' . wc_get_order_status_name( $order->get_status() ) . '</mark>'
);
?></p>
Some other services we provide include:-
- PPC (Pay Per Click Advertising)
- Social media marketing
- Content marketing
- SEO(Search Engine Optimization)
- Web design & development
- Online reputation management
- Voice search SEO
- Email/Mobile Marketing
- Youtube SEO Optimization
- Local SEO
- E-commerce SEO Services
- Graphic design for Social media
- ASO App Store Optimization
When You’re ready to jump in Feel Free to Contact Us or Call Us:- +918053760913