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 🙂
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025