summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorRoger Rehnelt <noreply@maennchen1.de>2026-10-01 19:59:18 +0200
committerRoger Rehnelt <noreply@maennchen1.de>2026-10-01 19:59:18 +0200
commitbfe6c8d95b8b116c1f0c2e5511394a70cda69c17 (patch)
treedab027e4a9e03a9bc7a4fadc9ba3c67573cfbaf9 /views
parentfdef6be49c0eae438c56c16a9013a252e7ed5c07 (diff)
Seitenvorlagen fürs Block-Theme
In Block-Themes bringt der Shop Vorlagen für Produktartikel, Produktkategorien mit Seitenzahlen und die Produktdetailseite ohne Seitentitel; Vorlagen des Themes gehen vor. Neuer Block Produktpreis für die Abfrage-Schleife. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'views')
-rw-r--r--views/blocks/product-price.phtml47
-rw-r--r--views/css/frontend.css12
-rw-r--r--views/css/wpsg-theme.css10
3 files changed, 59 insertions, 10 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>
diff --git a/views/css/frontend.css b/views/css/frontend.css
index f824519..0128e0c 100644
--- a/views/css/frontend.css
+++ b/views/css/frontend.css
@@ -711,12 +711,14 @@ html body .wpsg_product_garan_wrap a.wpsg_product_garan img { display:block; max
.wpsg-block-product-list .wpsg-product-list__item { display:flex; flex-direction:column; gap:0.5em; min-width:0; margin:0; padding:0; }
.wpsg-block-product-list .wpsg-product-list__image img { display:block; width:100%; height:auto; }
.wpsg-block-product-list .wpsg-product-list__title { margin:0; font-size:1em; line-height:1.3; overflow-wrap:anywhere; hyphens:auto; }
-.wpsg-block-product-list .wpsg-product-list__price { font-size:1.2em; }
+.wpsg-block-product-list .wpsg-product-list__price, .wpsg-block-product-price .wpsg-product-list__price { font-size:1.2em; }
.wpsg-block-product-list .wpsg-product-list__taxnote,
-.wpsg-block-product-list .wpsg-product-list__baseprice { font-size:0.8em; }
-.wpsg-block-product-list .wpsg-product-list__action { margin-top:auto; padding-top:0.5em; }
-.wpsg-block-product-list .wpsg-product-list__action form { margin:0; }
-.wpsg-block-product-list .wpsg-product-list__action .wpsg_button { display:block; width:100%; margin:0; text-align:center; box-sizing:border-box; }
+.wpsg-block-product-list .wpsg-product-list__baseprice,
+.wpsg-block-product-price .wpsg-product-list__taxnote,
+.wpsg-block-product-price .wpsg-product-list__baseprice { font-size:0.8em; }
+.wpsg-block-product-list .wpsg-product-list__action, .wpsg-block-product-price .wpsg-product-list__action { margin-top:auto; padding-top:0.5em; }
+.wpsg-block-product-list .wpsg-product-list__action form, .wpsg-block-product-price .wpsg-product-list__action form { margin:0; }
+.wpsg-block-product-list .wpsg-product-list__action .wpsg_button, .wpsg-block-product-price .wpsg-product-list__action .wpsg_button { display:block; width:100%; margin:0; text-align:center; box-sizing:border-box; }
.wpsg-block-mini-cart .wpsg-mini-cart__link,
.wpsg-block-customer-account .wpsg-customer-account__link { display:inline-flex; flex-wrap:wrap; align-items:baseline; gap:0.5em; }
.wpsg-block-mini-cart .wpsg-mini-cart__content { display:inline-flex; gap:0.5em; }
diff --git a/views/css/wpsg-theme.css b/views/css/wpsg-theme.css
index 4bc5345..6530c75 100644
--- a/views/css/wpsg-theme.css
+++ b/views/css/wpsg-theme.css
@@ -578,11 +578,11 @@ html body .wpsg_product_garan_wrap a.wpsg_product_garan img { display:block; max
.wpsg-block-product-list :where(.wpsg-product-list__item) { display:flex; flex-direction:column; gap:0.5em; min-width:0; margin:0; padding:0; }
.wpsg-block-product-list :where(.wpsg-product-list__image img) { display:block; width:100%; height:auto; }
.wpsg-block-product-list :where(.wpsg-product-list__title) { margin:0; font-size:1em; line-height:1.3; overflow-wrap:anywhere; hyphens:auto; }
-.wpsg-block-product-list :where(.wpsg-product-list__price) { font-size:1.2em; }
-.wpsg-block-product-list :where(.wpsg-product-list__taxnote, .wpsg-product-list__baseprice) { font-size:var(--wpsg-font-size-small); opacity:var(--wpsg-muted-opacity); }
-.wpsg-block-product-list :where(.wpsg-product-list__action) { margin-top:auto; padding-top:0.5em; }
-.wpsg-block-product-list :where(.wpsg-product-list__action form) { margin:0; }
-.wpsg-block-product-list :where(.wpsg-product-list__action .wpsg_button) { display:block; width:100%; margin:0; text-align:center; box-sizing:border-box; }
+.wpsg-block-product-list :where(.wpsg-product-list__price), .wpsg-block-product-price :where(.wpsg-product-list__price) { font-size:1.2em; }
+.wpsg-block-product-list :where(.wpsg-product-list__taxnote, .wpsg-product-list__baseprice), .wpsg-block-product-price :where(.wpsg-product-list__taxnote, .wpsg-product-list__baseprice) { font-size:var(--wpsg-font-size-small); opacity:var(--wpsg-muted-opacity); }
+.wpsg-block-product-list :where(.wpsg-product-list__action), .wpsg-block-product-price :where(.wpsg-product-list__action) { margin-top:auto; padding-top:0.5em; }
+.wpsg-block-product-list :where(.wpsg-product-list__action form), .wpsg-block-product-price :where(.wpsg-product-list__action form) { margin:0; }
+.wpsg-block-product-list :where(.wpsg-product-list__action .wpsg_button), .wpsg-block-product-price :where(.wpsg-product-list__action .wpsg_button) { display:block; width:100%; margin:0; text-align:center; box-sizing:border-box; }
.wpsg-block-mini-cart :where(.wpsg-mini-cart__link), .wpsg-block-customer-account :where(.wpsg-customer-account__link) { display:inline-flex; flex-wrap:wrap; align-items:baseline; gap:0.5em; text-decoration:none; }
.wpsg-block-mini-cart :where(.wpsg-mini-cart__content) { display:inline-flex; gap:0.5em; }
.wpsg-block-mini-cart :where(.wpsg-mini-cart__sum) { font-weight:bold; }