4

I want to display more attribute like size|gender|color in Magento Sales-->Order section Below is the code I used to get these details

File Path- /app/design/adminhtml/default/mytheme/template/sales/items/column/name.phtml

Code-

  <?php if ($_item = $this->getItem()):?>
    <h5 class="title"><span id="order_item_<?php echo $_item->getId() ?>_title"><?php echo $this->htmlEscape($_item->getName()) ?></span></h5>
    <div><strong><?php echo $this->helper('sales')->__('SKU') ?>:</strong> <?php echo implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($this->getSku()))); ?></div>
<?php   
?>
    <?php if ($this->getOrderOptions()): ?>
        <dl class="item-options">
        <?php foreach ($this->getOrderOptions() as $_option):
             //print_r($_option);
         ?>
            <dt><?php echo $_option['label'] ?></dt>
            <dd>
            <?php if (isset($_option['custom_view']) && $_option['custom_view']): ?>
                <?php echo $this->getCustomizedOptionValue($_option); ?>
            <?php else: ?>
                <?php $_option = $this->getFormattedOption($_option['value']); ?>
                <?php echo $_option['value']; ?><?php if (isset($_option['remainder']) && $_option['remainder']): ?><span id="<?php echo $_dots = 'dots' . uniqid()?>"> ...</span><span id="<?php echo $_id = 'id' . uniqid()?>"><?php //echo $_option['remainder'] ?></span>
                    <script type="text/javascript">
                    $('<?php echo $_id ?>').hide();
                    $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_id ?>').show();});
                    $('<?php echo $_id ?>').up().observe('mouseover', function(){$('<?php echo $_dots?>').hide();});
                    $('<?php echo $_id ?>').up().observe('mouseout',  function(){$('<?php echo $_id ?>').hide();});
                    $('<?php echo $_id ?>').up().observe('mouseout',  function(){$('<?php echo $_dots ?>').show();});
                    </script>
                <?php endif; ?>
            <?php endif; ?>
            </dd>
        <?php endforeach; ?>
        </dl>
    <?php endif; ?>
    <?php //echo $this->htmlEscape($_item->getDescription()) ?>
<?php endif; ?>

Here I can get SKU but $this->getOrderOptions() is returns empty array so code below if($this->getOrderOptions()):) not works. Please help me on this. I have attached image below for more informationenter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.