I'm currently leafing through Advanced Grammar in Use by Martin Hewings and on page 18 there is a unit (unit 9) describing the difference between "will" and "be going to". Among other rules, there is this pair of sentences:
I'm going to open a bottle of lemonade, if you want some. (= I'm going to open a bottle of lemonade. Do you want some?)
and
I'll open a bottle of lemonade if you want some. (= If you say you want some, I'll open it)
The difference between mentioned "will" and "be going to" is completely clear to me here, but suddenly there is a new puzzle: this "if" in the first sentence. What does this "if" mean here, if it doesn't make any condition on the opening the bottle part - considering that there is no condition in "Do you want some?"? Is this "if" is some short form of "(I wonder) if you want some"? But in this case shouldn't it be a separate interrogative sentence - "I'm going to open a bottle of lemonade. (I wonder) if you want some?". Or maybe there is a completely different explanation... I'm completely puzzled about this "if-not-being-if". And, btw, the use of commas in these two sentences in the book is not clear to me too: there is one in the first sentence but there is no in the second one.