TransWikia.com

Sorting Woocommerce Fees by name in Order confirmation and emails

WordPress Development Asked by Shaun Hearnden on October 11, 2020

Hi I would like to order the WooCommerce fees by name in both the order confirmation page and the emails that get sent out by WooCommerce.

I have used the below code for the cart/checkout page, but it does not transfer through to the other pages.

functions.php

function wc_get_sorted_fees(){
    $fees = WC()->cart->get_fees();
    ksort($fees);
    return $fees;
}

and in review-order.php

<?php foreach ( wc_get_sorted_fees() as $fee ) : ?>

Thank you for your help! 😀

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP