Closed trphelan closed 3 years ago
I am also having the same problem. I am commenting to hopefully bump this up for @RIAEvangelist and @madelinecameron to see haha.
Ive tried this with a few different items with my code looking like
var pizzaItem = new pizzapi.Item(
{
code: 'PXC_14SCREEN',
options: {},
quantity: 2
}
);
var sodaItem = new pizzapi.Item(
{
code: '2LCOKE',
options: {},
quantity:1
}
);
var order = new pizzapi.Order(
{
customer: customer,
storeID: myStore.ID,
deliveryMethod: this.serviceType
}
);
order.addItem(pizzaItem);
order.addItem(sodaItem);
order.addCoupon("9003");
and my result is
"Products": [
{
"AutoRemove": false,
"Code": "PXC_14SCREEN",
"Qty": 2,
"ID": 1,
"isNew": true,
"StatusItems": [
{
"Code": "InvalidOptionPartRemoved"
},
{
"Code": "Removed"
}
],
"Status": -1,
"CategoryCode": ""
},
{
"AutoRemove": false,
"Code": "2LCOKE",
"Qty": 1,
"ID": 2,
"isNew": true,
"StatusItems": [
{
"Code": "InvalidOptionPartRemoved"
}
],
"Status": 1,
"CategoryCode": "Drinks"
}
],
Apologies if this is not allowed.
Interesting, I am just catching back up on all of this now. I ran the tests which seem to show everything passing, but I'll have a look.
@RIAEvangelist any update on this?
Yeah, the options format may have changed. I have a new branch I'm working in where I am exploring this. Not sure if this affects ordering or not. Ideally, I'll be able to order superfluous pizzas again sometime soon to help with the debug process.
Also, I'm committing my exploratory code in that branch. It's all ES6 modules, you are welcome to help too. The more people helping, the better.
its the v3.x branch btw
Also, I'm committing my exploratory code in that branch. It's all ES6 modules, you are welcome to help too. The more people helping, the better.
its the v3.x branch btw
Sweet! I will check it out, Id also love to order me some pizza through unnecessary means :p
I'll be getting to the v3.x order process tomorrow. I have completed most everything else.
OK, So as I have been rewriting, I can confirm, you guys were forcing empty objects
or arrays to the options
of the Item.
You cant get a cheese pizza without cheese etc.
Your options were in fact wrong. For basic things, you can just omit the options and allow it to have cheese and sauce. For some items, you will need to update the options according to the product's menu info.
Please log out the product you would like and check its options.
Just to confirm the options format has not changed.
More specifically the library automatically adds sauce and cheese. So you may need to remove those options.
Following the example for validating on order like this:
The result is (snipped):
It looks like the acceptable options format has changed. Any idea what it is now? Or pointers to some documentation so I can figure it out?
Thanks.