summaryrefslogtreecommitdiff
path: root/views/blocks
diff options
context:
space:
mode:
Diffstat (limited to 'views/blocks')
-rw-r--r--views/blocks/product-price.phtml47
1 files changed, 47 insertions, 0 deletions
diff --git a/views/blocks/product-price.phtml b/views/blocks/product-price.phtml
new file mode 100644
index 0000000..24b856c
--- /dev/null
+++ b/views/blocks/product-price.phtml
@@ -0,0 +1,47 @@
+<?php
+
+ /**
+ * Block „Produktpreis“: Preisangaben eines Produktartikels in einer Abfrage-Schleife (Kategorie-Vorlage)
+ *
+ * Wie eine Kachel der Produktliste ohne Bild und Titel; Bild und Titel kommen aus der Beitragsvorlage.
+ * @version 4.6.1
+ */
+
+ if (!defined('ABSPATH')) exit;
+
+ $arBlock = $this->view['wpsg_block'];
+ $oProduct = $arBlock['oProduct'];
+ $product_id = intval($oProduct->id);
+ $name = $oProduct->getProductName();
+ $hint_id = \wpsg\Blocks::kleinunternehmerHintID('price-'.$product_id);
+
+?>
+<?php if ($this->canDisplayPrice()) { $price = $oProduct->getPrice($product_id); ?>
+<div class="wpsg-product-list__price">
+ <?php if ($this->hasMod('wpsg_mod_productvariants') && $this->callMod('wpsg_mod_productvariants', 'isVariantsProduct', [$product_id])) { ?>
+ <?php echo wpsg_translate(esc_html__('ab #1#', 'wpsg'), wpsg_price_html($price, 'list')); ?>
+ <?php } else { ?>
+ <?php echo wpsg_price_html($price, 'list'); ?>
+ <?php } ?>
+</div>
+<?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?>
+<div class="wpsg-product-list__baseprice"><?php echo $this->callMod('wpsg_mod_fuellmenge', 'renderPriceInfo', [$price, $oProduct->__get('fmenge'), $product_id]); ?></div>
+<?php } ?>
+<div class="wpsg-product-list__taxnote wpsg_produkt_preishinweis"><?php echo \wpsg\Blocks::priceNote($oProduct, $hint_id); ?></div>
+<?php echo \wpsg\Blocks::kleinunternehmerHint($hint_id); ?>
+<?php } else { ?>
+<div class="wpsg-product-list__price"><?php echo esc_html__('Preise nur für eingeloggte Benutzer', 'wpsg'); ?></div>
+<?php } ?>
+
+<div class="wpsg-product-list__action">
+ <?php if ($arBlock['buy']) { ?>
+ <form method="post" action="<?php echo esc_url($this->getCurrentURL()); ?>">
+ <input type="hidden" name="wpsg[produkt_id]" value="<?php echo esc_attr((string)$product_id); ?>" />
+ <input type="hidden" name="wpsg[menge]" value="1" />
+ <input type="hidden" name="myReferer" value="<?php echo esc_attr($this->getCurrentURL()); ?>" />
+ <button type="submit" name="wpsg[submit]" value="1" class="wpsg_button wpsg_add_basket<?php echo wpsg_button_class(); ?>"><?php echo esc_html(wpsg_button_text('add_to_basket', __('In den Warenkorb', 'wpsg'))); ?><span class="screen-reader-text"><?php echo esc_html(': '.$name); ?></span></button>
+ </form>
+ <?php } else { ?>
+ <a class="wpsg_button<?php echo wpsg_button_class(); ?>" href="<?php echo esc_url($arBlock['url']); ?>"><?php echo esc_html(wpsg_button_text('to_product', __('Zum Produkt', 'wpsg'))); ?><span class="screen-reader-text"><?php echo esc_html(': '.$name); ?></span></a>
+ <?php } ?>
+</div>