Basket Gift Package
The BasketGiftPack component provides a customizable UI for adding a gift package and optional gift note for individual basket items in the shopping cart. It supports fully custom rendering via customUIRender and customGiftNoteFormUIRender.
Installation Method
You can use the following command to install the extension with the latest plugins:
npx @akinon/projectzero@latest --pluginsProps
basketItem
object
Yes
Product information to be gift packaged
useModal
boolean
Optional
Determines if the gift form is shown in a modal.
modalClassName
string
Optional
Custom class for the modal container.
modalTitle
string
Optional
Title text for the modal.
modalContentClassName
string
Optional
Custom class for the modal's content area.
customUIRender
React.ReactNode
Optional
Function to customize the overall gift pack rendering
customGiftNoteFormUIRender
React.ReactNode
Optional
Function to customize the gift note form rendering.
CustomUIRender Parameters
hasGiftPack
boolean
Whether a gift pack is added.
hasNote
{ state: boolean, title: string }
Note state and label.
note
string
Current note text.
onAddGiftPack
() => void
Callback to add a gift pack.
onRemoveGiftPack
() => void
Callback to remove the gift pack.
onAddNote
() => void
Callback to show note entry UI.
onRemoveNote
() => void
Handler for removing the note
formContent
React.ReactNode
Rendered content of the gift note form.
translations
Record<string, string>
Translated texts for UI labels.
customGiftNoteFormUIRender Parameters
register
any
React Hook Form register method.
errors
any
Validation errors object.
note
string
Gift note text value.
textAreaCount
number
Current note character count.
onSubmit
(data: any) => void
Form submit handler.
removeNote
() => void
Callback to remove the note.
handleSubmit
any
React Hook Form submit handler.
Usage Example
Default Usage
Customizing Gift Pack
Customizing Gift Note Form
Last updated
Was this helpful?

