summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2016-06-18 14:01:39 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2016-06-18 14:01:39 +0000
commitef9544e477984efd73405c6847bd938a0a4ccfc8 (patch)
treec46390944c88b5f1221c2d64663f91de18d67bc4 /views/mods
parent3bce1a992a438e64ae24d18d25f600b097d2210e (diff)
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5558 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_productview/productview.js47
-rw-r--r--views/mods/mod_productview/productview.phtml77
2 files changed, 114 insertions, 10 deletions
diff --git a/views/mods/mod_productview/productview.js b/views/mods/mod_productview/productview.js
index 7a30c02..1f045c5 100644
--- a/views/mods/mod_productview/productview.js
+++ b/views/mods/mod_productview/productview.js
@@ -7,7 +7,19 @@
atts.page = page;
if (typeof order !== "undefined") atts.order = order;
- if (typeof mode !== "undefined") atts.mode = mode;
+ if (typeof mode !== "undefined") atts.mode = mode;
+ else
+ {
+
+ if (jQuery('#wpsg_productview_' + index + ' .wpsg_mod_productview_modeswitch > a').length > 0)
+ {
+
+ if (jQuery('#wpsg_productview_' + index + ' .wpsg_mod_productview_modeswitch > a.fa-th').hasClass('active')) atts.mode = 'grid';
+ else atts.mode = 'list';
+
+ }
+
+ }
if (jQuery('#wpsg_mod_productview_filter').length > 0)
{
@@ -40,8 +52,8 @@
function wpsg_correctProductview(index)
{
- 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);
+ var max_height = 0; jQuery('#wpsg_productview_' + index + ' .wpsg_productview_product_grid .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_productview_product_grid .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) {
@@ -74,7 +86,32 @@
return false;
} ).disableSelection();
-
+
+ // Umschalten der List/Grid Ansichten
+ jQuery('.wpsg_mod_productview_modeswitch > a').bind('click', function() {
+
+ if (jQuery(this).hasClass('fa-th') &&!jQuery(this).hasClass('active'))
+ {
+
+ jQuery('.wpsg_productview_product_list').hide(250);
+ jQuery('.wpsg_productview_product_grid').show(250);
+
+ }
+ else if (jQuery(this).hasClass('fa-list') && !jQuery(this).hasClass('active'))
+ {
+
+ jQuery('.wpsg_productview_product_grid').hide(250);
+ jQuery('.wpsg_productview_product_list').show(250);
+
+ }
+
+ jQuery('.wpsg_mod_productview_modeswitch a').removeClass('active');
+ jQuery(this).addClass('active');
+
+ return false;
+
+ } );
+
}
function wpsg_filter_insert(values, set)
@@ -144,6 +181,6 @@
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 c98b4b3..53c1799 100644
--- a/views/mods/mod_productview/productview.phtml
+++ b/views/mods/mod_productview/productview.phtml
@@ -44,7 +44,12 @@
<?php echo wpsg_translate(__('von #1# Ergebnissen', 'wpsg'), $this->view['wpsg_mod_productview']['count']); ?>
</div>
<?php } ?>
-
+
+ <div class="wpsg_mod_productview_modeswitch">
+ <a href="#" title="<?php echo __('Schaltet die Produktansicht auf die Grid Ansicht um.', 'wpsg'); ?>" class="fa fa-th <?php echo (($this->view['wpsg_mod_productview']['mode'] == 'grid')?'active':''); ?>"></a>
+ <a href="#" title="<?php echo __('Schaltet die Produktansicht auf die List Ansicht um.', 'wpsg'); ?>" class="fa fa-list <?php echo (($this->view['wpsg_mod_productview']['mode'] == 'list')?'active':''); ?>"></a>
+ </div>
+
</div>
<div class="wpsg_productview_content row">
@@ -52,7 +57,67 @@
<?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
<?php $i = 0; foreach ($this->view['wpsg_mod_productview']['products'] as $oProduct) { $i ++; ?>
- <div class="wpsg_productview_product wpsg_productview_product_<?php echo $oProduct->id; ?> <?php echo $this->view['wpsg_mod_productview']['col_class']['product']; ?>">
+
+ <div style="<?php echo (($this->view['wpsg_mod_productview']['mode'] == 'list')?'':'display:none;'); ?>" class="wpsg_productview_product wpsg_productview_product_list wpsg_productview_product_<?php echo $oProduct->id; ?> col-md-12">
+
+ <div class="row">
+
+ <?php $bImage = false; 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)) { $bImage = true; ?>
+ <div class="col-md-4 wpsg_mod_productview_image">
+
+ <img src="<?php echo $image_url; ?>" alt="" />
+
+ </div>
+ <?php } ?>
+ <?php } ?>
+
+ <div class="col-md-<?php echo (($bImage)?'8':'12'); ?>">
+
+ <div class="wpsg_mod_productview_name">
+ <h2><?php echo $oProduct->getProductName(); ?></h2>
+ </div>
+
+ <div class="wpsg_star_wrap">
+ <?php $star = rand(0, 5); ?>
+ <?php for ($i = 0; $i < 5; $i ++) { ?><i class="fa fa-star <?php echo (($i >= $star)?'fa-star-active':''); ?>"></i><?php } ?>
+ </div>
+
+ <div class="wpsg_mod_productview_price_wrap">
+ <?php $oldPrice = $oProduct->getOldPrice(); ?>
+ <?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice()) { ?>
+ <div class="wpsg_mod_productview_current"><?php echo wpsg_ff($oProduct->getPrice(), $this->get_option('wpsg_currency')); ?></div>
+ <div class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></div>
+ <?php } else { ?>
+ <div class="wpsg_mod_productview_price"><?php echo wpsg_ff($oProduct->getPrice(), $this->get_option('wpsg_currency')); ?></div>
+ <?php } ?>
+ </div>
+
+ <div class="wpsg_mod_productview_tax_wrap">
+ <?php if ($this->getFrontendTaxview() == WPSG_BRUTTO) { ?>
+ <?php echo wpsg_translate(__('inkl. #1#% MwSt. zzgl. <a href="#2">Versandkosten</a>', 'wpsg'), $oProduct->getFrontendTaxValue(), $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)); ?>
+ <?php } else if ($this->getFrontendTaxview() == WPSG_NETTO) { ?>
+ <?php echo wpsg_translate(__('zzgl. #1#% MwSt. zzgl. <a href="#2">Versandkosten</a>', 'wpsg'), $oProduct->getFrontendTaxValue(), $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)); ?>
+ <?php } ?>
+ </div>
+
+ <?php $shortDescription = $oProduct->getShortDescription(); if (wpsg_isSizedString($shortDescription)) { ?>
+ <div class="wpsg_mod_productview_description theme_color_1">
+ <strong><?php echo __('Produktbeschreibung', 'wpsg'); ?></strong><br />
+ <?php echo wp_trim_words(apply_filters('the_content', $shortDescription), 90); ?>
+ </div>
+ <?php } ?>
+
+ <a class="wpsg_mod_productview_button" href="<?php echo $oProduct->getProductURL(); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?><span class="fa fa-angle-double-right"></span></a>
+
+ </div>
+
+ </div>
+
+ </div>
+
+ <div style="<?php echo (($this->view['wpsg_mod_productview']['mode'] == 'grid')?'':'display:none;'); ?>" class="<?php echo (($this->view['wpsg_mod_productview']['mode'] == 'grid')?'':'hidden'); ?> wpsg_productview_product wpsg_productview_product_grid wpsg_productview_product_<?php echo $oProduct->id; ?> <?php echo $this->view['wpsg_mod_productview']['col_class']['product']; ?>">
<?php if ($this->hasMod('wpsg_mod_produktbilder')) { ?>
<?php $image_url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage', array($oProduct->id, 520, 520, 'sz')); ?>
@@ -62,10 +127,12 @@
<img src="<?php echo $image_url; ?>" alt="" />
<div class="wpsg_mod_productview_go">
+
<div class="wpsg_star_wrap">
- <?php $star = rand(0, 5); ?>
- <?php for ($i = 0; $i < 5; $i ++) { ?><i class="fa fa-star<?php echo (($i >= $star)?'-o':''); ?>"></i><?php } ?>
- </div>
+ <?php $star = rand(0, 5); ?>
+ <?php for ($i = 0; $i < 5; $i ++) { ?><i class="fa fa-star <?php echo (($i >= $star)?'fa-star-active':''); ?>"></i><?php } ?>
+ </div>
+
<div class="wpsg_center">
<div class="wpsg_mod_productview_price_wrap">