diff options
Diffstat (limited to 'views/mods/mod_campaigns/conditions_fields.phtml')
| -rw-r--r-- | views/mods/mod_campaigns/conditions_fields.phtml | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/views/mods/mod_campaigns/conditions_fields.phtml b/views/mods/mod_campaigns/conditions_fields.phtml new file mode 100644 index 0000000..25c8379 --- /dev/null +++ b/views/mods/mod_campaigns/conditions_fields.phtml @@ -0,0 +1,83 @@ +<?php + + /** + * Gemeinsame Auswahl-Felder für Kampagnen-/Template-Bedingungen. + * Erwartet $this->view['condition_options'] (id => label je Feld) und + * $this->view['condition_values'] (Feld => array('operator','value')). + * Wird von campaign_addedit.phtml und template_addedit.phtml eingebunden. + */ + + $opts = (isset($this->view['condition_options']) && is_array($this->view['condition_options'])) ? $this->view['condition_options'] : array(); + $vals = (isset($this->view['condition_values']) && is_array($this->view['condition_values'])) ? $this->view['condition_values'] : array(); + + $cond_val = function($field) use ($vals) { return isset($vals[$field]['value']) ? (string)$vals[$field]['value'] : ''; }; + $cond_op = function($field) use ($vals) { return isset($vals[$field]['operator']) ? (string)$vals[$field]['operator'] : '=='; }; + + $opt_status = (isset($opts['order_status']) && is_array($opts['order_status'])) ? $opts['order_status'] : array(); + $opt_payment = (isset($opts['order_payment_type']) && is_array($opts['order_payment_type'])) ? $opts['order_payment_type'] : array(); + $opt_subgroup = (isset($opts['subscriber_group']) && is_array($opts['subscriber_group'])) ? $opts['subscriber_group'] : array(); + $opt_pgroup = (isset($opts['product_group']) && is_array($opts['product_group'])) ? $opts['product_group'] : array(); + $opt_country = (isset($opts['customer_country']) && is_array($opts['customer_country'])) ? $opts['customer_country'] : array(); + +?> +<p><small><?php echo __('Optionale Bedingungen. Nur gesetzte Felder werden geprüft; es müssen alle gesetzten Bedingungen zutreffen, damit die Kampagne ausgelöst wird.', 'wpsg'); ?></small></p> + +<p> + <label for="cond_order_status"><strong><?php echo __('Bestellstatus', 'wpsg'); ?></strong></label><br /> + <select id="cond_order_status" name="cond[order_status]" class="widefat"> + <option value=""><?php echo __('— egal —', 'wpsg'); ?></option> + <?php foreach ($opt_status as $k => $label) { ?> + <option value="<?php echo esc_attr($k); ?>" <?php selected($cond_val('order_status'), (string)$k); ?>><?php echo esc_html($label); ?></option> + <?php } ?> + </select> +</p> + +<p> + <label for="cond_order_total"><strong><?php echo __('Bestellsumme (brutto)', 'wpsg'); ?></strong></label><br /> + <select name="cond[order_total_op]" style="width:70px;"> + <?php foreach (array('>=' => '≥', '<=' => '≤', '==' => '=') as $op => $sym) { ?> + <option value="<?php echo esc_attr($op); ?>" <?php selected($cond_op('order_total'), $op); ?>><?php echo $sym; ?></option> + <?php } ?> + </select> + <input type="number" step="0.01" min="0" id="cond_order_total" name="cond[order_total]" value="<?php echo esc_attr($cond_val('order_total')); ?>" style="width:130px;" placeholder="<?php echo esc_attr(__('z.B. 50', 'wpsg')); ?>" /> +</p> + +<p> + <label for="cond_order_payment_type"><strong><?php echo __('Zahlart', 'wpsg'); ?></strong></label><br /> + <select id="cond_order_payment_type" name="cond[order_payment_type]" class="widefat"> + <option value=""><?php echo __('— egal —', 'wpsg'); ?></option> + <?php foreach ($opt_payment as $k => $label) { ?> + <option value="<?php echo esc_attr($k); ?>" <?php selected($cond_val('order_payment_type'), (string)$k); ?>><?php echo esc_html($label); ?></option> + <?php } ?> + </select> +</p> + +<p> + <label for="cond_subscriber_group"><strong><?php echo __('Abonnentengruppe', 'wpsg'); ?></strong></label><br /> + <select id="cond_subscriber_group" name="cond[subscriber_group]" class="widefat"> + <option value=""><?php echo __('— egal —', 'wpsg'); ?></option> + <?php foreach ($opt_subgroup as $k => $label) { ?> + <option value="<?php echo esc_attr($k); ?>" <?php selected($cond_val('subscriber_group'), (string)$k); ?>><?php echo esc_html($label); ?></option> + <?php } ?> + </select> +</p> + +<p> + <label for="cond_product_group"><strong><?php echo __('Produktgruppe', 'wpsg'); ?></strong></label><br /> + <select id="cond_product_group" name="cond[product_group]" class="widefat"> + <option value=""><?php echo __('— egal —', 'wpsg'); ?></option> + <?php foreach ($opt_pgroup as $k => $label) { ?> + <option value="<?php echo esc_attr($k); ?>" <?php selected($cond_val('product_group'), (string)$k); ?>><?php echo esc_html($label); ?></option> + <?php } ?> + </select> +</p> + +<p> + <label for="cond_customer_country"><strong><?php echo __('Land des Kunden', 'wpsg'); ?></strong></label><br /> + <select id="cond_customer_country" name="cond[customer_country]" class="widefat"> + <option value=""><?php echo __('— egal —', 'wpsg'); ?></option> + <?php foreach ($opt_country as $k => $label) { ?> + <option value="<?php echo esc_attr($k); ?>" <?php selected($cond_val('customer_country'), (string)$k); ?>><?php echo esc_html($label); ?></option> + <?php } ?> + </select> +</p> |
