Personalization on PDPs
Some products are eligible for optional personalization (custom embroidery). When a customer opts for personalization, a modal opens allowing them to select embroidery format and text.

Eligibility and Data Representationโ
Products eligible for personalization have the following attributes:
enablePersonalizationmetafield set to"true"- Product Variants configured for the personalized and non-personalized states
- Product Option named
Personalization - Product Option Values named
Not PersonalizedandPersonalized
- Product Option named
- To display the free personalization badge, the product must have the
badge:free personalizationtag
In addition to these eligibility conditions, personalized items are always marked as Final Sale when added to cart. This is denoted by the is_final_sale line item attribute.
Saving personalization inputsโ
Upon submission of the personalization modal, two things happen:
- If the user opted for personalization, the
PersonalizationProduct Option is updated toPersonalized. Otherwise if the user removed personalization from their product, the Product Option is updated to the standardNot Personalizedoption. - Personalization inputs are saved in React state in the PDP Context Provider as Shopify Attributes. Upon adding the personalized item to the cart, these attributes are added as cart line item attributes.
Components Involvedโ
PdpProvideris the main context provider for the PDP. Personalization attributes are stored as state here.ProductInfoPillBadgesrenders applicable personalization badges when eligibility is met.
MultiProductOptionsdetermines if the Personalization Add On product option should be rendered based on the eligibility conditionsProductOptionsis the generic container for rendering any product option. The personalization Product Options are passed here.ProductOptionis the generic component that renders a single product option. This component contains aswitchstatement for rendering theAddOncomponent to trigger the Personalization Modal.AddOnis a basic component used to format the Add On product option.PersonalizationModalButtonis used to trigger the Personalization Modal. It has a side effect to update thePersonalizationProduct Option when personalization data changes.PersonalizationModalcontains the form that allows the customer to select embroidery format and text. Upon submission, personalization inputs are saved in React state in the PDP Context Provider as Shopify Attributes.
AddToCartretrieves personalization state from the PDP context and adds the personalization attributes as cart line item attributes.