Pricing of Pizza Half and Half

found a small bug in this procedure…

Look at the first number, which is the [:ParentPrice]

but when yo select a different portion, like FAMILIA

The prices and parentprice is allways from the first portion… for sure I am doing something wrong… as allways, LOL!!!

Thanks@!!!

G.

Parent price is the tag price not the order price right…?
The normal first portion price is 30 not 32??

exactly, this works great for the first portion, but DOES NOT work for any other portions :frowning:

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.

No tag adding… just portions…

32 should be 36 wich is the price of the FAMILIA in the new pizza, and its showing 32 wich is the first portion

I am adding a half that its 32 and 36… grande and familia portions

G.

32 should be 38

I´ll try to print better flow of screens now…


I will add a pizza familia muzzarela (34) and then select half chocolate familia (38)


32 is the value of chocolate grande and it should be 38, familia…

G.

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.

Are you tagging after portion change or before?

It would be nice that all tags where related to the selected portion, or at least be able to get those prices…

just a thought

G.

have you seen this:

You could store that in a setting.

I have seen that… but why should I store values, I think that the product price should berelated to the portion… at least that feels natural…

G.

What if you don’t use portions for product price?

I have all my products in portions… that is the idea around portions… I don tlike the idea of having all my products twice

G

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.

1 Like

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]

G.

1 Like

Guys, finally this works… as usual @Emre did everything according the high standart he impossed and as usual I was doing something wrong…

I found out that the prices I was using in this screen:

where from thewrong portion…

so now that I found the problem, I can proudly say THIS WORKS!!!

Thanks to ALL!!!

G.

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…

Thanks again everyone!

small, medium and large pizzas ar portions?

I use S M and L as portions, and order tags are not working as expected… but I am sure that is becuase I set up something wrong…

G.

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.

First some more rules:


and

and then the magic:

Script:

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;
}

So… I belive this covers it…

hope this has been fun for you all!!!

KISSES and HUGS!!!

G.

2 Likes

Not fair 'dog you are using gql.Exec() - that is it man! I going to attack GraphQL and get my head around it :unamused:

1 Like

GraphQL is great… even thoe I cant use it as good as the Unforgiven (LOL)… but still, its great!!!

G.

1 Like

Gee’s I like your sense of humour! Makes me laugh :laughing:

1 Like