Not sure if this is possible or not. We have wholesale customers who place orders and we store their company name in a customer custom field so that we can map them through to other workflows. We need to be able to force their Bill-To company name field to be the value of the custom field regardless of what the customer enters during checkout. Customers frequently change their Bill-To info and we lose the ability to force the mapping of their wholesale account to other platforms.
So far on the OPAY template I've tried to force overwrite the g.Basket:bill_comp value with our custom field, but when the order is submitted, the value they entered on the OCST customer information form gets stored on the order regardless. So my tests have not been successful and my hunch is that it's because the customer information gets written to the order after the OCST page and it's not updatable after that. I've thought about moving my code to the OCST template but I didn't want to bother if what I'm trying to do isn't possible anyway. Also, overwriting the Bill-To name that early in the checkout process leaves us open to the customer editing it again thinking they've made a mistake.
Here's what I've tried so far, and this does temporarily overwrite the Basket:bill_comp value but it gets lost on final order submission and reverted back to what they entered in the customer information form.
Any thoughts would be appreciated.
Hope all that makes sense. Thanks!
So far on the OPAY template I've tried to force overwrite the g.Basket:bill_comp value with our custom field, but when the order is submitted, the value they entered on the OCST customer information form gets stored on the order regardless. So my tests have not been successful and my hunch is that it's because the customer information gets written to the order after the OCST page and it's not updatable after that. I've thought about moving my code to the OCST template but I didn't want to bother if what I'm trying to do isn't possible anyway. Also, overwriting the Bill-To name that early in the checkout process leaves us open to the customer editing it again thinking they've made a mistake.
Here's what I've tried so far, and this does temporarily overwrite the Basket:bill_comp value but it gets lost on final order submission and reverted back to what they entered in the customer information form.
Any thoughts would be appreciated.
Code:
<mvt:item name="customfields" param="Read_Customer_ID(g.Basket:cust_id, 'my_custom_field', g.my_CFName)" /> <mvt:comment> temp store bill_comp value so we can show to the customer on final confirmation screen (basically hiding our override so they don't freak out) </mvt:comment> <mvt:assign name="g.bill_comp_temp" value="g.Basket:bill_comp" /> <mvt:comment> overwrite g.Basket:bill_comp with value from my_custom_field (assigned to my_CFName above) </mvt:comment> <mvt:assign name="g.Basket:bill_comp" value="g.my_CFName" /> <mvt:comment> also write the value to a Order/Basket custom field so it gets written to the order separately </mvt:comment> <mvt:item name="customfields" param="Write_Basket('QBCust', g.my_QBName)" />
Comment