简体   繁体   中英

Virtuemart JavaScript span id (cart subtotal)

Is there a way that I can, in the cart, insert the cart subtotal into Google tracking code conversion value field?

How can I use jQuery to evaluate

<span id="tt_order_subtotal"><!--prints as £114.00 for example-->

from the virtuemart cart into a variable and thence to an integer.? I would be very grateful for just even a rough pointer?

var int_val = $('#tt_order_subtotal').text().match(/\d+/)[0];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM