1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

Using Javascript to extract out total sales figure from checkout page?

Discussion in 'HTML & JavaScript' started by affbull, Jan 27, 2020.

  1. affbull

    affbull Supreme Member

    Joined:
    Jan 16, 2016
    Messages:
    1,205
    Likes Received:
    203
    I have the following code on my checkout page. I was wondering how best to extract out the total sales amount of 12,670 as a number using Javascript?

    Code:
    <tr class="order-total">
      <th>Total</th>
      <td><strong><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>12,670.00</span></strong> </td>
    </tr>
    
    Thank you.