php - Need a button for catalog input type on add attribute page in magento -
i created text field attribute gift coupon.need button named "generate" near it, used populate text field unique coupon code on click of button. searched lot nothing got.
updated code on
app/design/adminhtml/default/default/template/catalog/form/renderer/fieldset/element.phtml
<?php /** * @see mage_adminhtml_block_catalog_form_renderer_fieldset_element */ ?> <?php $_element = $this->getelement() ?> <?php $this->checkfielddisable() ?> <?php $elementtogglecode = $_element->gettogglecode() ? $_element->gettogglecode() : 'togglevalueelements(this, this.parentnode.parentnode)'; ?> <?php if ($_element->gettype()=='hidden'): ?> <tr> <td class="hidden" colspan="100"><?php echo trim($_element->getelementhtml()) ?></td> </tr> <?php else: ?> <tr> <td class="label"><?php echo trim($this->getelementlabelhtml()) ?></td> <td class="value"> <?php echo trim($this->getelementhtml()) ?> <?php if ($_element->getnote()) : ?> <p class="note"><?php echo $_element->getnote() ?></p> <?php endif; ?> </td> <td class="scope-label"><span class="nobr"><?php echo $this->getscopelabel() ?></span></td> <?php if ($this->candisplayusedefault()): ?> <td class="value use-default"> <input <?php if($_element->getreadonly()):?> disabled="disabled"<?php endif; ?> type="checkbox" name="use_default[]" id="<?php echo $_element->gethtmlid() ?>_default"<?php if ($this->useddefault()): ?> checked="checked"<?php endif; ?> onclick="<?php echo $elementtogglecode; ?>" value="<?php echo $this->getattributecode() ?>"/> <label for="<?php echo $_element->gethtmlid() ?>_default" class="normal"><?php echo $this->__('use default value') ?></label> </td> <?php endif; ?> </tr> <?php endif; ?> **<?php if($_element->getid()=='giftcoupen'){ //modify here have button ?> <input type="submit" name="gen" value="generate" /> <?php } ?>**
then generate button after .but while clicking on goes submit action. don't have idea how make work generate coupon code .
as far know, can achieve modifying following template file
app/design/adminhtml/default/default/template/catalog/form/renderer/fieldset/element.phtml
if($_element->getid()=='your_attribute_code'){ //modify here have button }
Comments
Post a Comment