diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2025-01-10 11:20:46 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2025-01-10 11:20:46 +0000 |
| commit | 93af7cd1f473a90781d15ae418e4b3d3c353af4d (patch) | |
| tree | e863c46531af9c719a859dc2304a60ba45b89afb | |
| parent | c38bc3856deeecfb9378f9a2fd3feda016254d30 (diff) | |
- Standard3.phtml wechselt direkt das Variantenbild
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8473 0d5edaf7-2b12-4e95-93f4-047927463d4b
| -rw-r--r-- | views/produkttemplates/standard3.phtml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/views/produkttemplates/standard3.phtml b/views/produkttemplates/standard3.phtml index d376674..95e6ef0 100644 --- a/views/produkttemplates/standard3.phtml +++ b/views/produkttemplates/standard3.phtml @@ -8,7 +8,11 @@ $oProduct = $this->view['oProduct'];
$arAttachmentIDsAll = $this->imagehandler->getAttachmentIDs($this->view['data']['product_id']);
-
+ $arAttachmentID = $this->imagehandler->getAttachmentID($this->view['data']['product_key']);
+ $arAttachmentIndex = 0;
+
+ foreach ($arAttachmentIDsAll as $k => $v) if (intval($v) === intval($arAttachmentID)) $arAttachmentIndex = $k;
+
?>
<div class="wpsg_produkt_wrapper layout3">
@@ -190,7 +194,7 @@ <?php /* Lagerbestand ENDE*/?>
<?php /* Füllmengenanzeige START */ ?>
- <?php echo $this->callMod('wpsg_mod_fuellmenge', 'renderPriceInfo', [$oProduct->getPrice($this->view['data']['product_key']), $this->view['data']['fmenge'], $oProduct->getId()]); ?>
+ <?php echo $this->callMod('wpsg_mod_fuellmenge', 'renderPriceInfo', [$oProduct->getPrice($this->view['data']['product_key']), $this->view['data']['fmenge']??0, $oProduct->getId()]); ?>
<?php /* Füllmengenanzeige ENDE */ ?>
<?php /* Gewichtsanzeige START */ ?>
@@ -459,7 +463,7 @@ if (!wpsg_standard3_load) {
- function wpsg_standard3_load(templateIndex) {
+ function wpsg_standard3_load(templateIndex, imageIndex) {
if (wpsg_standard3_slider[templateIndex]) {
@@ -507,19 +511,19 @@ }
- wpsg_standard3_slider[templateIndex].goTo(0);
+ wpsg_standard3_slider[templateIndex].goTo(imageIndex);
};
};
- window.addEventListener('load', () => { wpsg_standard3_load(<?php echo $this->getTemplateIndex(); ?>); });
+ window.addEventListener('load', () => { wpsg_standard3_load(<?php echo $this->getTemplateIndex(); ?>, <?php echo $arAttachmentIndex; ?>); });
<?php if (($_REQUEST['action']??'') === 'wpsg_productvariants_switch') { ?>
window.setTimeout(() => {
- wpsg_standard3_load(<?php echo $this->getTemplateIndex(); ?>);
+ wpsg_standard3_load(<?php echo $this->getTemplateIndex(); ?>, <?php echo $arAttachmentIndex; ?>);
}, 100);
|
