summaryrefslogtreecommitdiff
path: root/views/mods
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/mods
parent023850374d0c1647768f72657339acc864cd20c8 (diff)
Korrektur Produktbilder->ImageHandler
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6454 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_productvariants/admin_edit.phtml2
-rw-r--r--views/mods/mod_productvariants/admin_html.phtml3
-rw-r--r--views/mods/mod_productvariants/produkt.phtml54
3 files changed, 26 insertions, 33 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 @@
<?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
<td class="col_action">
- <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation löschen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation löschen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $this->view['product_id'].','.$vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
</td>
<?php } ?>
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('<?php echo __('Sind Sie sich sicher, dass Sie die Variation löschen möchten?', 'wpsg'); ?>')) return false;
@@ -87,6 +87,7 @@
url: '<?php echo WPSG_URL_WP; ?>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 @@
<div class="wpsg_vp_field wpsg_vp_field_<?php echo $this->getProduktId($this->view['data']['id']); ?>">
- <?php if ($var['typ'] != 'radio') { ?>
+ <?php if ($var['type'] != wpsg_mod_productvariants::TYPE_RADIO) { ?>
<label class="wpsg_vp_field_label" for="wpsg_vpfield_<?php echo $this->getProduktId($this->view['data']['id']); ?>_<?php echo $k; ?>">
<?php echo $var['name']; ?>
</label>
@@ -21,7 +21,7 @@
<span class="wpsg_vp_field"><?php echo $var['name']; ?></span>
<?php } ?>
- <div class="wpsg_vp_field_typ_<?php echo $var['typ']; ?>">
+ <div class="wpsg_vp_field_typ_<?php echo $var['type']; ?>">
<?php /* SELECT-Box START */ ?>
<?php if ($var['type'] == wpsg_mod_productvariants::TYPE_SELECT) { ?>
@@ -62,22 +62,21 @@
<?php } ?>
<?php } ?>
</select>
- <?php if ($this->get_option("wpsg_vp_showpic") == "1" && $this->hasMod('wpsg_mod_produktbilder')) { ?>
+ <?php if ($this->get_option("wpsg_vp_showpic") == "1") { ?>
<span class="wpsg_vp_field_image">
<?php foreach ($var['arVariation'] as $kv => $vari) {
if ($vari['active'] == "1" && isset($vari['showpic'])) { ?>
<span class="wpsg_vp_image wpsg_vp_image_<?php echo $kv; ?>" style="display:<?php echo (($this->view['wpsg_mod_productvariants']['set'][$k] == $kv)?'block':'none'); ?>;">
<?php
- /*
- $img_src = $this->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 @@
<?php } /* SELECT-Box ENDE */ ?>
<?php /* IMAGE START */ ?>
- <?php if ($var['type'] == wpsg_mod_productvariants::TYPE_IMAGE && $this->hasMod('wpsg_mod_produktbilder')) { ?>
+ <?php if ($var['type'] == wpsg_mod_productvariants::TYPE_IMAGE) { ?>
<div class="wpsg_mod_productvariants_imageselect wpsg_mod_productvariants_imageselect_<?php echo $k; ?>">
<span>
<input type="hidden" name="wpsg_vp[<?php echo $k; ?>]" id="wpsg_vp_<?php echo $k; ?>" value="<?php echo wpsg_getStr($this->view['wpsg_mod_productvariants']['set'][$k]); ?>" />
<?php $kkv = -1; foreach ($var['arVariation'] as $kv => $vari) { $kkv++;
if ($vari['active'] == '1' && (!$this->hasMod('wpsg_mod_stock') || $vari['stock'] > 0)) { ?>
- <?php $img = $vari['guid']; ?>
- <?php if (wpsg_isSizedString($img)) {
- $pbw = $this->get_option('wpsg_vp_imageselect_width');
- $pbh = $this->get_option('wpsg_vp_imageselect_height');
- ?>
- <a data-wpsg-id="<?php echo $kv; ?>" class="wpsg_vp_update_image image <?php echo ((wpsg_getStr($this->view['wpsg_mod_productvariants']['set'][$k]) == $kv)?'akt':''); ?>" onclick="jQuery(this).parent().find('a').removeClass('akt'); jQuery(this).addClass('akt'); return false;" href="#">
- <img src="<?php echo $img; ?>" width="<?php echo $pbw; ?>" height="<?php echo $pbh; ?>"/>
+
+ <?php
+ 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']);
+ ?>
+ <a data-wpsg-id="<?php echo $kv; ?>" class="wpsg_vp_update_image image <?php echo ((wpsg_getStr($this->view['wpsg_mod_productvariants']['set'][$k]) == $kv)?'akt':''); ?>" href="#">
+ <?php echo wp_get_attachment_image($attachmentID, 'thumbnail'); ?>
</a>
+
<?php } ?>
+
<?php } ?>
<?php } ?>
</span>
@@ -145,16 +147,6 @@
<span class="wpsg_vp_field_image">
<?php
- /*
- $img_src = $this->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');
} );
} );