summaryrefslogtreecommitdiff
path: root/views/mods/mod_productvariants/productTemplate.phtml
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2016-09-21 10:55:51 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2016-09-21 10:55:51 +0000
commit24cc55213fa39bd2c2e3215943f22bef731e58fb (patch)
tree6156aa9a60ab7ab72183c274a50c39e44404e99a /views/mods/mod_productvariants/productTemplate.phtml
parente9cd93a5ba05b1f2b1216aba0fba86ac5977beaf (diff)
- Select im Editable zeigt gesetzten Wert
- Varianten im Frontend angezeigt und schalten Produkt um - Warnungen raus git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5767 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_productvariants/productTemplate.phtml')
-rw-r--r--views/mods/mod_productvariants/productTemplate.phtml38
1 files changed, 35 insertions, 3 deletions
diff --git a/views/mods/mod_productvariants/productTemplate.phtml b/views/mods/mod_productvariants/productTemplate.phtml
index 35f873a..0f472f5 100644
--- a/views/mods/mod_productvariants/productTemplate.phtml
+++ b/views/mods/mod_productvariants/productTemplate.phtml
@@ -3,17 +3,49 @@
/**
* Integration der Variantenauswahl in die Produktverwaltung
*/
-
+
?>
-<div class="wpsg_mod_variants_product_wrap">
+<div class="wpsg_mod_productvariants_product_wrap" id="wpsg_mod_productvariants_product_wrap_<?php echo $GLOBALS['wpsg_produkt_index']; ?>" wpsg-productindex="<?php echo $GLOBALS['wpsg_produkt_index']; ?>">
<?php foreach ($this->view['wpsg_mod_productvariants']['arVariants'] as $var) { ?>
- <div class="wpsg_mod_variants_product">
+ <div class=wpsg_mod_productvariants_product wpsg_mod_productvariants_type_<?php echo $var['type']; ?>">
+
+ <?php if ($var['type'] == wpsg_mod_productvariants::TYPE_SELECT) { ?>
+ <label class="wpsg_mod_productvariants_label" for="wpsg_mod_productvariants_<?php echo $this->view['wpsg_mod_productvariants']['product_id']; ?>_<?php echo $var['id']; ?>"><?php echo wpsg_hspc($var['name']); ?></label>
+
+ <select class="wpsg_mod_productvariants_change" id="wpsg_mod_productvariants_<?php echo $this->view['wpsg_mod_productvariants']['product_id']; ?>_<?php echo $var['id']; ?>" name="wpsg_mod_productvariants[<?php echo $var['id']; ?>]">
+ <?php foreach ($var['arVariation'] as $vari) { ?>
+ <option <?php echo (($this->view['wpsg_mod_productvariants']['product_variants'][$var['id']] == $vari['id'])?'selected="selected"':''); ?> value="<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['name']); ?></option>
+ <?php } ?>
+ </select>
+ <?php } else if ($var['type'] == wpsg_mod_productvariants::TYPE_RADIO) { ?>
+
+ <label class="wpsg_mod_productvariants_label"><?php echo wpsg_hspc($var['name']); ?></label>
+
+ <?php foreach ($var['arVariation'] as $vari) { ?>
+ <label class="wpsg_mod_productvariants_variation_label">
+ <input class="wpsg_mod_productvariants_change" <?php echo (($this->view['wpsg_mod_productvariants']['product_variants'][$var['id']] == $vari['id'])?'checked="checked"':''); ?> type="radio" name="wpsg_mod_productvariants[<?php echo $var['id']; ?>]" value="<?php echo $vari['id']; ?>" />
+ <span><?php echo wpsg_hspc($vari['name']); ?></span>
+ </label>
+ <?php } ?>
+
+ <?php } ?>
</div>
<?php } ?>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#wpsg_mod_productvariants_product_wrap_<?php echo $GLOBALS['wpsg_produkt_index']; ?>').bind('change', wpsg_mod_productvariants_reload);
+
+ } );
+
+ /* ]]> */</script>
+
</div>