feat(submit): pay_limit, require_login, coupon fields on front submit

Expose VIP purchase gate, login-required purchase, and coupon toggle/desc
in the pay sidebar; persist through FrontSubmitPay into DomainModel meta.
This commit is contained in:
kate522 committed 2026-07-18 23:54:03 +08:00
1 parent 3176e06597
commit 72c0d10172
2 files changed
+36

No files matched your search

+28
View File
@@ -85,6 +85,34 @@ $downloads = is_array($pay['downloads'] ?? null) ? $pay['downloads'] : [];
<?php endif; ?>
</div>
<div class="aksrt-submit-pay__row">
<span><?php esc_html_e('购买限制', 'aksrt'); ?></span>
<select name="aksrt_pay[pay_limit]" class="form-control">
<?php $pl = (int) ($pay['pay_limit'] ?? 0); ?>
<option value="0" <?php selected($pl, 0); ?>><?php esc_html_e('所有人可购', 'aksrt'); ?></option>
<option value="1" <?php selected($pl, 1); ?>><?php esc_html_e('仅 VIP1 及以上', 'aksrt'); ?></option>
<option value="2" <?php selected($pl, 2); ?>><?php esc_html_e('仅 VIP2', 'aksrt'); ?></option>
</select>
</div>
<div class="aksrt-submit-pay__row">
<span><?php esc_html_e('登录后可购', 'aksrt'); ?></span>
<label class="aksrt-switch">
<input type="checkbox" name="aksrt_pay[require_login]" value="1" <?php checked(!empty($pay['require_login'])); ?>>
<span class="aksrt-switch__ui"></span>
</label>
</div>
<div class="aksrt-submit-pay__row">
<span><?php esc_html_e('允许优惠码', 'aksrt'); ?></span>
<label class="aksrt-switch">
<input type="checkbox" name="aksrt_pay[coupon_s]" value="1" <?php checked(!empty($pay['coupon_s'])); ?>>
<span class="aksrt-switch__ui"></span>
</label>
</div>
<label class="aksrt-submit-field">
<span><?php esc_html_e('优惠说明', 'aksrt'); ?></span>
<input type="text" class="aksrt-form-input" name="aksrt_pay[coupon_desc]" value="<?php echo esc_attr((string) ($pay['coupon_desc'] ?? '')); ?>" placeholder="<?php esc_attr_e('收银台展示的优惠提示', 'aksrt'); ?>">
</label>
<?php if (!empty($ctx['can_pay_download'])) : ?>
<div class="aksrt-submit-pay-downloads" data-pay-downloads>
<div class="aksrt-submit-pay__row">