My store actually has a scan guarantee, so if you buy an item at X and it scans as Y, they give you the item for free
If it's more than $5, they give you the difference plus $5 on top as the scan guarantee.
If you had two in the transaction, they probably gave your item 1 for free, refunded the difference on the second item and then added the $5 or whatever amount your store offers.
Not all Customer Service people know that, so sometimes they just give you the difference and I usually don't make waves when that happens.
However, when you get a knowledgable CS person and they do it right, that's what happens and I think it's pretty sweet!!
Now technically you could get the remaining boxes next time and if they have not fixed the mistake, you could get your refund again.
A friend of mine would do that systematically with stuff that rang up wrong, she would always get another one next time she went to the store
and cash in on the scan guarantee. Honestly, that would be too much hassle for me. But to each their own.