This approach helps resolve timing issues where: at the time the template code evaluates it can sometimes still be a basket and sometimes have been converted from a basket to an order.
By reading-from & writing-to both, we account for both scenarios and have more reliable custom fields.
Note: this assumes that g.order_instructions is always expected to be passed. If there are cases where it may not be passed from OPAY to INVC, then you may want to change the expression to l.settings:page:code CIN 'INVC' AND NOT ISNULL g.order_instructions
<mvt:if expr="l.settings:page:code CIN 'INVC'">
- Verifies that we're not viewing INVC from token listWrite_Basket()
incase the basket has not been converted to an orderWrite_Order()
incase the basket has been converted to an order
Read_Basket()
first incase basket has not been converted to an order- If our value is null, then we can try again on the order
Read_Order()
incase the basket has been converted to an order- Now
l.settings:order_instructions
should have the value if it was provided.