Woocommerce Change Checkout Total on Checkout Page

Solution:

Solved – Here’s how. Added a button and a dropdown allowing customers to add the shipping as a product to the cart, here’s the code.

add_filter( 'woocommerce_after_order_notes' , 'town_dropdown' );

function town_dropdown($checkout) {
    echo '<div id="town-drop">
    <h2>Delivery Charge</h2>
    <p>We deliver to the villages in the dropdown below. Please choose a village to have the correct price applied to your order. <strong>You must have the correct delivery price added, or your order will not be shipped!</strong></p>';
    echo '<script>
    function AddProductToCart() {
        product = document.getElementById("town_dropdown").value;
        productid = product.split("-");
        window.location = "http://site-url.com/checkout/?add-to-cart="+productid[0];
    }
    </script>';
    woocommerce_form_field( 'town_dropdown', array(
        'type'          => 'select',
        'class'         => array('form-row-wide'),
        'label'         => '',
        'options'     => array(
            '0' => 'Please select a delivery charge',
            '2458-lin' => 'Linton -  £3.50',
            '2468-abi' => 'Gt & Lt Abington - £5.00',
            '2470-bab' => 'Babraham - £6.00', 
            '2468-bal' => 'Balsham - £5.00', 
            '2468-bar' => 'Bartlow - £5.00', 
            '2471-bri' => 'Brinkley - £8.00', 
            '2471-bur' => 'Burrough Green - £8.00', 
            '2471-cam' => 'Cambridge - £8.00', 
            '2468-card' => 'Cardinals Green - £5.00', 
            '2471-carl' => 'Carlton - £8.00', 
            '2470-cas' => 'Castle Camps - £6.00', 
            '2471-che' => 'Cherry Hinton - £8.00',
            '2470-dux' => 'Duxford - £6.00', 
            '2471-ful' => 'Fulbourn - £8.00', 
            '2468-had' => 'Hadstock - £5.00', 
            '2471-hav' => 'Haverhill - £8.00', 
            '2471-hel' => 'Helions Bumpstead - £8.00', 
            '2471-hem' => 'Hempstead - £8.00', 
            '2468-hil' => 'Hildersham - £5.00', 
            '2471-hix' => 'Hinxton - £8.00', 
            '2468-hor' => 'Horseheath - £5.00', 
            '2471-ick' => 'Ickleton - £8.00', 
            '2471-ked' => 'Kedington - £8.00', 
            '2471-litb' => 'Littlebury - £8.00', 
            '2470-litw' => 'Little Walden - £6.00', 
            '2470-rad' => 'Radwinter - £6.00', 
            '2471-saf' => 'Saffron Walden - £8.00', 
            '2471-sam' => 'Gt &amp; Lt Sampford - £8.00', 
            '2470-saw' => 'Sawston - £6.00', 
            '2471-sew' => 'Sewards End - £8.00', 
            '2471-she' => 'Shelfords - £8.00', 
            '2471-ste' => 'Steeple Bumpstead - £8.00', 
            '2470-str' => 'Streetly End - £6.00', 
            '2471-thu' => 'Thurlow - £8.00', 
            '2470-wwi' => 'West Wickham - £6.00', 
            '2470-wwa' => 'West Wratting - £6.00', 
            '2470-wco' => 'Weston Colville - £6.00', 
            '2471-wgr' => 'Weston Green - £8.00', 
            '2471-whi' => 'Whittlesford - £8.00', 
            '2471-wil' => 'Gt &amp; Lt Wilbraham - £8.00', 
            '2470-wit' => 'Withersfield - £6.00', 
            '2471-wra' => 'Gt &amp; Lt Wratting - £8.00', 
            )
        ),$checkout->get_value('town_dropdown')
    );
    echo '<button type="button" OnClick="AddProductToCart()">Add Shipping</button>';
    echo '</div>';
}

On the button click, the Javascript redirects to a page that adds the product to the cart, by using the first part of the select value as the product id (The reason why this was necessary was that PHP arrays cannot have multiple elements with the same identifier). Hope this helps someone – comment with q’s if you have them.