skip to Main Content

Trying to access "responseJSON.original_total_price"

This is my code –

  const CartObject = theme.cart.getCart();
  console.log(CartObject.responseJSON.original_total_price)

Console View

2

Answers


  1. Chosen as BEST ANSWER

    Making it an async function fixed it.

      const CartObject = await theme.cart.getCart();
      CartObject.total_price
    

  2. you need to use JSON.parse function on response e.g.

    const responseParsed = JSON.parse(responseJSON.responseText)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search