Replies: 1 comment
-
|
Didn't know where to share this. This is only for documentation purpose and so closed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Product Options Persistence
This document explains how product options persistence works in our e-commerce application, including URL parameters and prefetching mechanisms.
Overview
Product options can be configured to persist their values in the URL and enable prefetching behavior. This is automatically handled based on whether an option is marked as a "variant option" in BigCommerce.
How It Works
1. Variant Options and Persistence
The
persistproperty for a product option is determined by BigCommerce'sisVariantOptionflag:When
persististruefor an option:2. URL Parameter Management
The
ProductDetailFormcomponent manages URL parameters for persistent options.This allows users to:
3. Prefetching Mechanism
When
persististrue, the form enables prefetching of option combinations.Benefits of prefetching:
Technical Implementation
The feature is implemented across several components:
Option Transformation
data-transformers/product-options-transformer.tspersistproperty based onisVariantOptionForm Component
vibes/soul/sections/product-detail/product-detail-form.tsxURL State Management
nuqsfor URL parameter managementBeta Was this translation helpful? Give feedback.
All reactions