Pay on Delivery
Last updated
Was this helpful?
Was this helpful?
/src/views/checkout/steps/payment/options/pay-on-delivery/<PluginModule
component={Component.PayOnDelivery}
props={{
agreementCheckbox: (
<CheckoutAgreements control={null} error={null} fieldId="agreement" />
)
}}
/><PluginModule
component={Component.PayOnDelivery}
props={{
customUIRender: ({
handleSubmit,
onSubmit,
control,
errors,
setPayOnDeliveryChoice,
paymentChoices,
preOrder,
formError
}) => (
<form
onSubmit={handleSubmit(onSubmit)}
className="p-6 bg-white rounded-lg space-y-6"
>
<h2 className="text-xl font-semibold">PAY ON DELIVERY</h2>
<div className="space-y-4">
{paymentChoices.map((choice) => (
<label key={choice.value} className="flex items-center space-x-4">
<Radio
type="radio"
value={choice.value}
checked={choice.value === preOrder.payment_choice?.value}
onChange={() => setPayOnDeliveryChoice(choice.value)}
/>
<span>{choice.label}</span>
</label>
))}
</div>
{formError && <p className="text-xs text-error mt-2">{formError}</p>}
<Button type="submit" className="w-full bg-black text-white">
Place Order
</Button>
</form>
)
}}
/>