Personalized checkout and custom promotions with Shopify Scripts
Is the "company" attribute accessible from Input.cart.shipping_address? Input.cart.shipping_address.company returns a no method error. This seems like something that should be accessible from the Shipping Address object, especially since it so closely resembles its Liquid counterpart which provides access to it.
My use case is to show specific business shipping options when shipping to a business, which is inferred by the entry of a company name. Any insight into accessing the company field would be helpful, otherwise consider this post a feature request 🙂
I'm looking for the same feature here: https://community.shopify.com/c/Technical-Q-A/Access-quot-Company-quot-field-or-a-custom-field-in-Sh...
Did you find anything yet?
Otherwise, if it's usable to you; you can activate Address Line 2, change it's labels to something company related and then access this field in Shopify scripts. Then you could toggle the shipping methods based on the input of this field.
I received a response from Shopify support saying they do not support accessing the company field from Shopify Scripts. I had to implement a front-end solution for my feature by initiating a change handler on "input#shipping_company_value", binding it on the "page:load" and "page:change" document events.
Clever solution with the Address 2 field 🙂
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024