Good morning all,
Can someone help me in resolving below issue?
From a Json response i am capturing product weight and type like quantity or weight"
When i am adding that item to basket the request changes for each type of product.
So i need to write a if condition like
if(producttype = weight){
var requestBodyAddToBasket="{“items”:[{“id”:""+v_c_ProductId+"",“newValue”:"+v_newValue+",“oldValue”:"+v_oldValue+",“newUnitChoice”:“pcs”,“oldUnitChoice”:“pcs”,“catchWeight”:"+v_c_maxWeightValue+"}],“loggedInAction”:“update-trolley-item”}"
}else{
var requestBodyAddToBasket="{“items”:[{“id”:""+v_c_ProductId+"",“newValue”:"+v_newValue+",“oldValue”:"+v_oldValue+",“newUnitChoice”:“pcs”,“oldUnitChoice”:“pcs”}],“loggedInAction”:“update-trolley-item”}"
session.set(“requestBodyAddToBasket”,requestBodyAddToBasket)
}
I am getting below error…
type mismatch;
found : Unit
required: Boolean
if(v_c_displayType = Weight){
Can someone please help me in resolving this issue?
Thanks in advance…