How much is the tag your adding?
The second number is the order price which is 36 which is right…
Price tag is order price, as is order as it stands, it doesn’t care about portion, portion price for family is36 and that’s right for portion… 32 is coming from the parent tag your adding.
Pretty sure parent price is not from portions. It will always be from first portion since that is what sets your products base price if you only define single portion. This makes since as the term is parent price. I could be wrong.
Let me read and get caught up because your asking for a default feature to be changed to suit your specific need. We should evaluate all possible uses of the feature first. However I admit I have not read this entire conversation so let me get caught up it might make more sense to me then.
Sorry, I did not mean for Emre to change anything yet…
I was just trying to understand if [:ParentPrice] shoiulb be portion related like {PRICE} and [OrderTagPrice]
All, just wanted to say that i finally got around to implementing this and it works a treat. I set it up as a “Half and Half” item with 3 tag groups for small medium and large pizzas.
For some reason once i select the half, it doesn’t allow me to deselect it - while this is annoying, it’s not a show stopper as I can reset it by simply changing the portion size to something else and then back.
Also, i found the same problem that @gerlandog found - that a prefix didn’t work with the original config, but that’s less of an issue for us, we’ll simply not use a prefix - i actually changed all of the names to "Half " … which is probably not the easiest way but works…
OK, just to close this thread, and perhaps some kind sould will convert it into a tutorial, I will show how to revert the price to the original pizza when order is untagged.
function readPrice(product,portion)
{
var n = product.indexOf(".");
var corrected_product = product.substr(0,n);
//dlg.ShowMessage("prod:"+product+"\rcorrected:"+corrected_product);
var response = gql.Exec('{getProduct(name:"' + corrected_product + '"){portions{name,price}}}');
var result = JSON.parse(response);
if (portion=="G")
return result.data.getProduct.portions[0].price;
else
return result.data.getProduct.portions[1].price;
}