summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorthomas <noreply@maennchen1.de>2019-05-22 11:03:08 +0000
committerthomas <noreply@maennchen1.de>2019-05-22 11:03:08 +0000
commit474ee7351d2527be3f848fa99ff16758c404e061 (patch)
treef364a19808187e7341266b6eac34ccc07ca7944e /views
parentc2af82a7945bcf0986a83ac35f04448655eb06ba (diff)
- Sanitize-Funktion im Rabattmodul
- optionaler rabattierte Preisanzeige in der Produktübersicht - Bugfix: Rabattdarstellung - Originalpreis als "alter Preis" git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7435 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views')
-rw-r--r--views/css/frontend.css4
-rw-r--r--views/mods/mod_discount/settings_edit.phtml4
-rw-r--r--views/mods/mod_productindex/layouts/grid.phtml18
-rw-r--r--views/mods/mod_productindex/layouts/list.phtml26
4 files changed, 44 insertions, 8 deletions
diff --git a/views/css/frontend.css b/views/css/frontend.css
index 66b5d7f..7922bb2 100644
--- a/views/css/frontend.css
+++ b/views/css/frontend.css
@@ -443,6 +443,10 @@ input.wpsg_error { border-color:red !important; }
.wpsg_mod_productview-order-layer a.selected,
.wpsg_mod_productview-order-layer a:hover { text-decoration:none; color:#FFFFFF; background-color:#29556E; }
+/* Produktübersicht */
+.wpsg_mod_productview_oldprice { font-size:0.9em; color:#ff0000; text-decoration:line-through; }
+.wpsg_mod_productview_newprice { font-size:1em; font-weight:bold; }
+
/* Dialog für Meldungen wenn nicht auf einer Shop Seite / Warenkorbmeldung BEGIN */
#wpsg_ajax_layer { position:fixed; z-index:1000; left:0px; top:0px; width:100%; height:100%; background-color:rgba(0, 0, 0, 0.75); display:flex; justify-content:center; align-items:center; }
#wpsg_ajax_layer .wpsg_ajax_message_content { background-color:#FFFFFF; padding:1.5rem; text-align:center; }
diff --git a/views/mods/mod_discount/settings_edit.phtml b/views/mods/mod_discount/settings_edit.phtml
index dbb67e5..33e6d02 100644
--- a/views/mods/mod_discount/settings_edit.phtml
+++ b/views/mods/mod_discount/settings_edit.phtml
@@ -88,6 +88,10 @@
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_discount_showBasket', __('Nächste Staffelung im Warenkorb anpreisen', 'wpsg'), $this->get_option('wpsg_mod_discount_showBasket'), array('help' => 'wpsg_mod_discount_showBasket')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_discount_voucher', __('Gutscheine bei aktivem Rabatt nicht zulassen', 'wpsg'), $this->get_option('wpsg_mod_discount_voucher'), array('help' => 'wpsg_mod_discount_voucher')); ?>
+ <?php if ($this->hasMod('wpsg_mod_productindex') == '1') { ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_discount_productindex', __('Rabattierte Preise in Produktindex anzeigen', 'wpsg'), $this->get_option('wpsg_mod_discount_productindex')); ?>
+ <?php } ?>
+
</div>
</div>
</div>
diff --git a/views/mods/mod_productindex/layouts/grid.phtml b/views/mods/mod_productindex/layouts/grid.phtml
index 30b675d..0b8c8d1 100644
--- a/views/mods/mod_productindex/layouts/grid.phtml
+++ b/views/mods/mod_productindex/layouts/grid.phtml
@@ -81,7 +81,7 @@
<?php if (wpsg_isSizedArray($this->view['arProducts'])) { ?>
- <?php $i = 0; foreach ($this->view['arProducts'] as $p) { $i ++; ?>
+ <?php $i = 0; foreach ($this->view['arProducts'] as $p); $oProduct = wpsg_product::getInstance($p['product_key']); { $i ++; ?>
<?php if (($i - 1) % $col == 0) { ?><div class="wpsg_mod_productindex_productrow"><?php } ?>
@@ -135,6 +135,18 @@
<?php /*Abfrage Preisanzeige nur für eingeloggte Benutzer START*/?>
<?php if (($this->callMod('wpsg_mod_kundenverwaltung', 'isLoggedIn') && ($this->get_option('wpsg_mod_kundenverwaltung_preisAnzeige') == '1')) || ($this->get_option('wpsg_mod_kundenverwaltung_preisAnzeige') == '0')) { ?>
+ <?php if ($this->hasMod('wpsg_mod_discount') && $this->get_option('wpsg_mod_discount_productindex') == '1') { ?>
+
+ <?php $oldPrice = $oProduct->getOldPrice(); ?>
+
+ <?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice($this->view['data']['product_key'])) { ?>
+ <span class="wpsg_mod_productview_newprice wpsg_mod_productview_price wpsg_mod_productview_current"><?php echo wpsg_ff($oProduct->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span><br />
+ <span class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></span>
+ <?php } else { ?>
+ <span class="wpsg_mod_productview_price"><?php echo wpsg_ff($oProduct->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
+ <?php } ?>
+
+ <?php }else{?>
<div class="wpsg_mod_productindex_price">
<?php if ($p['min_preis'] == $p['max_preis']) { ?>
<?php echo wpsg_ff($p['preis'], $this->get_option('wpsg_currency')); ?>
@@ -142,6 +154,7 @@
<?php echo wpsg_translate(__('ab #1#', 'wpsg'), wpsg_ff($p['min_preis'], $this->get_option('wpsg_currency'))); ?>
<?php } ?>
</div>
+ <?php } ?>
<?php if ($this->get_option('wpsg_kleinunternehmer')) { /* Kleinunternehmerregelung aktiviert START */ ?>
<div class="wpsg_produkt_preishinweis">
<?php echo wpsg_translate(__('#2# zzgl. #1#', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>', '<a href="#kkhint" title="'.wpsg_hspc($this->get_option('wpsg_kleinunternehmer_text')).'">Endpreis</a>'); ?>
@@ -168,8 +181,7 @@
<a class="wpsg_button" title="<?php echo __('Zur Detailseite des Produkts', 'wpsg'); ?>" href="<?php echo wpsg_url($p['url']); ?>"><?php echo __('Zum Produkt', 'wpsg'); ?></a>
<?php } ?>
- </div>
-
+ </div>
</div>
<div class="wpsg_clear"></div>
</div>
diff --git a/views/mods/mod_productindex/layouts/list.phtml b/views/mods/mod_productindex/layouts/list.phtml
index 5351afa..1853edb 100644
--- a/views/mods/mod_productindex/layouts/list.phtml
+++ b/views/mods/mod_productindex/layouts/list.phtml
@@ -78,7 +78,7 @@
<?php if (wpsg_isSizedArray($this->view['arProducts'])) { ?>
- <?php $i = 0; foreach ($this->view['arProducts'] as $p) { $i ++; ?>
+ <?php $i = 0; foreach ($this->view['arProducts'] as $p); $oProduct = wpsg_product::getInstance($p['product_key']); { $i ++; ?>
<div class="wpsg_mod_productindex_product <?php echo (($i % 2 == 0)?'odd':'even'); ?> <?php echo (($i == sizeof($this->view['arProducts']))?'wpsg_mod_productindex_product_last':''); ?> <?php echo (($i == 1)?'wpsg_mod_productindex_product_first':''); ?>">
<a title="<?php echo __('Zur Detailseite des Produktes', 'wpsg'); ?>" href="<?php echo wpsg_url($p['url']); ?>">
@@ -130,10 +130,26 @@
<?php /* Abfrage Preisanzeige nur für eingeloggte Benutzer START */?>
<?php if (($this->callMod('wpsg_mod_kundenverwaltung', 'isLoggedIn') && ($this->get_option('wpsg_mod_kundenverwaltung_preisAnzeige') == '1')) || ($this->get_option('wpsg_mod_kundenverwaltung_preisAnzeige') == '0')) { ?>
<div class="wpsg_mod_productindex_price">
- <?php if ($p['min_preis'] == $p['max_preis']) { ?>
- <?php echo wpsg_ff($p['preis'], $this->get_option('wpsg_currency')); ?>
- <?php } else { ?>
- <?php echo wpsg_translate(__('ab #1#', 'wpsg'), wpsg_ff($p['min_preis'], $this->get_option('wpsg_currency'))); ?>
+
+ <?php /* Rabattierter Preis anzeigen */ ?>
+ <?php if ($this->hasMod('wpsg_mod_discount') && $this->get_option('wpsg_mod_discount_productindex') == '1') { ?>
+
+ <?php $oldPrice = $oProduct->getOldPrice(); ?>
+
+ <?php if ($oldPrice !== false && $oldPrice != $oProduct->getPrice($this->view['data']['product_key'])) { ?>
+ <span class="wpsg_mod_productview_newprice wpsg_mod_productview_price wpsg_mod_productview_current"><?php echo wpsg_ff($oProduct->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span><br />
+ <span class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></span>
+ <?php } else { ?>
+ <span class="wpsg_mod_productview_price"><?php echo wpsg_ff($oProduct->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
+ <?php } ?>
+
+ <?php }else{?>
+
+ <?php if ($p['min_preis'] == $p['max_preis']) { ?>
+ <?php echo wpsg_ff($p['preis'], $this->get_option('wpsg_currency')); ?>
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('ab #1#', 'wpsg'), wpsg_ff($p['min_preis'], $this->get_option('wpsg_currency'))); ?>
+ <?php } ?>
<?php } ?>
</div>
<?php if ($this->get_option('wpsg_kleinunternehmer')) { /* Kleinunternehmerregelung aktiviert START */ ?>