update
This commit is contained in:
@@ -84,6 +84,7 @@ $orderStatusOptions = is_array($orderStatusOptions ?? null) ? $orderStatusOption
|
||||
<option value="integration"<?= ((string) ($cond['condition_type'] ?? '')) === 'integration' ? ' selected' : '' ?>>Integracja (kanal sprzedazy)</option>
|
||||
<option value="shipment_status"<?= ((string) ($cond['condition_type'] ?? '')) === 'shipment_status' ? ' selected' : '' ?>>Status przesylki</option>
|
||||
<option value="payment_status"<?= ((string) ($cond['condition_type'] ?? '')) === 'payment_status' ? ' selected' : '' ?>>Status platnosci</option>
|
||||
<option value="payment_method"<?= ((string) ($cond['condition_type'] ?? '')) === 'payment_method' ? ' selected' : '' ?>>Metoda platnosci</option>
|
||||
<option value="order_status"<?= ((string) ($cond['condition_type'] ?? '')) === 'order_status' ? ' selected' : '' ?>>Status zamowienia</option>
|
||||
<option value="days_in_status"<?= ((string) ($cond['condition_type'] ?? '')) === 'days_in_status' ? ' selected' : '' ?>>Liczba dni w statusie</option>
|
||||
</select>
|
||||
@@ -93,6 +94,7 @@ $orderStatusOptions = is_array($orderStatusOptions ?? null) ? $orderStatusOption
|
||||
$conditionType = (string) ($cond['condition_type'] ?? 'integration');
|
||||
$selectedIds = is_array($condValue['integration_ids'] ?? null) ? $condValue['integration_ids'] : [];
|
||||
$selectedStatusKeys = is_array($condValue['status_keys'] ?? null) ? $condValue['status_keys'] : [];
|
||||
$selectedMethodKeys = is_array($condValue['method_keys'] ?? null) ? $condValue['method_keys'] : [];
|
||||
$selectedOrderStatusCodes = is_array($condValue['order_status_codes'] ?? null) ? $condValue['order_status_codes'] : [];
|
||||
?>
|
||||
<?php if ($conditionType === 'shipment_status'): ?>
|
||||
@@ -114,6 +116,15 @@ $orderStatusOptions = is_array($orderStatusOptions ?? null) ? $orderStatusOption
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php elseif ($conditionType === 'payment_method'): ?>
|
||||
<div class="checkbox-group">
|
||||
<?php foreach ($paymentMethodOptions as $methodKey => $methodLabel): ?>
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" name="conditions[<?= $idx ?>][payment_method_keys][]" value="<?= $e((string) $methodKey) ?>"<?= in_array((string) $methodKey, $selectedMethodKeys, true) ? ' checked' : '' ?>>
|
||||
<?= $e($methodLabel) ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php elseif ($conditionType === 'order_status'): ?>
|
||||
<div class="checkbox-group">
|
||||
<?php foreach ($orderStatusOptions as $statusOption): ?>
|
||||
@@ -263,6 +274,7 @@ window.AutomationFormData = {
|
||||
receiptDuplicatePolicyLabels: <?= json_encode($receiptDuplicatePolicyLabels, JSON_UNESCAPED_UNICODE) ?>,
|
||||
shipmentStatusOptions: <?= json_encode($shipmentStatusOptions, JSON_UNESCAPED_UNICODE) ?>,
|
||||
paymentStatusOptions: <?= json_encode($paymentStatusOptions, JSON_UNESCAPED_UNICODE) ?>,
|
||||
paymentMethodOptions: <?= json_encode($paymentMethodOptions, JSON_UNESCAPED_UNICODE) ?>,
|
||||
orderStatusOptions: <?= json_encode(array_map(function($status) {
|
||||
return [
|
||||
'code' => (string) ($status['code'] ?? ''),
|
||||
|
||||
Reference in New Issue
Block a user