Reputation: 21
Trying to access "responseJSON.original_total_price"
This is my code -
const CartObject = theme.cart.getCart();
console.log(CartObject.responseJSON.original_total_price)
Upvotes: 0
Views: 58
Reputation: 21
Making it an async function fixed it.
const CartObject = await theme.cart.getCart();
CartObject.total_price
Upvotes: 2
Reputation: 2261
you need to use JSON.parse
function on response e.g.
const responseParsed = JSON.parse(responseJSON.responseText)
Upvotes: 0