diff options
Diffstat (limited to 'views/mods')
| -rw-r--r-- | views/mods/mod_productvariants/admin_edit.phtml | 11 | ||||
| -rw-r--r-- | views/mods/mod_productvariants/produkt_addedit_content.phtml | 2 | ||||
| -rw-r--r-- | views/mods/mod_productview/productview.js | 78 | ||||
| -rw-r--r-- | views/mods/mod_productview/productview.phtml | 21 | ||||
| -rw-r--r-- | views/mods/mod_productview/productview_filter.phtml | 135 | ||||
| -rw-r--r-- | views/mods/mod_productview/settings_edit.phtml | 3 | ||||
| -rw-r--r-- | views/mods/mod_produktattribute/produkt_addedit_content.phtml | 67 |
7 files changed, 251 insertions, 66 deletions
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml index ef11894..d491b74 100644 --- a/views/mods/mod_productvariants/admin_edit.phtml +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -15,12 +15,13 @@ <thead>
<tr>
- <?php $colspan = 1; if (wpsg_isSizedInt($this->view['product_id'])) { $colspan ++; ?>
+ <?php $colspan = 2; if (wpsg_isSizedInt($this->view['product_id'])) { $colspan ++; ?>
<th class="col_active"></th>
<?php } ?>
<th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
<th class="col1"><?php echo __('Name', 'wpsg'); ?></th>
+ <th class="col_shortname"><?php echo __('Kurzname'); ?></th>
<?php if (wpsg_isSizedInt($this->view['product_id'])) { $colspan += 3; ?>
<th class="col_artnr"><?php echo __('Artikelnummer', 'wpsg'); ?></th>
@@ -52,6 +53,13 @@ field: 'vari_name',
field_id: '<?php echo $vari['id']; ?>'
}
+ });
+
+ jQuery('#productvariation_shortname_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+ submitdata: {
+ field: 'vari_shortname',
+ field_id: '<?php echo $vari['id']; ?>'
+ }
});
<?php } else { ?>
@@ -100,6 +108,7 @@ /* ]]> */</script>
</td>
<td class="col1"><span class="wpsg_editable" id="productvariation_name_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['name']); ?></span></td>
+ <td class="col_shortname"><span class="wpsg_editable" id="productvariation_shortname_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['shortname']); ?></span></td>
<?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
<td class="col_artnr"><span class="wpsg_editable" id="productvariation_anr_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['anr']); ?></span></td>
diff --git a/views/mods/mod_productvariants/produkt_addedit_content.phtml b/views/mods/mod_productvariants/produkt_addedit_content.phtml index 21b3e43..aa8012a 100644 --- a/views/mods/mod_productvariants/produkt_addedit_content.phtml +++ b/views/mods/mod_productvariants/produkt_addedit_content.phtml @@ -24,7 +24,7 @@ <?php } else { ?>
- <?php echo __('Bitte speichern Sie das Produkt zuerst.', 'wpsg'); ?>
+ <p><?php echo __('Bitte speichern Sie das Produkt zuerst.', 'wpsg'); ?></p>
<?php } ?>
diff --git a/views/mods/mod_productview/productview.js b/views/mods/mod_productview/productview.js index d80dc83..7a30c02 100644 --- a/views/mods/mod_productview/productview.js +++ b/views/mods/mod_productview/productview.js @@ -5,8 +5,9 @@ var atts = jQuery.parseJSON(jQuery('#wpsg_productview_' + index + ' input[name="wpsg_atts"]').val());
atts.page = page;
- atts.order = order;
- atts.mode = mode;
+
+ if (typeof order !== "undefined") atts.order = order;
+ if (typeof mode !== "undefined") atts.mode = mode;
if (jQuery('#wpsg_mod_productview_filter').length > 0)
{
@@ -42,14 +43,61 @@ var max_height = 0; jQuery('#wpsg_productview_' + index + ' .wpsg_mod_productview_name').each(function() { if (jQuery(this).outerHeight() > max_height) max_height = jQuery(this).outerHeight(); } ).outerHeight(max_height);
var max_height = 0; jQuery('#wpsg_productview_' + index + ' .wpsg_mod_productview_description').each(function() { if (jQuery(this).outerHeight() > max_height) max_height = jQuery(this).outerHeight(); } ).outerHeight(max_height);
+ // Sortierungslayer
+ jQuery('.wpsg_mod_productview-order').bind('click', function(event) {
+
+ if (jQuery(this).find('.wpsg_mod_productview-order-layer').is(':visible'))
+ {
+
+ jQuery(this).find('.wpsg_mod_productview-order-layer').slideUp();
+
+ }
+ else
+ {
+
+ jQuery(this).find('.wpsg_mod_productview-order-layer').slideDown();
+
+ }
+
+ event.stopPropagation();
+
+ } ).disableSelection();
+
+ // Sortierung
+ jQuery('.wpsg_mod_productview-order-layer a').bind('click', function() {
+
+ var productview_index = jQuery(this).attr("data-productview-index");
+ var order = jQuery(this).attr("data-order");
+
+ wpsg_switchProductview(productview_index, 1, order);
+
+ return false;
+
+ } ).disableSelection();
+
+ }
+
+ function wpsg_filter_insert(values, set)
+ {
+
+ var arValues = [];
+
+ if (jQuery.trim(values) != '') arValues = jQuery.trim(values).split(',');
+
+ if (jQuery.inArray(set, arValues) >= 0) arValues = jQuery.grep(arValues, function(value) { return value != set; } );
+ else arValues.push(set);
+
+ return jQuery.unique(arValues).join(',');
+
}
jQuery(document).ready(function() {
+ // Preisfilter
var filter_min = parseFloat(jQuery('#wpsg_mod_productview_filter_price_info input[name="price_min"]').val());
var filter_max = parseFloat(jQuery('#wpsg_mod_productview_filter_price_info input[name="price_max"]').val());
-
- jQuery("#wpsg_mod_productview_filter_price-range").slider( {
+
+ jQuery("#wpsg_mod_productview_filter_price-range").slider( {
range: true,
min: filter_min,
max: filter_max,
@@ -69,7 +117,21 @@ }
} );
-
+
+ // Variantenfilter Small
+ jQuery('.wpsg_mod_productview_filter_item a.switch').bind('click', function() {
+
+ var input = jQuery(this).parents('.wpsg_mod_productview_filter_item').find('input.val');
+ input.val(wpsg_filter_insert(input.val(), jQuery(this).attr('data-value')));
+
+ jQuery(this).toggleClass('active');
+
+ wpsg_switchProductview(1, 1);
+
+ return false;
+
+ } );
+
jQuery('.wpsg_productview').each(function() {
var x = jQuery(this).attr("id").substr(17);
@@ -77,5 +139,11 @@ } );
+ jQuery('body, html').bind('click', function() {
+
+ jQuery('.wpsg_mod_productview-order-layer:visible').each(function() { jQuery(this).parent().click(); } );
+
+ } );
+
} );
\ No newline at end of file diff --git a/views/mods/mod_productview/productview.phtml b/views/mods/mod_productview/productview.phtml index e643db7..c98b4b3 100644 --- a/views/mods/mod_productview/productview.phtml +++ b/views/mods/mod_productview/productview.phtml @@ -18,17 +18,30 @@ <?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
<div class="wpsg_mod_productview-order <?php echo $this->view['wpsg_mod_productview']['col_class']['order']; ?>">
- <?php echo __('Sortierung', 'wpsg'); ?><span class="glyphicon glyphicon-menu-down"></span>
- <strong>Neueste zuerst</strong>
+ <?php echo __('Sortierung', 'wpsg'); $order = $this->view['wpsg_mod_productview']['order']; ?>
+ <?php if (substr($order, -3) === 'asc') { ?>
+ <span class="glyphicon glyphicon-menu-up"></span>
+ <?php } else { ?>
+ <span class="glyphicon glyphicon-menu-down"></span>
+ <?php } ?>
+
+ <strong><?php echo $this->view['wpsg_mod_productview']['arOrder'][$order]; ?></strong>
+ <div class="wpsg_mod_productview-order-layer">
+ <div class="inner">
+ <?php foreach ($this->view['wpsg_mod_productview']['arOrder'] as $value => $label) { ?>
+ <a href="#" class="<?php echo (($this->view['wpsg_mod_productview']['order'] === $value)?'selected':''); ?>" data-productview-index="<?php echo $this->view['wpsg_mod_productview']['index']; ?>" data-order="<?php echo $value; ?>"><?php echo $label; ?></a>
+ <?php } ?>
+ </div>
+ </div>
</div>
<div class="wpsg_mod_productview-info <?php echo $this->view['wpsg_mod_productview']['col_class']['info']; ?>">
<strong><?php
echo wpsg_translate(__('Anzeige #1# - #2#', 'wpsg'),
($this->view['wpsg_mod_productview']['page'] - 1) * $this->view['wpsg_mod_productview']['per_page'] + 1,
- ((sizeof($this->view['wpsg_mod_productview']['products']) > $this->view['wpsg_mod_productview']['per_page'])?$this->view['wpsg_mod_productview']['page'] * $this->view['wpsg_mod_productview']['per_page']:sizeof($this->view['wpsg_mod_productview']['products']))
+ $this->view['wpsg_mod_productview']['pageMax']
); ?></strong>
- <?php echo wpsg_translate(__('von #1# Ergebnissen', 'wpsg'), sizeof($this->view['wpsg_mod_productview']['products'])); ?>
+ <?php echo wpsg_translate(__('von #1# Ergebnissen', 'wpsg'), $this->view['wpsg_mod_productview']['count']); ?>
</div>
<?php } ?>
diff --git a/views/mods/mod_productview/productview_filter.phtml b/views/mods/mod_productview/productview_filter.phtml index 7456bee..125cea0 100644 --- a/views/mods/mod_productview/productview_filter.phtml +++ b/views/mods/mod_productview/productview_filter.phtml @@ -1,20 +1,123 @@ <div class="wpsg_mod_productview_filter" id="wpsg_mod_productview_filter">
- <?php if ($this->hasMod('wpsg_mod_produktartikel') && wpsg_isSizedArray($this->view['arCat'])) { ?>
- <div class="wpsg_mod_productview_filter_item wpsg_mod_productview_filter_cat">
- <ul>
- <?php foreach ($this->view['arCat'] as $cat_id => $cat_name) { ?>
- <li><a href="<?php echo get_term_link($cat_id); ?>" title="<?php echo wpsg_hspc($cat_name); ?>"><?php echo wpsg_hspc($cat_name); ?></a></li>
+
+ <?php foreach ($this->view['showFilter'] as $filter_data) { ?>
+
+ <?php if ($filter_data['type'] === 'catfilter') { /* Kategoriefilter */ ?>
+
+ <div class="wpsg_mod_productview_filter_item wpsg_mod_productview_filter_cat">
+ <h2><?php echo __('Produktkategorie', 'wpsg'); ?></h2>
+ <?php
+
+ function wpsg_renderCat(&$shop, $ar, $level = 1)
+ {
+
+ if (wpsg_isSizedArray($ar))
+ {
+
+ echo '<ul class="level'.$level.'">';
+
+ foreach ($ar as $k => $cat)
+ {
+
+ echo '<li>';
+ echo '<a href="'.get_term_link($cat->term_id).'" title="'.wpsg_hspc($cat->cat_name).'">'.wpsg_hspc($cat->cat_name).'</a>';
+
+ $arSubCat = $shop->callMod('wpsg_mod_produktartikel', 'getSubCategory', array($cat->term_id));
+ wpsg_renderCat($shop, $arSubCat, $level + 1);
+
+ echo '</li>';
+
+ }
+
+ echo '</ul>';
+
+ }
+
+ }
+
+ wpsg_renderCat($this, $filter_data['cat']);
+
+ ?>
+ </div>
+
+ <?php } else if ($filter_data['type'] === 'pricefilter') { ?>
+
+ <div class="wpsg_mod_productview_filter_item wpsg_mod_productview_filter_price">
+ <h2><?php echo __('Sortierung nach Preis', 'wpsg'); ?></h2>
+ <div id="wpsg_mod_productview_filter_price-range"><span class="ui-slider-bg"></span></div>
+ <div id="wpsg_mod_productview_filter_price_info">
+ <span class="min"><?php echo wpsg_ff($filter_data['min']); ?></span> <?php echo $this->get_option('wpsg_currency'); ?> - <span class="max"><?php echo wpsg_ff($filter_data['max']); ?></span> <?php echo $this->get_option('wpsg_currency'); ?>
+ <input type="hidden" name="price_min" value="<?php echo $filter_data['min']; ?>" />
+ <input type="hidden" name="price_max" value="<?php echo $filter_data['max']; ?>" />
+ </div>
+ </div>
+
+ <?php } else if ($filter_data['type'] === 'productvariants') { $variant = $filter_data['variant']; ?>
+
+ <?php if ($filter_data['displayMode'] === wpsg_mod_productview::DISPLAYMODE_FILTER_CHECKBOX) { ?>
+ <div class="wpsg_mod_productview_filter_item wpsg_mod_productview_filter_variant_checkbox wpsg_mod_productview_filter_variant wpsg_mod_productview_filter_variant_<?php echo $variant['type']; ?>">
+ <h2><?php echo $variant['name']; ?></h2>
+ <input class="val" type=hidden name="variants[<?php echo $variant['id']; ?>]" value="" />
+
+ <div class="variation_wrap">
+ <?php foreach ($filter_data['variation'] as $variation) { ?>
+ <a class="switch" href="#" data-value="<?php echo $variation['id']; ?>">
+
+ <span class="fa fa-square-o"></span>
+ <span class="fa fa-check-square-o"></span>
+
+ <?php if (wpsg_isSizedString($variation['shortname'])) { ?>
+ <?php echo wpsg_hspc($variation['shortname']); ?>
+ <?php } else { ?>
+ <?php echo wpsg_hspc($variation['name']); ?>
+ <?php } ?>
+
+ </a>
+ <?php } ?>
+ </div>
+ </div>
+ <?php } else if ($filter_data['displayMode'] === wpsg_mod_productview::DISPLAYMODE_FILTER_SMALL) { ?>
+ <div class="wpsg_mod_productview_filter_item wpsg_mod_productview_filter_variant_small wpsg_mod_productview_filter_variant wpsg_mod_productview_filter_variant_<?php echo $variant['type']; ?>">
+ <h2><?php echo $variant['name']; ?></h2>
+ <input class="val" type=hidden name="variants[<?php echo $variant['id']; ?>]" value="" />
+ <div class="variation_wrap">
+ <?php foreach ($filter_data['variation'] as $variation) { ?>
+ <a class="switch" href="#" data-value="<?php echo $variation['id']; ?>">
+
+ <?php if (wpsg_isSizedString($variation['shortname'])) { ?>
+
+ <?php if (preg_match('/^\#[0-9a-fA-F]+$/', $variation['shortname'])) { ?>
+ <span class="color" style="background-color:<?php echo $variation['shortname']; ?>;"><span class="fa-check-square-o fa"></span></span>
+ <?php } else { ?>
+ <?php echo wpsg_hspc($variation['shortname']); ?>
+ <?php } ?>
+
+ <?php } else { echo wpsg_hspc($variation['name']); } ?>
+ </a>
+ <?php } ?>
+ <div class="wpsg_clear"></div>
+ </div>
+ </div>
<?php } ?>
- </ul>
- </div>
+
+ <?php } else if ($filter_data['type'] === 'productattributs') { $attribut = $filter_data['attribute']; ?>
+ <div class="wpsg_mod_productview_filter_item wpsg_mod_productview_filter_attribut wpsg_mod_productview_filter_attribut_select">
+ <h2><?php echo wpsg_hspc($attribut['name']); ?></h2>
+ <input class="val" type=hidden name="attributs[<?php echo $attribut['id']; ?>]" value="" />
+ <div class="attribut_wrap">
+ <?php foreach ($attribut['auswahl'] as $index => $auswahl) { ?>
+ <a class="switch" href="#" data-value="<?php echo wpsg_hspc($index); ?>">
+
+ <span class="fa fa-square-o"></span>
+ <span class="fa fa-check-square-o"></span>
+ <?php echo wpsg_hspc($auswahl); ?>
+
+ </a>
+ <?php } ?>
+ </div>
+ </div>
+ <?php } ?>
+
<?php } ?>
- <div class="wpsg_mod_productview_filter_item wpsg_mod_productview_filter_price">
- <h2><?php echo __('Sortierung nach Preis', 'wpsg'); ?></h2>
- <div id="wpsg_mod_productview_filter_price-range"><span class="ui-slider-bg"></span></div>
- </div>
- <div id="wpsg_mod_productview_filter_price_info">
- <?php echo __('Preis:', 'wpsg'); ?><span class="min"><?php echo wpsg_ff($this->get_option('wpsg_mod_productview_filter_min')); ?></span> <?php echo $this->get_option('wpsg_currency'); ?> - <span class="max"><?php echo wpsg_ff($this->get_option('wpsg_mod_productview_filter_max')); ?></span> <?php echo $this->get_option('wpsg_currency'); ?>
- <input type="hidden" name="price_min" value="<?php echo $this->get_option('wpsg_mod_productview_filter_min'); ?>" />
- <input type="hidden" name="price_max" value="<?php echo $this->get_option('wpsg_mod_productview_filter_max'); ?>" />
- </div>
+
</div>
\ No newline at end of file diff --git a/views/mods/mod_productview/settings_edit.phtml b/views/mods/mod_productview/settings_edit.phtml index bfb101d..69e9a00 100644 --- a/views/mods/mod_productview/settings_edit.phtml +++ b/views/mods/mod_productview/settings_edit.phtml @@ -5,5 +5,4 @@ */
?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_productview_filter_min', __('Minimaler Preis für Preisfilter', 'wpsg'), $this->get_option('wpsg_mod_productview_filter_min')); ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_productview_filter_max', __('Maximaler Preis für Preisfilter', 'wpsg'), $this->get_option('wpsg_mod_productview_filter_max')); ?>
\ No newline at end of file +
\ No newline at end of file diff --git a/views/mods/mod_produktattribute/produkt_addedit_content.phtml b/views/mods/mod_produktattribute/produkt_addedit_content.phtml index e79458a..8b88859 100644 --- a/views/mods/mod_produktattribute/produkt_addedit_content.phtml +++ b/views/mods/mod_produktattribute/produkt_addedit_content.phtml @@ -4,42 +4,35 @@ * Template für die Eingabe der Produktattribute innerhalb der Produktverwaltung
*/
-?>
-<?php if (sizeof($this->view['data']['pa']) > 0) { ?>
-<div class="postbox" id="wpsg_produktattribute">
- <h3 class="wpsg_handlediv">
- <span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
- <span><?php echo __('Produktattribute', 'wpsg'); ?></span>
- </h3>
- <div class="inside">
-
- <?php foreach ($this->view['data']['pa'] as $pa) { ?>
- <div class="wpsg_form_field">
- <div class="wpsg_form_left">
- <label class="wpsg_produkt_pa_label" for="produkt_pa_<?php echo $pa['id']; ?>"><?php echo __($pa['name'], 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right">
- <?php if ($pa['typ'] == '1') { /* RTE */ ?>
-
- <?php wp_editor($pa['value'], 'pa_'.$pa['id'].''); ?>
-
- <?php } else if ($pa['typ'] == '2') { /* Auswahl */ ?>
- <select id="produkt_pa_<?php echo $pa['id']; ?>" name="pa_<?php echo $pa['id']; ?>">
- <?php foreach ((array)explode("|", $pa['auswahl']) as $option) { ?>
- <option <?php echo (($pa['value'] == $option)?'selected="selected"':''); ?> value="<?php echo wpsg_hspc($option); ?>"><?php echo wpsg_hspc($option); ?></option>
- <?php } ?>
- </select>
- <?php } else if ($pa['typ'] == '3') { /* Checkbox */ ?>
- <input type="hidden" value="0" name="pa_<?php echo $pa['id']; ?>" />
- <input id="produkt_pa_<?php echo $pa['id']; ?>" class="checkbox" type="checkbox" value="1" name="pa_<?php echo $pa['id']; ?>" <?php echo (($pa['value'] == '1')?'checked="checked"':''); ?> />
- <?php } else { /* Normales Eingabefeld */ ?>
- <input id="produkt_pa_<?php echo $pa['id']; ?>" type="text" name="pa_<?php echo $pa['id']; ?>" value="<?php echo wpsg_hspc($pa['value']); ?>" />
- <?php } ?>
- </div>
- </div>
- <div class="wpsg_clear"></div>
+?>
+
+<?php echo wpsg_drawForm_AdminboxStart(__('Produktattribute', 'wpsg')); ?>
+
+ <?php if (wpsg_isSizedArray($this->view['data']['pa'])) { ?>
+
+ <?php foreach ($this->view['data']['pa'] as $pa) { ?>
+
+ <?php if ($pa['typ'] == '1') { /* RTE */ ?>
+ <div class="form-horizontal"><div class="form-group-sm">
+ <label class="control-label" for="pa_5" style="padding-bottom:5px;"><?php echo wpsg_hspc($pa['name']); ?></label><br />
+ <?php wp_editor($pa['value'], 'pa_'.$pa['id'].''); ?><br />
+ </div></div>
+ <?php } else if ($pa['typ'] == '2') { /* Auswahl */ ?>
+ <?php echo wpsg_drawForm_Select('pa_'.$pa['id'], $pa['name'], (array)explode('|', $pa['auswahl']), $pa['value']);?>
+ <?php } else if ($pa['typ'] == '3') { /* Checkbox */ ?>
+ <?php echo wpsg_drawForm_Checkbox('pa_'.$pa['id'], $pa['name'], $pa['value']); ?>
+ <?php } else { /* Normales Eingabefeld */ ?>
+ <?php echo wpsg_drawForm_Input('pa_'.$pa['id'], $pa['name'], $pa['value']); ?>
+ <?php } ?>
+
<?php } ?>
+
+ <?php } else { ?>
+ <p><?php echo __('Bisher wurden keine Attribute im System angelegt.', 'wpsg'); ?></p>
+ <?php } ?>
+
+ <br />
- </div>
-</div>
-<?php } ?>
\ No newline at end of file + <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktattribute"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Produktattribute', 'wpsg'); ?></a>
+
+<?php echo wpsg_drawForm_AdminboxEnd(); ?>
\ No newline at end of file |
