diff options
Diffstat (limited to 'views')
| -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);
|
