diff options
| author | hartmut <noreply@maennchen1.de> | 2017-09-07 09:38:55 +0000 |
|---|---|---|
| committer | hartmut <noreply@maennchen1.de> | 2017-09-07 09:38:55 +0000 |
| commit | 7c7d2e866c8bf883f52ac33c6fa65d54bc9fc5d6 (patch) | |
| tree | 50902ecaeedb838b8a9eff14f2f5c8fcf0100f19 /views/mods/mod_productview/productview.phtml | |
| parent | c85f1dca2bbc631e4f1af27a35b682cba6702d61 (diff) | |
Korrektur Produktbilder->ImageHandler
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6474 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_productview/productview.phtml')
| -rw-r--r-- | views/mods/mod_productview/productview.phtml | 211 |
1 files changed, 126 insertions, 85 deletions
diff --git a/views/mods/mod_productview/productview.phtml b/views/mods/mod_productview/productview.phtml index 4e2ac50..8b58ba7 100644 --- a/views/mods/mod_productview/productview.phtml +++ b/views/mods/mod_productview/productview.phtml @@ -4,9 +4,9 @@ * 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']; ?>">
+<span class="wpsg_productview" id="wpsg_productview_<?php echo $this->view['wpsg_mod_productview']['index']; ?>">
<input type="hidden" name="wpsg_atts" value="<?php echo @wpsg_hspc(json_encode($this->view['wpsg_mod_productview']['atts'])); ?>" />
@@ -17,6 +17,9 @@ <?php } ?>
<?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
+ <?php $oProduct = array_values($this->view['wpsg_mod_productview']['products'])[0]; ?>
+
+ <?php if (!wpsg_isSizedInt($this->view['wpsg_mod_productview']['atts']['hideorder'])) { ?>
<div class="wpsg_mod_productview-order <?php echo $this->view['wpsg_mod_productview']['col_class']['order']; ?>">
<?php echo __('Sortierung', 'wpsg'); $order = $this->view['wpsg_mod_productview']['order']; ?>
<?php if (substr($order, -3) === 'asc') { ?>
@@ -33,9 +36,10 @@ <?php } ?>
</div>
</div>
- </div>
+ </div>
+ <?php } ?>
- <div class="wpsg_mod_productview-info <?php echo $this->view['wpsg_mod_productview']['col_class']['info']; ?>">
+ <div class="wpsg_mod_productview-info <?php echo $this->view['wpsg_mod_productview']['col_class']['info']; ?> hidden-xs">
<strong><?php
echo wpsg_translate(__('Anzeige #1# - #2#', 'wpsg'),
($this->view['wpsg_mod_productview']['page'] - 1) * $this->view['wpsg_mod_productview']['per_page'] + 1,
@@ -45,14 +49,16 @@ </div>
<?php } ?>
- <div class="wpsg_mod_productview_modeswitch">
+ <?php if (!wpsg_isSizedInt($this->view['wpsg_mod_productview']['atts']['hideviewselect'])) { ?>
+ <div class="wpsg_mod_productview_modeswitch hidden-xs">
<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>
+ <?php } ?>
</div>
- <div class="wpsg_productview_content row">
+ <div class="wpsg_productview_content col-2-xs-row row">
<?php if (wpsg_isSizedArray($this->view['wpsg_mod_productview']['products'])) { ?>
@@ -61,19 +67,25 @@ <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="" />
-
+
+ <?php
+
+ $attachment_id = $this->imagehandler->getAttachmentID($oProduct->getProductKey());
+
+ ?>
+
+ <?php if (wpsg_isSizedInt($attachment_id)) { $bImage = true; ?>
+ <div class="col-md-4 col-sm-4">
+ <div class="wpsg_mod_productview_image" style="background-image:url('<?php echo $image_url; ?>');"></div>
+
+ <div class="box_img_wrap">
+ <?php echo wp_get_attachment_image($attachment_id, 'wpsg-productview-image'); ?>
+ </div>
+
</div>
<?php } ?>
- <?php } ?>
- <div class="col-md-<?php echo (($bImage)?'8':'12'); ?>">
+ <div class="col-md-<?php echo (($bImage)?'8':'12'); ?> col-sm-<?php echo (($bImage)?'8':'12'); ?>">
<div class="wpsg_mod_productview_name">
<h2><?php echo $oProduct->getProductName(); ?></h2>
@@ -85,48 +97,66 @@ </div>
<?php } ?>
- <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 if ($oProduct->canDisplayPrice()) { ?>
+ <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 } else { ?>
+ <p><?php echo __('Preise werden nur für angemeldete Benutzer angezeigt.', 'wpsg'); ?></p>
+ <?php } ?>
<?php $shortDescription = $oProduct->getShortDescription(); if (wpsg_isSizedString($shortDescription)) { ?>
- <div class="wpsg_mod_productview_description theme_color_1">
+ <div class="wpsg_mod_productview_description sto-productview-description">
<strong><?php echo __('Produktbeschreibung', 'wpsg'); ?></strong><br />
<?php echo $shortDescription; ?>
</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>
-
+
+ <?php if ($oProduct->canOrder()) { ?>
+ <a class="sto_button sto_button_layout2 sto_button_productview_addBasket" href="<?php echo $oProduct->getProductURL(); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?><span class="fa fa-angle-double-right"></span></a>
+ <?php } else { ?>
+ <a class="sto_button sto_button_soldout sto_button_layout2 sto_button_productview_addBasket" href="<?php echo $oProduct->getProductURL(); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?><span class="fa fa-angle-double-right"></span></a>
+ <?php } ?>
+
</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']; ?>">
+ <div onclick="<?php
+
+ echo 'location.href = \''.$oProduct->getProductURL().'\';';
+
+ ?>" style="<?php echo (($this->view['wpsg_mod_productview']['mode'] == 'grid')?'':'display:none;'); ?>" class="wpsg_productview_product wpsg_productview_product_grid wpsg_productview_product_<?php echo $oProduct->id; ?> <?php echo $this->view['wpsg_mod_productview']['col_class']['product']; ?> col-xs-6">
- <?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">
+ <?php
- <img src="<?php echo $image_url; ?>" alt="" />
-
+ $attachment_id = $this->imagehandler->getAttachmentID($oProduct->getProductKey());
+
+ ?>
+
+ <?php if (wpsg_isSizedInt($attachment_id)) { ?>
+ <div class="wpsg_mod_productview_image">
+
+ <div class="box_img_wrap">
+ <?php echo wp_get_attachment_image($attachment_id, 'wpsg-productview-image'); ?>
+ </div>
+
<div class="wpsg_mod_productview_go">
<?php if ($oProduct->rating > 0) { ?>
@@ -137,30 +167,38 @@ <div class="wpsg_center">
- <div class="wpsg_mod_productview_price_wrap">
- <?php $oldPrice = $oProduct->getOldPrice(); ?>
- <?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice()) { ?>
- <div class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></div>
- <div class="wpsg_mod_productview_current"><?php echo wpsg_ff($oProduct->getPrice(), $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 if ($oProduct->canDisplayPrice()) { ?>
+ <div class="wpsg_mod_productview_price_wrap">
+
+ <?php $oldPrice = $oProduct->getOldPrice(); ?>
+ <?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice()) { ?>
+ <div class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></div>
+ <div class="wpsg_mod_productview_current"><?php echo wpsg_ff($oProduct->getPrice(), $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 onclick="event.stopPropagation();" 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 onclick="event.stopPropagation(); href="#2#">Versandkosten</a>', 'wpsg'), $oProduct->getFrontendTaxValue(), $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)); ?>
+ <?php } ?>
+ </div>
+ <?php } else { ?>
+ <div class="wpsg_mod_productview_price_wrap">
+ <?php echo __('Preise werden nur für angemeldete Benutzer angezeigt.', 'wpsg'); ?>
+ </div>
+ <?php } ?>
</div>
</div>
</div>
- <?php } } ?>
+ <?php } ?>
<div class="wpsg_mod_productview_bottom">
@@ -172,7 +210,11 @@ <?php echo $oProduct->shortdesc; ?>
</div>
- <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>
+ <?php if ($oProduct->canOrder()) { ?>
+ <a class="sto_button sto_button_layout2 sto_button_productview_addBasket" href="<?php echo $oProduct->getProductURL(); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?><span class="fa fa-angle-double-right"></span></a>
+ <?php } else { ?>
+ <a class="sto_button sto_button_soldout sto_button_layout2 sto_button_productview_addBasket" href="<?php echo $oProduct->getProductURL(); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?><span class="fa fa-angle-double-right"></span></a>
+ <?php } ?>
</div>
@@ -190,26 +232,25 @@ <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 } ?>
-
+ <?php
+
+ echo \sto\frontend\Pager::render(array(
+ 'pages' => $this->view['wpsg_mod_productview']['pages'],
+ 'page' => $this->view['wpsg_mod_productview']['page'],
+ 'per_page' => $this->view['wpsg_mod_productview']['per_page'],
+ 'margin' => 2,
+ 'onclick' => array(
+ 'func' => 'wpsg_switchProductview',
+ 'args' => array(
+ $this->view['wpsg_mod_productview']['index'],
+ '#PAGE#'
+ )
+ )
+ ));
+
+ ?>
+
</div>
-
-</div>
\ No newline at end of file +
+</span>
+
|
