ver. 0.304: Configurable payment method order amount limits
Replace hardcoded PayPo condition (id=6, 40-1000 PLN) with generic min/max order amount columns on pp_shop_payment_methods. Admin form fields added, frontend basket checkout filters dynamically. Cache invalidation on save. 4 new tests (734 total, 2080 assertions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -182,6 +182,8 @@ class ShopPaymentMethodController
|
||||
'description' => (string)($paymentMethod['description'] ?? ''),
|
||||
'status' => (int)($paymentMethod['status'] ?? 0),
|
||||
'apilo_payment_type_id' => $paymentMethod['apilo_payment_type_id'] ?? '',
|
||||
'min_order_amount' => $paymentMethod['min_order_amount'] ?? '',
|
||||
'max_order_amount' => $paymentMethod['max_order_amount'] ?? '',
|
||||
];
|
||||
|
||||
$fields = [
|
||||
@@ -203,6 +205,16 @@ class ShopPaymentMethodController
|
||||
'tab' => 'settings',
|
||||
'rows' => 5,
|
||||
]),
|
||||
FormField::number('min_order_amount', [
|
||||
'label' => 'Min. kwota zamowienia (PLN)',
|
||||
'tab' => 'settings',
|
||||
'step' => 0.01,
|
||||
]),
|
||||
FormField::number('max_order_amount', [
|
||||
'label' => 'Maks. kwota zamowienia (PLN)',
|
||||
'tab' => 'settings',
|
||||
'step' => 0.01,
|
||||
]),
|
||||
FormField::select('apilo_payment_type_id', [
|
||||
'label' => 'Typ platnosci Apilo',
|
||||
'tab' => 'settings',
|
||||
|
||||
Reference in New Issue
Block a user