From d8343a3f9d80fb5a397234cee15f63fcb8c47764 Mon Sep 17 00:00:00 2001 From: hartmut Date: Wed, 6 Sep 2017 09:24:14 +0000 Subject: Korrektur Produktbilder->ImageHandler git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6454 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_productvariants/admin_edit.phtml | 2 +- views/mods/mod_productvariants/admin_html.phtml | 3 +- views/mods/mod_productvariants/produkt.phtml | 54 +++++++++++-------------- views/produkttemplates/standard.phtml | 24 +++++------ views/warenkorb/basket.phtml | 31 +++++--------- views/warenkorb/overview.phtml | 29 +++++-------- 6 files changed, 54 insertions(+), 89 deletions(-) diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml index 987e076..0ee21dc 100644 --- a/views/mods/mod_productvariants/admin_edit.phtml +++ b/views/mods/mod_productvariants/admin_edit.phtml @@ -163,7 +163,7 @@ view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?> - + diff --git a/views/mods/mod_productvariants/admin_html.phtml b/views/mods/mod_productvariants/admin_html.phtml index ca08ab2..7fc6fe6 100644 --- a/views/mods/mod_productvariants/admin_html.phtml +++ b/views/mods/mod_productvariants/admin_html.phtml @@ -73,7 +73,7 @@ } // function wpsg_mod_productvariants_del(variant_id) - function wpsg_mod_productvariation_del(variation_id) + function wpsg_mod_productvariation_del(product_id, variation_id) { if (!confirm('')) return false; @@ -87,6 +87,7 @@ url: 'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1', data: { 'subaction': 'admin_variation_del', + 'product_id': product_id, 'variation_id': variation_id, 'variant_id': vari_id }, diff --git a/views/mods/mod_productvariants/produkt.phtml b/views/mods/mod_productvariants/produkt.phtml index bf8ddbd..4c7ace3 100644 --- a/views/mods/mod_productvariants/produkt.phtml +++ b/views/mods/mod_productvariants/produkt.phtml @@ -13,7 +13,7 @@
- + @@ -21,7 +21,7 @@ -
+
@@ -62,22 +62,21 @@ - get_option("wpsg_vp_showpic") == "1" && $this->hasMod('wpsg_mod_produktbilder')) { ?> + get_option("wpsg_vp_showpic") == "1") { ?> $vari) { if ($vari['active'] == "1" && isset($vari['showpic'])) { ?> callMod('wpsg_mod_produktbilder', 'makeTn', array( - $this->getProduktId($this->view['data']['id']), - $vari['showpic'], - $this->get_option("wpsg_vp_showpic_width"), - $this->get_option("wpsg_vp_showpic_height"), - 's' - )); - */ + if (isset($this->view['data']['product_key'])) { + $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['data']['product_key']); + $attachmentID = $this->imagehandler->getAttachmentID($this->view['data']['product_key']); + + echo wp_get_attachment_image($attachmentID, 'medium'); + + } + $pbw = $this->get_option("wpsg_vp_showpic_width"); $pbh = $this->get_option("wpsg_vp_showpic_height"); $img_src = $vari['guid']; @@ -92,21 +91,24 @@ - hasMod('wpsg_mod_produktbilder')) { ?> +
$vari) { $kkv++; if ($vari['active'] == '1' && (!$this->hasMod('wpsg_mod_stock') || $vari['stock'] > 0)) { ?> - - get_option('wpsg_vp_imageselect_width'); - $pbh = $this->get_option('wpsg_vp_imageselect_height'); - ?> - - + + view['data']['product_key'])) { + $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['data']['product_key']); + $attachmentID = $this->imagehandler->getAttachmentID($this->view['data']['product_key']); + ?> + + + + @@ -145,16 +147,6 @@ callMod('wpsg_mod_produktbilder', 'makeTn', array( - $this->getProduktId($this->view['data']['id']), - $vari['showpic'], - $this->get_option("wpsg_vp_showpic_width"), - $this->get_option("wpsg_vp_showpic_height"), - 's' - )); - */ - $pbw = $this->get_option("wpsg_vp_showpic_width"); $pbh = $this->get_option("wpsg_vp_showpic_height"); $img_src = $vari['guid']; @@ -185,7 +177,7 @@ jQuery(this).closest('span').find('input').val(jQuery(this).data('wpsg-id')); wpsg_mod_productvariants_reload(event); - + alert('TEST'); } ); } ); diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml index 43e1a26..691c5a1 100644 --- a/views/produkttemplates/standard.phtml +++ b/views/produkttemplates/standard.phtml @@ -10,11 +10,9 @@ // Damit keine Zubehörprodukte ausgegeben werden //$this->noReleatedProducts = true; - $arImages = $this->callMod('wpsg_mod_productvariants', 'getKombiVariImages', array($this->view['data']['product_key'])); - if (!wpsg_isSizedArray($arImages)) - $arImages = $this->callMod('wpsg_mod_produktbilder', 'getProduktBilder_MT', array($this->view['data']['product_key'])); - //$arImages = array(); - + $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['data']['product_key']); + $arAttachmentIDsAll = $this->imagehandler->getAttachmentIDs($this->view['data']['product_id']); + ?>
@@ -37,20 +35,16 @@
- +
- - - - - - 1) { for ($i = 1; $i < sizeof($arImages); $i ++) { ?> - - rel="gallery-wpsg-getTemplateIndex(); ?>" title="getProductName($this->view['data']['id']); ?>" href="" class="thickbox"> + 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 @@
- view['$bPicture'] = false; ?> + view['$bPicture'] = false; - 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']))); + ?> + get_option('wpsg_imagehandler_basketimage') == '1') { ?>
- 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 ""; + if ($attachmentID > 0) $this->view['$bPicture'] = true; + //echo ""; ?> -
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 @@ view['$bPicture'] = false; ?> - 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']))); + get_option('wpsg_imagehandler_basketimage') == '1') { ?>
- 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 ""; + if ($attachmentID > 0) $this->view['$bPicture'] = true; + ?> -
-- cgit v1.2.3