summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--views/mods/mod_productvariants/admin_edit.phtml8
1 files changed, 6 insertions, 2 deletions
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml
index c32a6cd..8f54077 100644
--- a/views/mods/mod_productvariants/admin_edit.phtml
+++ b/views/mods/mod_productvariants/admin_edit.phtml
@@ -182,10 +182,14 @@
<?php $j = 0; foreach ($temp as $b) { $j ++; ?>
<?php // $this->view['variant']['id'] $vari $var $kv $_REQUEST['pic']
$file = $b['basename'];
+ $pos1 = strrpos($file, '-');
+ $pos2 = strrpos($file, '.');
+ $file2 = substr_replace($file, '', $pos1, $pos2 - $pos1);
+
$href = wp_get_attachment_image_src($b['post_id'], Array(25, 25));
?>
- <a class="<?php echo ((in_array($file, explode(",", $vari['pic'])))?'mark':''); ?> pic" id="<?php echo $file; ?>"
- onclick="return wpsg_vp_vari_setPic(this, <?php echo $k; ?>, <?php echo $kv; ?>, '<?php echo $file; ?>', <?php echo $j; ?>);">
+ <a class="<?php echo ((in_array($file2, explode(",", $vari['pic'])))?'mark':''); ?> pic" id="<?php echo $file2; ?>"
+ onclick="return wpsg_vp_vari_setPic(this, <?php echo $k; ?>, <?php echo $kv; ?>, '<?php echo $file2; ?>', <?php echo $j; ?>);">
<img src="<?php echo $href[0]; ?>" alt="" width="25px" height="25px"/>
</a>
<?php } ?>