diff options
| author | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-03 13:29:22 +0200 |
|---|---|---|
| committer | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-03 13:29:22 +0200 |
| commit | ea234677a16f1449672add644b2dd6d765e121d7 (patch) | |
| tree | 74e5fa7f0e6e9e87956e32ca675cba545cb6dfd7 | |
| parent | 13b8f2e3ea934df5ce34490904a0dc652bb100f1 (diff) | |
Produkte: Etiketten „Neu“ und „Angebot“ im Modus „neu“
Neuer Schalter „Als neu kennzeichnen“ am Produkt; „Angebot“ erscheint bei einem Streichpreis. Die Etiketten stehen über dem Titel der Produktseite und in der Produktliste auf dem Bild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | views/blocks/product-list.phtml | 2 | ||||
| -rw-r--r-- | views/css/wpsg-theme.css | 7 | ||||
| -rw-r--r-- | views/produkt/addedit_general.phtml | 3 | ||||
| -rw-r--r-- | views/produktseite/produkt.phtml | 2 |
4 files changed, 13 insertions, 1 deletions
diff --git a/views/blocks/product-list.phtml b/views/blocks/product-list.phtml index 767ebd2..9b1d103 100644 --- a/views/blocks/product-list.phtml +++ b/views/blocks/product-list.phtml @@ -32,6 +32,8 @@ </a> <?php } ?> + <?php /* Etiketten am Bild, nur im Modus „neu“ (Punkt 8.15) */ if (\wpsg\ThemeStyle::isThemeMode()) echo \wpsg\ProductPage::labels($oProduct, floatval($oProduct->getPrice($product_id))); ?> + <h3 class="wpsg-product-list__title"><a href="<?php echo esc_url($p['url']); ?>"><?php echo esc_html($name); ?></a></h3> <?php if ($this->canDisplayPrice()) { $price = $oProduct->getPrice($product_id); ?> diff --git a/views/css/wpsg-theme.css b/views/css/wpsg-theme.css index c930e37..bc9a310 100644 --- a/views/css/wpsg-theme.css +++ b/views/css/wpsg-theme.css @@ -33,6 +33,8 @@ --wpsg-color-notice: #a66709; --wpsg-muted-opacity: 0.7; --wpsg-radius: 3px; + --wpsg-label-background: var(--wpsg-color-accent); + --wpsg-label-color: var(--wpsg-color-background); --wpsg-gap: 1rem; --wpsg-font-size-small: var(--wp--preset--font-size--small, 0.875em); --wpsg-field-border: 1px solid var(--wpsg-color-line); @@ -321,6 +323,11 @@ .wpsg-product :where(.wpsg-product__breadcrumbs ol) { display:flex; flex-wrap:wrap; gap:0.25em 0.5em; margin:0; padding:0; list-style:none; } .wpsg-product :where(.wpsg-product__breadcrumbs li + li)::before { content:"/" / ""; margin-right:0.5em; opacity:var(--wpsg-muted-opacity); } .wpsg-product :where(.wpsg-product__breadcrumbs a, .wpsg-product__breadcrumbs [aria-current]) { color:inherit; opacity:var(--wpsg-muted-opacity); } +.wpsg-labels { display:flex; flex-wrap:wrap; gap:0.4em; } +:where(.wpsg-label) { display:inline-block; width:fit-content; padding:0.125rem 0.625rem; border-radius:999px; background:var(--wpsg-label-background); color:var(--wpsg-label-color); font-size:var(--wpsg-font-size-small); font-weight:700; line-height:1.6; } +.wpsg-product :where(.wpsg-product__details > .wpsg-labels) { margin-bottom:0.75em; } +.wpsg-block-product-list :where(.wpsg-product-list__item) { position:relative; } +.wpsg-block-product-list :where(.wpsg-product-list__image + .wpsg-labels) { position:absolute; top:0.5em; left:0.5em; } .wpsg-product :where(.wpsg-product__main) { display:flex; flex-wrap:wrap; align-items:flex-start; gap:calc(var(--wpsg-gap) * 2.5); } .wpsg-product :where(.wpsg-product__media) { flex:1 1 22rem; min-width:0; float:none; margin:0; } .wpsg-product :where(.wpsg-product__media .wpsg_produkt_produktbilder) { max-width:none; } diff --git a/views/produkt/addedit_general.phtml b/views/produkt/addedit_general.phtml index 097eb00..dc1780e 100644 --- a/views/produkt/addedit_general.phtml +++ b/views/produkt/addedit_general.phtml @@ -48,7 +48,7 @@ <?php } ?>
<?php if (!isset($_REQUEST['wpsg_lang'])) { ?>
<?php echo wpsg_drawForm_Input('anr', __('Artikelnummer', 'wpsg'), wpsg_getStr($this->view['data']['anr'])); ?>
- <?php if (wpsg_product::hasManufacturerColumn()) echo wpsg_drawForm_Input('manufacturer', __('Hersteller', 'wpsg'), (string)($this->view['data']['manufacturer']??''), []); ?>
+ <?php if (wpsg_product::hasColumn('manufacturer')) echo wpsg_drawForm_Input('manufacturer', __('Hersteller', 'wpsg'), (string)($this->view['data']['manufacturer']??''), []); ?>
<?php if (!is_array($this->view['templates']) || sizeof($this->view['templates']) <= 0) { ?>
<?php echo wpsg_drawForm_Text(__('Produkttemplate', 'wpsg'), __('Keine Templatesdateien gefunden!', 'wpsg'), array('class_content_wrap' => 'wpsg_error')); ?>
<?php } else { ?>
@@ -66,6 +66,7 @@ '1' => __('Mehrfach mit beliebiger Menge', 'wpsg'),
'2' => __('Mehrfach mit Menge 1', 'wpsg')
), wpsg_getStr($this->view['data']['basket_multiple']), array('help' => 'basket_multiple')); ?>
+ <?php if (wpsg_product::hasColumn('mark_new')) echo wpsg_drawForm_Checkbox('mark_new', __('Als neu kennzeichnen', 'wpsg'), intval($this->view['data']['mark_new']??0) === 1); ?>
<?php if (\wpsg\Blocks::hasDetailOnlyColumn()) echo wpsg_drawForm_Checkbox('detail_only', __('Kauf nur über die Detailseite', 'wpsg'), intval($this->view['data']['detail_only']??0) === 1, ['help' => 'detail_only']); ?>
<?php } ?>
diff --git a/views/produktseite/produkt.phtml b/views/produktseite/produkt.phtml index 714f80b..507f07e 100644 --- a/views/produktseite/produkt.phtml +++ b/views/produktseite/produkt.phtml @@ -93,6 +93,8 @@ <div class="wpsg-product__details"> + <?php /* Etiketten über dem Titel (Punkt 8.3) */ echo \wpsg\ProductPage::labels($oProduct, floatval($oProduct->getPrice($this->view['data']['product_key']))); ?> + <div class="wpsg_produkt wpsg_product_name"> <?php if (!$this->titleDisplayed) { ?> |
