Thank you for the reply. The above code also behaves same way. The purpose of this is to have a discount requirement in case of a pickup by customer.
I think the main issue is, it is taking from cache and because of that if the customer opted a pickup while ordering and did not complete the order, the next time customer goes to cart it gives pickup as the selected option from beginning of the order which is misleading when I use that info to calculate some discount.
Is there a way to know if in the final check out stage or customer has selected shipping option like ship or pickup?
The promotion I have added with the new pickup discount requirement rule is on the sub total.
Any help on this is very much appreciated.