Shopify / Sparklayer customisation using Javascript SDK

Topic summary

Goal: add a per-product customer reference text field on the product page and pass it to the cart as a line‑item attribute in a Shopify B2B store using SparkLayer.

Initial constraint: SparkLayer replaces Shopify’s product form/cart, so standard Shopify line item properties or metafields won’t flow through. Early on, the SDK didn’t support product-level custom fields—only an order-level reference—so the advice was to wait for an upcoming feature or pursue complex custom development.

Update (most recent): SparkLayer has released support for custom attributes on specific line items via its JavaScript SDK, using a pre-cart-update hook. These attributes are shown under the product SKU in the cart and remain visible in past orders.

Implications: Implementation still requires developer-written custom code (potentially using SparkLayer’s SDK and/or Web Components) to render the field on the product page and pass the value on add-to-cart.

Outcome: The original requirement is now feasible with the new SDK capability. Documentation is linked in the thread, and the poster is asked to mark the updated answer as accepted. The discussion is effectively resolved, pending implementation.

Summarized with AI on December 25. AI used: gpt-5.

And does this reference text field need to be associated with the order? I’m thinking an order-based metafield might be the best option here, where some JS or a middleware is set up to pass the value from SparkLayer to Shopify.