Hydrogen ShopPayButton Component

Hi Shopify Team! When using Shop Pay on a Liquid-based theme I can attach hidden form fields to send extra attributes when the Shop Pay button is clicked. These attributes can then be consumed by a cart transform function to ensure the Shop Pay behavior mimics a regular ATC button click.

When using the ShopPayButton component on a Hydrogen storefront, I can only pass in variant IDs and quantities and cannot add any extra attributes.

Is there a workaround for this?
Thank you!

The hydrogen shop pay button uses this web component under the hood. Which does not support updating attributes. Instead, you could create your own custom method on the cart that does exactly what you want. Something like update attributes and forward to checkout.

1 Like