summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2016-03-05 18:57:24 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2016-03-05 18:57:24 +0000
commit4e047665e3b18689fcfd9ae65da07db0cefaef9c (patch)
tree7ef19a45b643cc5a9e173e0aae3b736a3e6e429c /views/mods
parent703a450908599b3ebc8018f41f54e510bb0dc255 (diff)
- Im Shop aber schon
- Produktansichtenmodul funktioniert grundlegend über Shortcode (Ohne Sortierung / Listansicht) - Tuning Produktverwaltung und ne Menge Warnungen raus git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5385 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_productgroups/produkt_index_filter.phtml36
-rw-r--r--views/mods/mod_productview/productview.js29
-rw-r--r--views/mods/mod_productview/productview.phtml106
-rw-r--r--views/mods/mod_produktbilder/dummy.pngbin0 -> 6668 bytes
4 files changed, 136 insertions, 35 deletions
diff --git a/views/mods/mod_productgroups/produkt_index_filter.phtml b/views/mods/mod_productgroups/produkt_index_filter.phtml
index c99fe29..4804860 100644
--- a/views/mods/mod_productgroups/produkt_index_filter.phtml
+++ b/views/mods/mod_productgroups/produkt_index_filter.phtml
@@ -6,40 +6,6 @@
?>
-<script type="text/javascript">
-
- function wpsg_goGroup(group_id)
- {
-
- jQuery('#wpsg_seite').val('1');
- jQuery('#wpsg_search_pgruppe').val(group_id);
- jQuery('#filter_form').submit();
-
- return false;
-
- }
-
-</script>
-
-<input type="hidden" id="wpsg_search_pgruppe" name="search[pgruppe]" value="<?php echo $_REQUEST['search']['pgruppe']; ?>" />
-
<?php if (is_array($this->view['productgroups']) && sizeof($this->view['productgroups']) > 0) { ?>
-<ul class="subsubsub wpsg_order_index_status">
- <?php foreach ($this->view['productgroups'] as $pg) { ?>
- <li>
- <?php if (isset($_REQUEST['search']['pgruppe']) && $_REQUEST['search']['pgruppe'] == $pg['id']) { ?>
- <span class="akt"><?php echo wpsg_hspc($pg['name']); ?></span> <span class="count">(<?php echo $pg['countProdukte']; ?>) | </span>
- <?php } else { ?>
- <a onclick="return wpsg_goGroup(<?php echo $pg['id']; ?>);" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&search[pgruppe]=<?php echo $pg['id']; ?>"><?php echo wpsg_hspc($pg['name']); ?> <span class="count">(<?php echo $pg['countProdukte']; ?>)</span></a> |
- <?php } ?>
- </li>
- <?php } ?>
- <li>
- <?php if (isset($_REQUEST['search']['pgruppe']) && $_REQUEST['search']['pgruppe'] > 0) { ?>
- <a onclick="return wpsg_goGroup(0);" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt"><?php echo __('Alle', 'wpsg'); ?> <span class="count">(<?php echo $this->view['countProducts']; ?>)</span></a>
- <?php } else { ?>
- <span class="akt"><?php echo __('Alle', 'wpsg'); ?></span> <span class="count">(<?php echo $this->view['countProducts']; ?>)</span>
- <?php } ?>
- </li>
-</ul>
+<?php echo wpsg_drawForm_Select('productgroup', __('Produktgruppe', 'wpsg'), $this->view['arSelect'], wpsg_getStr($_REQUEST['productgroup'])); ?>
<?php } ?> \ No newline at end of file
diff --git a/views/mods/mod_productview/productview.js b/views/mods/mod_productview/productview.js
new file mode 100644
index 0000000..a696aba
--- /dev/null
+++ b/views/mods/mod_productview/productview.js
@@ -0,0 +1,29 @@
+
+ function wpsg_switchProductview(index, page, order, mode)
+ {
+
+ var atts = jQuery('#wpsg_productview_' + index + ' input[name="atts"]').val();
+
+ jQuery('#wpsg_productview_' + index).append('<div class="wpsg_mod_productview_loading"></div>');
+
+ jQuery.ajax( {
+ 'url': wpsg_ajax.ajaxurl,
+ 'data': {
+ 'wpsg_mod': 'wpsg_mod_productview',
+ 'wpsg_action': 'refresh',
+ 'atts': atts,
+ 'page': page,
+ 'order': order,
+ 'mode': mode
+ },
+ 'success': function(data) {
+
+ jQuery('#wpsg_productview_' + index).replaceWith(data);
+
+ }
+ } );
+
+ return false;
+
+ }
+ \ No newline at end of file
diff --git a/views/mods/mod_productview/productview.phtml b/views/mods/mod_productview/productview.phtml
new file mode 100644
index 0000000..2175f48
--- /dev/null
+++ b/views/mods/mod_productview/productview.phtml
@@ -0,0 +1,106 @@
+<?php
+
+ /**
+ * Template für die Anzeige der Produkte
+ * Es sollte nur Inhalt unter dem Div der Klasse wpsg_productview geändert werden, da dieses mittels AJAX ausgetauscht wird
+ */
+
+?>
+<div class="wpsg_productview" id="wpsg_productview_<?php echo $this->view['wpsg_mod_productview']['index']; ?>">
+
+ <div class="wpsg_productview_head row">
+
+ <h2 class="wpsg_productview_title col-lg-3"><?php echo wpsg_hspc($this->view['wpsg_mod_productview']['title']); ?></h2>
+
+ <?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
+ <div class="col-lg-3 wpsg_mod_productview-order">
+ asd
+ </div>
+
+ <div class="col-lg-6 wpsg_mod_productview-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, $this->view['wpsg_mod_productview']['page'] * $this->view['wpsg_mod_productview']['per_page']); ?></strong>
+ <?php echo wpsg_translate(__('von #1# Ergebnissen', 'wpsg'), $this->view['wpsg_mod_productview']['count']); ?>
+ </div>
+ <?php } ?>
+
+ </div>
+
+ <div class="wpsg_productview_content row">
+
+ <?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
+
+ <?php $i = 0; foreach ($this->view['wpsg_mod_productview']['products'] as $oProduct) { $i ++; ?>
+ <a title="<?php echo wpsg_translate(__('Zum Produkt "#1#"', 'wpsg'), $oProduct->getProductName()); ?>" href="<?php echo $oProduct->getProductURL(); ?>" class="wpsg_productview_product wpsg_productview_product_<?php echo $oProduct->id; ?> col-lg-3">
+
+ <?php if ($this->hasMod('wpsg_mod_produktbilder')) { ?>
+ <?php $image_url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage', array($oProduct->id, 520, 520, 'sz')); ?>
+ <?php if (wpsg_isSizedString($image_url)) { ?>
+ <div class="wpsg_mod_productview_image">
+ <img src="<?php echo $image_url; ?>" alt="" />
+ </div>
+ <?php } } ?>
+
+ <div class="wpsg_mod_productview_bottom">
+
+ <div class="wpsg_mod_productview_name">
+ <h2><?php echo $oProduct->getProductName(); ?></h2>
+ </div>
+
+ <div class="wpsg_mod_productview_price_wrap">
+
+ <?php $oldPrice = $oProduct->getOldPrice(); ?>
+ <?php if ($oldPrice !== false) { ?>
+ <div class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></div>
+ <?php } ?>
+
+ <?php if ($oProduct->getMinPrice() != $oProduct->getPrice()) { ?>
+ <div class="<?php echo (($oldPrice !== false)?'wpsg_mod_productview_pricehiglight':''); ?> wpsg_mod_productview_price wpsg_mod_productview_minprice"><?php echo wpsg_translate(__('Ab #1#', 'wpsg'), wpsg_ff($oProduct->getMinPrice(), $this->get_option('wpsg_currency'))); ?></div>
+ <?php } else { ?>
+ <div class="<?php echo (($oldPrice !== false)?'wpsg_mod_productview_pricehiglight':''); ?> wpsg_mod_productview_price"><?php echo wpsg_ff($oProduct->getPrice(), $this->get_option('wpsg_currency')); ?></div>
+ <?php } ?>
+
+ </div>
+
+ </div>
+
+ <input type="hidden" name="atts" value="<?php echo @wpsg_hspc(serialize($this->view['wpsg_mod_productview']['atts'])); ?>" />
+
+ <div class="wpsg_mod_productview_go"><span class="glyphicon glyphicon-eye-open"></span></div>
+
+ </a>
+
+ <?php if ($i % 4 === 0) { ?>
+ <div class="clearfix visible-lg-block"></div>
+ <?php } ?>
+
+ <?php } ?>
+
+ <?php } else { ?>
+ <?php echo __('Keine Produkte in dieser Ansicht.', 'wpsg'); ?>
+ <?php } ?>
+
+ <div class="clearfix"></div>
+
+ <?php if (wpsg_isSizedInt($this->view['wpsg_mod_productview']['pages']) && $this->view['wpsg_mod_productview']['pages'] > 1) { ?>
+ <div class="wpsg_productview_pager">
+ <div class="wpsg_productview_pager_wrap">
+ <?php if ($this->view['wpsg_mod_productview']['page'] > 1) { ?>
+ <a href="#" title="<?php echo wpsg_translate(__('Eine Seite zurück und die vorherigen #1# Produkte anzeigen', 'wpsg'), $this->view['wpsg_mod_productview']['per_page']); ?>" onclick="return wpsg_switchProductview(<?php echo $this->view['wpsg_mod_productview']['index']; ?>, <?php echo $this->view['wpsg_mod_productview']['page'] - 1; ?>);"><span class="glyphicon glyphicon-arrow-left"></span></a>
+ <?php } ?>
+ <?php for ($i = 1; $i <= $this->view['wpsg_mod_productview']['pages']; $i ++) { ?>
+ <?php if ($i == $this->view['wpsg_mod_productview']['page']) { ?>
+ <span><?php echo $i; ?></span>
+ <?php } else { ?>
+ <a onclick="return wpsg_switchProductview(<?php echo $this->view['wpsg_mod_productview']['index']; ?>, <?php echo $i; ?>); " href="#"><?php echo $i; ?></a>
+ <?php } ?>
+ <?php } ?>
+ <?php if ($this->view['wpsg_mod_productview']['page'] < $this->view['wpsg_mod_productview']['pages']) { ?>
+ <a href="#" title="<?php echo wpsg_translate(__('Eine Seite vor und die nächsten #1# Produkte anzeigen', 'wpsg'), $this->view['wpsg_mod_productview']['per_page']); ?>" onclick="return wpsg_switchProductview(<?php echo $this->view['wpsg_mod_productview']['index']; ?>, <?php echo $this->view['wpsg_mod_productview']['page'] + 1; ?>); "><span class="glyphicon glyphicon-arrow-right"></span></a>
+ <?php } ?>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+
+</div> \ No newline at end of file
diff --git a/views/mods/mod_produktbilder/dummy.png b/views/mods/mod_produktbilder/dummy.png
new file mode 100644
index 0000000..bf19969
--- /dev/null
+++ b/views/mods/mod_produktbilder/dummy.png
Binary files differ