diff options
| author | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-03 12:31:31 +0200 |
|---|---|---|
| committer | Roger Rehnelt <noreply@maennchen1.de> | 2026-10-03 12:31:31 +0200 |
| commit | 42bd7e155cd6d0d12c8c16be9a16bbd3aa1abc98 (patch) | |
| tree | 896a0e0ce0657f7f8e15579401efc6f34e0ca94d | |
| parent | 56c0adb1e1fb725b96151baa51288b34e1f1a4e9 (diff) | |
Produktseite: eigene Vorlage im Modus „neu“
Produkte mit den Vorlagen 1–3 zeigen im Modus „neu“ eine eigene Produktseite; eigene Kopien des Betreibers gehen vor. Inhalt vorerst wie Vorlage 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| -rw-r--r-- | views/produktseite/produkt.phtml | 466 |
1 files changed, 466 insertions, 0 deletions
diff --git a/views/produktseite/produkt.phtml b/views/produktseite/produkt.phtml new file mode 100644 index 0000000..4c9efe0 --- /dev/null +++ b/views/produktseite/produkt.phtml @@ -0,0 +1,466 @@ +<?php + + /** + * Produktseite im Modus „neu“ (doc/theme-kompatibilitaet.md, Punkt 8) + * + * Ersetzt dort die Produktvorlagen 1–3, wenn der Betreiber keine eigene Kopie hat (ThemeStyle::productTemplate()). + * @version 4.6.1 + */ + + if (!defined('ABSPATH')) exit; + + //Ausgabe der verfügbaren Variablen + // wpsg_debug($this->view['data']); + + // Damit keine Zubehörprodukte ausgegeben werden + //$this->noReleatedProducts = true; + + /** @var wpsg_product $oProduct */ + $oProduct = $this->view['oProduct']; + if (($this->view['data']['product_key']??'') !== '') $oProduct->setProductKey($this->view['data']['product_key']); + +?> + +<div class="wpsg_produkt_wrapper wpsg-product"> + + <input type="hidden" name="wpsg_post_id" value="<?php echo get_the_ID(); ?>" /> + <input type="hidden" name="titleDisplayed" value="<?php echo $this->titleDisplayed; ?>" /> + + <div class="wpsg_produkt wpsg_product_name"> + + <?php if (!$this->titleDisplayed) { ?> + <h1 class="wpsg_producttitle"><?php echo $oProduct->getProductName(); ?></h1> + <?php if (($this->view['data']['detailname']??'') !== '' && $oProduct->getProductName() !== $this->view['data']['detailname']) { ?> + <h2 class="wpsg_productdetailtitle"><?php echo wp_kses_post($this->view['data']['detailname']); ?></h2> + <?php } ?> + <?php } ?> + + <?php $this->callMods('product_top_afterheadline', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?> + + </div> + + <?php $this->callMods('product_top', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?> + + <div itemscope itemtype="http://schema.org/Product" class="wpsg_produkt wpsg_produkt_<?php echo $this->view['data']['id']; ?>"> + + <meta itemprop="name" content="<?php echo wpsg_hspc($oProduct->getProductName()); ?>" /> + <meta itemprop="detailname" content="<?php echo wpsg_hspc($this->view['data']['detailname']); ?>" /> + + <?php foreach ($oProduct->getAllProductCodes() as $product_code) { ?> + <?php if ($product_code['itemprop'] !== null) { ?> + <meta itemprop="<?php echo $product_code['itemprop']; ?>" content="<?php echo $product_code['code']; ?>" /> + <?php } ?> + <?php } ?> + + <?php /* Block für die Produktbilder START */ ?> + <?php + + /* Das ist das primäre Anzeigebild des Produktes (AttachmentID) */ + $arAttachmentID = $this->imagehandler->getAttachmentID($this->view['data']['product_key']); + + /* Array mit allen AttachmentIDs der Produktbilder */ + $arAttachmentIDsAll = $this->imagehandler->getAttachmentIDs($this->view['data']['product_id']); + + ?> + + <?php if (wpsg_isSizedArray($arAttachmentIDsAll)) { ?> + <div class="wpsg_productimages"> + + <div class="wpsg_produkt_produktbilder"> + + <?php if (sizeof($arAttachmentIDsAll) > 0) { for ($i = 0; $i < sizeof($arAttachmentIDsAll); $i ++) { ?> + + <?php /* URL für die Lightbox */ ?> + <?php $att = wp_get_attachment_image_src($arAttachmentIDsAll[$i], array(800, 600), false); ?> + + <meta itemprop="image" content="<?php echo $att[0]; ?>" /> + + <a <?php if ($arAttachmentIDsAll[$i] != $arAttachmentID) echo 'style="display:none;"'; ?> rel="gallery-wpsg-<?php echo $this->getTemplateIndex(); ?>" title="<?php echo $oProduct->getProductName(); ?>" href="<?php echo $att[0]; ?>" data-fslightbox="<?php echo $this->getTemplateIndex(); ?>"> + + <?php echo wp_get_attachment_image($arAttachmentIDsAll[$i], array(300, 300), false, array()); ?> + + </a> + + <?php } } ?> + + </div> + + </div> + <?php } ?> + <?php /* Block für die Produktbilder ENDE */ ?> + + <?php if ($this->get_option('wpsg_showArticelnumber') == '1') { ?> + <div class="wpsg_artikelnummer"> + <?php echo __('Artikelnummer', 'wpsg'); ?>: <span class="wpsg_anr"><?php echo wpsg_hspc($oProduct->getNr()); ?></span><br /> + </div> + <?php } ?> + + <?php $arProductCodes = $oProduct->getAllProductCodes(); ?> + <?php if (sizeof($arProductCodes) > 0) { ?> + <div class="product_code_wrap"> + <?php foreach ($arProductCodes as $product_code) { ?> + <?php if ($product_code !== null) { ?> + + <div class="product_code <?php echo $product_code['code_key']; ?>"> + <span class="label"><?php echo $product_code['label']; ?></span>: <span class="code"><?php echo $product_code['code']; ?></span> + </div> + + <?php } ?> + <?php } ?> + </div> + <?php } ?> + + <?php /* Abfrage Preisanzeige nur für eingeloggte User aktiv und User eingeloggt START*/ ?> + <?php if ($this->view['oProduct']->canDisplayPrice()) { ?> + + <div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="wpsg_produkt_preis"> + + <meta itemprop="priceCurrency" content="<?php echo $this->get_option('wpsg_currency'); ?>" /> + <meta itemprop="price" content="<?php echo $this->view['oProduct']->getPrice($this->view['data']['product_key']); ?>" /> + + <?php echo __('Stückpreis:', 'wpsg'); ?> + + <?php $oldPrice = $this->view['oProduct']->getOldPrice(); ?> + + <?php if ($oldPrice !== false && $oldPrice != $this->view['oProduct']->getPrice($this->view['data']['product_key'])) { ?> + <span class="wpsg_mod_productview_price wpsg_mod_productview_current"><?php echo wpsg_price_html($this->view['oProduct']->getPrice($this->view['data']['product_key']), 'product'); ?></span> + <span class="wpsg_mod_productview_oldprice"><?php echo wpsg_price_html($oldPrice, 'product_old'); ?></span> + <?php } else { ?> + <span class="wpsg_mod_productview_price"><?php echo wpsg_price_html($this->view['oProduct']->getPrice($this->view['data']['product_key']), 'product'); ?></span> + <?php } ?> + + </div> + + <?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', 'wpsg').'</a>'); ?> + </div> + + <?php } else { /* Kleinunternehmerregelung aktiviert ENDE */ ?> + + <div class="wpsg_produkt_preishinweis"> + + <?php $fs = explode(',', $this->view['data']['allowedshipping']); ?> + <?php if ($this->getFrontendTaxview() == WPSG_NETTO) { /* Frontend = NETTO Preise */ ?> + <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1' && (array_search('500', $fs) || array_search('', $fs))) { /* Versandkostenfrei aktiv */?> + + <?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?> + <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und <a href="#3#">ab #2# € versandkostenfrei</a>)', 'wpsg'), + wpsg_ff($this->view['data']['mwst_value']), + wpsg_ff($this->get_option('wpsg_mod_freeshipping_minvalue')), + $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN) + ); ?> + <?php } else { ?> + <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und versandkostenfrei)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value'])); ?> + <?php } ?> + + <?php } else { ?> + <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?> + <?php }?> + <?php } else { /* Frontend = BRUTTO Preise */ ?> + <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1' && (array_search('500', $fs) || array_search('', $fs))) { /* Versandkostenfrei aktiv */ ?> + + <?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?> + <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und <a href="#3#">ab #2# € versandkostenfrei</a>)', 'wpsg'), + wpsg_ff($this->view['data']['mwst_value']), + wpsg_ff($this->get_option('wpsg_mod_freeshipping_minvalue')), + $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN) + ); ?> + <?php } else { ?> + <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und versandkostenfrei)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value'])); ?> + <?php } ?> + + <?php } else { ?> + <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?> + <?php }?> + <?php } ?> + + </div> + + <?php } ?> + + <?php } else {?> + + <?php echo wpsg_translate(__('Die Produktpreise werden nur eingeloggten Benutzern angezeigt. Loggen Sie sich <a href="'.$this->getURL(wpsg_ShopController::URL_PROFIL).'">hier</a> bitte ein, um zu bestellen.')); ?> + + <?php }?> + <?php /* Abfrage Preisanzeige nur für eingeloggte User aktiv und User eingeloggt ENDE */ ?> + + <div itemprop="description" class="wpsg_produkt_shortdescription"> + + <span><?php echo $this->view['data']['shortdesc']; ?></span> + + </div> + + <div class="wpsg_clear"></div> + + <?php /* Lagerbestand START*/ ?> + <?php + + if ($this->hasMod('wpsg_mod_stock') && $this->get_option('wpsg_mod_stock_showProduct') == '1') { + + $stock_source_display = '0'; // Variantenbestand + + if ($oProduct->getMeta('wpsg_vp_product_stock_display', false, '0') === '0') { + + // Einstellung + if ($this->get_option('wpsg_vp_product_stock_display') === '1') $stock_source_display = '1'; + + } else if ($oProduct->getMeta('wpsg_vp_product_stock_display') === '1') { + + $stock_source_display = '1'; // Produktbestand + + } + + $stock_display = $this->view['data']['stock']; + + if ($stock_source_display === '1') $stock_display = $oProduct->__get('stock'); + + ?> + + <div class="wpsg_mod_produktindex_stock"> + + <?php if ($stock_display > 0) {?> + + <label><?php echo __('Lagerbestand', 'wpsg'); ?></label> + <?php echo wpsg_translate(__('#1# Artikel auf Lager','wpsg'), $stock_display); ?> + + <?php } else { ?> + + <label><?php echo wpsg_translate(__('Ausverkauft', 'wpsg')); ?></label> + + <?php } ?> + + </div> + <?php } ?> + <?php /* Lagerbestand ENDE*/ ?> + + <?php /* Füllmengenanzeige START */ ?> + <?php if ($this->hasMod('wpsg_mod_fuellmenge')) { ?> + <?php echo $this->callMod('wpsg_mod_fuellmenge', 'renderPriceInfo', [$oProduct->getPrice($this->view['data']['product_key']), $this->view['data']['fmenge'], $oProduct->getId()]); ?> + <?php } ?> + <?php /* Füllmengenanzeige ENDE */ ?> + + <?php /* Gewichtsanzeige START */ ?> + <?php if ($this->hasMod('wpsg_mod_weight') && $this->get_option('wpsg_mod_weight_showProduct') === '1') { ?> + <div class="wpsg_mod_weight_produkt"> + + <?php if (($this->view['data']['weight']) > '0') { ?> + <span class="label label_weight"><?php echo wpsg_translate(__('Gewicht:', 'wpsg')); ?></span> + <?php echo wpsg_translate(__('#1# #2#', 'wpsg'), '<span class="wpsg_weight" id="weight_'.$this->view['data']['id'].'">'.wpsg_ff($this->view['data']['weight']).'</span>', $this->get_option('wpsg_mod_weight_unit')); ?> + <?php } else { ?> + <label><?php wpsg_translate(__('', 'wpsg'))?></label> + <?php } ?> + </div> + <?php } ?> + <?php /* Gewichtsanzeige ENDE */ ?> + + <?php /* Lieferzeit Anzeige START */ ?> + <?php if ($this->hasMod('wpsg_mod_deliverytime') && $this->get_option('wpsg_mod_deliverytime_show_product') == '1') { ?> + + <?php /* Produkt nur im Store, nicht im Onlineshop vorhanden */ ?> + <?php if ($this->callMod('wpsg_mod_deliverytime', 'isStoreProduct', array($this->view['data']['product_key']))) { ?> + + <div class="wpsg_product_only_store"><?php echo __($this->callMod('wpsg_mod_deliverytime', 'displayStoreText', array($this->view['data']['product_key']))); ?></div> + + <?php $stl = 0; $stl = $this->callMod('wpsg_mod_deliverytime', 'displayStoreLink', array($this->view['data']['product_key'])) ?> + <?php if (wpsg_isSizedInt($stl)) { ?> + + <a href="<?php echo get_permalink($stl); ?>"><?php echo __('So erreichen Sie uns.', 'wpsg'); ?></a> + + <?php } ?> + + <?php } else { ?> + + <?php $strDelayNote = $this->callMod('wpsg_mod_deliverytime', 'displayDelayTime', array($this->view['data']['product_key'])); ?> + <?php if (wpsg_isSizedString($strDelayNote)) { ?> + + <div class="wpsg_mod_deliverytime_offline"> + + <div class="wpsg_mod_deliverytime_delay"><?php echo wpsg_hspc($strDelayNote); ?></div> + + </div> + + <?php } else { ?> + + <div class="wpsg_mod_deliverytime"> + <span class="label label_deliverytime"><?php echo wpsg_translate(__('Lieferzeit:', 'wpsg')); ?></span> + <?php echo $this->callMod('wpsg_mod_deliverytime', 'displayDeliveryTime', array($this->view['data']['product_key'])); ?> + </div> + + <?php } ?> + + <?php } ?> + + <?php } ?> + <?php /* Lieferzeit Anzeige ENDE */ ?> + + <?php /* Produktkurzbeschreibung START */ ?> + <div class="wpsg_product_informationarea"> + + <?php if (strlen(trim($this->view['data']['beschreibung'])) > 0) { ?> + <div class="wpsg_product_information_short"> + <div class="wpsg_produkt_additional_information"> + <div itemprop="description" class="wpsg_produkt_shortdescription"> + <span><?php echo $this->view['data']['beschreibung']; ?></span> + </div> + </div> + </div> + <?php } ?> + + </div> + <?php /* Produktkurzbeschreibung ENDE */ ?> + + <?php /* Varianten START */ ?> + <div class="wpsg_produkt_varianten"> + <?php echo $this->callMod('wpsg_mod_productvariants', 'renderTemplate', array($this->view['data']['product_key'])); ?> + </div> + <?php /* Varianten ENDE */ ?> + + <?php $this->callMods('product_bottom', array(&$this->view['data']['product_key'], $this->getTemplateIndex())); ?> + + <?php if ($oProduct->isGARAN()) { ?> + + <?php echo \wpsg\WarrantyLabel::getProductHTML($oProduct); ?> + + <?php } ?> + + <div class="wpsg_product_buttonarea"> + <div class="wpsg_product_buttons_add_basket"> + <?php /* Urlaubsgruß im Urlaubszeitraum */ ?> + <?php if ($this->hasMod('wpsg_mod_deliverytime') && $this->callMod('wpsg_mod_deliverytime', 'holiday', array($this->view['data']['product_key']))) { ?> + <div class="wpsg_product_deliverytime_holiday" style="padding:10px; border:1px solid #ff0000;"><?php echo wpsg_hspc($this->callMod('wpsg_mod_deliverytime', 'displayHolidaytext', array($this->view['data']['product_key']))); ?></div> + <?php } ?> + + <?php if ($this->view['oProduct']->canOrder()) { ?> + <div class="wpsg_produkt_add_basket_wrapper"> + + <label class="wpsg_amount_label" for="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>"><?php echo __('Anzahl', 'wpsg'); ?></label> + + <input type="text" value="<?php echo ((wpsg_isSizedInt($this->view['data']['menge']))?$this->view['data']['menge']:'1'); ?>" name="wpsg[menge]" class="wpsg_menge" id="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>" <?php echo (($this->view['data']['basket_multiple'] == 4)?' readonly="readonly" ':''); ?> /> + + <input class="wpsg_button wpsg_add_basket wpsg_add_basket_<?php echo $this->getTemplateIndex(); ?><?php echo wpsg_button_class(); ?>" type="submit" value="<?php echo esc_attr(wpsg_button_text('add_to_basket', __('In den Warenkorb', 'wpsg'))); ?>" name="wpsg[submit]" /> + + <?php echo do_action('wpsg_producttemplate_afterButton'); ?> + + <?php if (in_array($this->get_option('wpsg_afterinsert'), array('2', '3'))) { ?> + <script type="text/javascript"> + + jQuery(document).ready(function() { + + jQuery('.wpsg_add_basket_<?php echo $this->getTemplateIndex(); ?>').on('click', function() { + + wpsg_blockProductTemplate(<?php echo $this->getTemplateIndex(); ?>); + + jQuery.ajax( { + url: '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET); ?>', + data: { + 'wpsg_form_data': jQuery('#wpsg_produktform_<?php echo $this->getTemplateIndex(); ?>').serialize(), + 'wpsg[ajax]': '1', + 'wpsg[submit]': '1' + }, + success: function(data) { + + wpsg_refreshBasketWidget(); + + <?php if ($this->get_option('wpsg_afterinsert') == '2') { ?> + + tb_show('<?php echo __('Ihr Warenkorb', 'wpsg'); ?>', '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET_AJAX); ?>&height=500'); + + <?php } else { ?> + + jQuery('body').append(data); + + <?php } ?> + + wpsg_unblockProductTemplate(<?php echo $this->getTemplateIndex(); ?>); + + } + } ); + + return false; + + } ); + + } ); + + </script> + <?php } ?> + + </div> + <?php } ?> + </div> + </div> + + <div class="wpsg_clear"></div> + + <?php if ($this->hasMod('wpsg_mod_request') && $this->callMod('wpsg_mod_request', 'isRequestProduct', array($this->view['data']['id']))) { ?> + <label class="wpsg_amount_label" for="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>"><?php echo __('Anzahl', 'wpsg'); ?></label> + <input type="text" value="<?php echo ((wpsg_isSizedInt($this->view['data']['menge']))?$this->view['data']['menge']:'1'); ?>" name="wpsg[menge]" class="wpsg_menge" id="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>" <?php echo (($this->view['data']['basket_multiple'] == 4)?' readonly="readonly" ':''); ?> /> + + <input class="wpsg_button wpsg_add_requestlist<?php echo wpsg_button_class(); ?>" id="wpsg_add_requestlist_<?php echo $this->getTemplateIndex(); ?>" type="submit" value="<?php echo __('Auf die Anfrageliste', 'wpsg'); ?>" name="wpsg[submit_request]" /> + <?php } ?> + + <?php /* Produktlangbeschreibung START */ ?> + <div class="wpsg_product_informationarea"> + + <?php if (strlen(trim($this->view['data']['longdescription'])) > 0) { ?> + <div class="wpsg_product_information_large"> + <div class="wpsg_produkt_additional_information"> + <div itemprop="description" class="wpsg_produkt_longdescription"> + <span><?php echo $this->view['data']['longdescription']; ?></span> + </div> + </div> + </div> + <?php } ?> + + </div> + <?php /* Produktlangbeschreibung ENDE */ ?> + + <?php /* zusätzliche Informationen START */ ?> + <div class="wpsg_product_informationarea"> + + <?php if (strlen(trim($this->view['data']['moreinfos'])) > 0) { ?> + <div class="wpsg_product_information_large"> + <div class="wpsg_produkt_additional_information"> + <div itemprop="description" class="wpsg_produkt_moreinfos"> + <span><?php echo $this->view['data']['moreinfos']; ?></span> + </div> + </div> + </div> + <?php } ?> + + </div> + <?php /* zusätzliche Informationen ENDE */ ?> + + <?php /* zusätzliche Lieferumfang START */ ?> + <div class="wpsg_product_informationarea"> + + <?php if (strlen(trim($this->view['data']['moreinfos2'])) > 0) { ?> + <div class="wpsg_product_information_large"> + <div class="wpsg_produkt_additional_information"> + <div itemprop="description" class="wpsg_produkt_moreinfos2"> + <span><?php echo $this->view['data']['moreinfos2']; ?></span> + </div> + </div> + </div> + <?php } ?> + + </div> + <?php /* zusätzliche Lieferumfang ENDE */ ?> + + <div class="wpsg_clear"></div> + + <?php /* Social Media Integration */ ?> + <div class="wpsg_product_social_media"> + <?php if (is_plugin_active('plugin-directory/shariff.php')) {?> + <?php echo do_shortcode('[shariff]')?> + <?php } ?> + </div> + + </div> + + <?php $this->callMods('product_bottom_end', array(&$this->view['data']['product_key'], $this->getTemplateIndex())); ?> + +</div>
\ No newline at end of file |
