summaryrefslogtreecommitdiff
path: root/views/warenkorb
diff options
context:
space:
mode:
authorhartmut <noreply@maennchen1.de>2017-09-06 09:24:14 +0000
committerhartmut <noreply@maennchen1.de>2017-09-06 09:24:14 +0000
commitd8343a3f9d80fb5a397234cee15f63fcb8c47764 (patch)
treeb898ef9cfe467694e2288078e63b9e91ce13628d /views/warenkorb
parent023850374d0c1647768f72657339acc864cd20c8 (diff)
Korrektur Produktbilder->ImageHandler
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6454 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/warenkorb')
-rw-r--r--views/warenkorb/basket.phtml31
-rw-r--r--views/warenkorb/overview.phtml29
2 files changed, 19 insertions, 41 deletions
diff --git a/views/warenkorb/basket.phtml b/views/warenkorb/basket.phtml
index 30ff26e..46564cf 100644
--- a/views/warenkorb/basket.phtml
+++ b/views/warenkorb/basket.phtml
@@ -41,36 +41,25 @@
<div class="basket_product_row">
- <?php $this->view['$bPicture'] = false; ?>
+ <?php $this->view['$bPicture'] = false;
- <?php if ($this->get_option('wpsg_imagehandler_basketimage') == '1' && $this->hasMod('wpsg_mod_produktbilder')) {
-
- if (wpsg_isSizedString($product_data['varianten_image'])) $arImages = array($product_data['varianten_image']);
- else $arImages = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->getProduktID($product_data['id'])));
+ ?>
+ <?php if ($this->get_option('wpsg_imagehandler_basketimage') == '1') {
?>
<div class="productimage">
- <?php if (wpsg_isSizedString($arImages[0]['guid'])) { ?>
<?php
if (isset($product_data['product_key'])) {
- $arr = $this->callMod('wpsg_mod_productvariants', 'getKombiVariImages', array($product_data['product_key']));
- if (wpsg_isSizedArray($arr))
- {
- $ais = wp_get_attachment_image_src($arr[0]['post_id'], 'thumbnail');
- $url = $ais[0];
- }
- else
- {
- $url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($product_data['productkey'], 'thumbnail'));
- }
- } else {
- $url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($product_data['productkey'], 'thumbnail'));
+ $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($product_data['product_key']);
+ $attachmentID = $this->imagehandler->getAttachmentID($product_data['product_key']);
+
+ echo wp_get_attachment_image($attachmentID, 'medium');
+
}
- if (wpsg_isSizedString($url)) $this->view['$bPicture'] = true;
- echo "<img src=".$url." alt='' />";
+ if ($attachmentID > 0) $this->view['$bPicture'] = true;
+ //echo "<img src=".$url." alt='' />";
?>
- <?php } ?>
</div>
<?php } ?>
diff --git a/views/warenkorb/overview.phtml b/views/warenkorb/overview.phtml
index ef87d99..932adfb 100644
--- a/views/warenkorb/overview.phtml
+++ b/views/warenkorb/overview.phtml
@@ -122,35 +122,24 @@
<?php $this->view['$bPicture'] = false; ?>
- <?php if ($this->get_option('wpsg_imagehandler_basketimage') == '1' && $this->hasMod('wpsg_mod_produktbilder')) {
-
- if (wpsg_isSizedString($product_data['varianten_image'])) $arImages = array($product_data['varianten_image']);
- else $arImages = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->getProduktID($product_data['id'])));
+ <?php if ($this->get_option('wpsg_imagehandler_basketimage') == '1') {
?>
<div class="productimage">
- <?php if (wpsg_isSizedString($arImages[0]['guid'])) { ?>
<?php
+
if (isset($product_data['product_key'])) {
- $arr = $this->callMod('wpsg_mod_productvariants', 'getKombiVariImages', array($product_data['product_key']));
- if (wpsg_isSizedArray($arr))
- {
- $ais = wp_get_attachment_image_src($arr[0]['post_id'], 'thumbnail');
- $url = $ais[0];
- }
- else
- {
- $url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($product_data['productkey'], 'thumbnail'));
- }
- } else {
- $url = $this->callMod('wpsg_mod_produktbilder', 'getProductImage_MT', array($product_data['productkey'], 'thumbnail'));
+ $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($product_data['product_key']);
+ $attachmentID = $this->imagehandler->getAttachmentID($product_data['product_key']);
+
+ echo wp_get_attachment_image($attachmentID, 'medium');
+
}
- if (wpsg_isSizedString($url)) $this->view['$bPicture'] = true;
- echo "<img src=".$url." alt='' />";
+ if ($attachmentID > 0) $this->view['$bPicture'] = true;
+
?>
- <?php } ?>
</div>
<?php } ?>