Skip to content

Commit

Permalink
Updated Alan script
Browse files Browse the repository at this point in the history
  • Loading branch information
vrajdesai78 committed May 15, 2022
1 parent 8875ddc commit 594a81d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Alan Script/E-commerce-Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ intent(`(Add|I want|want) $(ITEM u:itemList) to favorite`, p=> {
})

intent(`(Add|I want|want) $(NUMBER) (kg|gram|grams|) $(ITEM u:itemList) (to cart|)`, p => {
var a = "";
var a = `${p.NUMBER.value}`;
if(p.ITEM.value == "ginger" || p.ITEM.value == "rice") {
if(p.NUMBER.value >= 250 && p.NUMBER.value%250 == 0) {
a = `${p.NUMBER.value} gram`;
Expand All @@ -43,11 +43,8 @@ intent(`(Add|I want|want) $(NUMBER) (kg|gram|grams|) $(ITEM u:itemList) (to cart
p.NUMBER.value *= 4;
}
}
else if(p.ITEM.value == "red apple_" || p.ITEM.value == "fresh banana_"){
if(p.ITEM.value == "red apple" || p.ITEM.value == "fresh banana"){
a = `${p.NUMBER.value} kg`;
}
else {
a = `${p.NUMBER.value}`;
}
p.play({command: "addItem", item: `${p.ITEM.value}`, count: `${p.NUMBER.value}`});
p.play(`Done. Added ${a} ${p.ITEM.value}`);
Expand Down

0 comments on commit 594a81d

Please sign in to comment.