I want to access the cart total from js. I have minicart-mixin.js in my custom module. I want to get the cart total there.
My file is minicart-mixin.js below.
define([
'uiComponent',
'Magento_Customer/js/customer-data',
'jquery',
'ko',
'underscore',
'sidebar',
'mage/translate',
'mage/dropdown'
], function (Component, customerData, $, ko, _) {
'use strict';
var mixin = {
isButtonEnable: function () {
/*You can add your condition here based on your requirements.*/
console.log(customerData.get('cart')._latestValue.subtotal);
}
};
return function (target) {
return target.extend(mixin);
};
});
Console i am getting like this
<span class="price">$70.00</span>
How can i get the $70 only.