Our site sets a cookie when a visitors comes form a referral link. We would like to pass that data on as part of the order, but I could not see how to create a Hidden input with the value pre populated. Can this be done?
Hi @Duffer,
I think this would be a good use case for the cart metadata field.
It can be added to the cart using the cart update method in the JS SDK.
Cheers!
Ya for now I attached it simply to all of the items in my store using the data-attributes
data-item-custom2-name="referral"
data-item-custom2-type="hidden"
data-item-custom2-value="<? echo $_COOKIE["TagReferral"] ?>"
but that feels a little hacky as the referral should be attached to the customer not the items… but it works for me for now…