admin: subscription controls + show original price

This commit is contained in:
web-ppanel
2026-01-27 17:57:46 +00:00
parent 0ec4f84fa9
commit 7223eb41c6
2 changed files with 103 additions and 0 deletions
@@ -77,6 +77,7 @@ const defaultValues = {
purchase_with_discount: false,
reset_cycle: 0,
renewal_reset: false,
show_original_price: false,
deduction_mode: "auto",
};
@@ -120,6 +121,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
allow_deduction: z.boolean().optional(),
reset_cycle: z.number().optional(),
renewal_reset: z.boolean().optional(),
show_original_price: z.boolean().optional(),
});
const form = useForm<z.infer<typeof formSchema>>({
@@ -837,6 +839,41 @@ export default function SubscribeForm<T extends Record<string, any>>({
</FormItem>
)}
/>
<FormField
control={form.control}
name="show_original_price"
render={({ field }) => (
<FormItem>
<div className="flex items-center justify-between">
<div className="space-y-0.5">
<FormLabel>
{t(
"form.showOriginalPrice",
"Show Original Price"
)}
</FormLabel>
<FormDescription>
{t(
"form.showOriginalPriceDescription",
"Display original price in the storefront"
)}
</FormDescription>
</div>
<FormControl>
<Switch
checked={!!field.value}
onCheckedChange={(value) =>
form.setValue(field.name, value)
}
/>
</FormControl>
</div>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="allow_deduction"