0

I am trying to remove Html tags from (Downloadable) Product Custom Option values, but cannot yet figure out, from which file product custom options are fetched in New Order Email ?

I edited the following file but no luck:

app/design/frontend/my_theme/default/template/email/order/items/order/default.phtml

From which file product custom options are fetched in New Order Email ?

1

Don't want to repost, but this answer on stackoverflow might help

https://stackoverflow.com/questions/14036507/list-item-options-in-magento-email-template/44887149#44887149

EDIT

In my case it looked like an observer was interfering with the $this->getItemOptions() method.

Try replacing the following block of code in

app/design/frontend/[YOUR_PACKAGE]/[YOUR_THEME]/template/email/order/items/order/default.phtml

<?php if ($this->getItemOptions()): ?>
<dl style="margin:0; padding:0;">
    <?php foreach ($this->getItemOptions() as $option): ?>
    <dt><strong><em><?php echo $option['label'] ?></em></strong></dt>
    <dd style="margin:0; padding:0 0 0 9px;">
        <?php echo nl2br($option['value']) ?>
    </dd>
    <?php endforeach; ?>
</dl>
<?php endif; ?>

with this

    <?php if ($options = $_item->getProductOptions()): ?>
        <?php if (isset($options['options'])): ?>
            <dl style="margin:0; padding:0;">
            <?php foreach ($options['options'] as $option): ?>
                <dt><strong><em><small><?php echo $option['label'] ?></small></em></strong></dt>
                <dd><?php echo (isset($option['print_value']) ? $option['print_value'] : nl2br($this->escapeHtml($option['value']))) ?></dd>
            <?php endforeach; ?>
            </dl>
        <?php endif; ?>
        <?php if (isset($options['additional_options'])): ?>
            <dl style="margin:0; padding:0;">
            <?php foreach ($options['additional_options'] as $option): ?>
                <dt><strong><em><small><?php echo $option['label'] ?></small></em></strong></dt>
                <dd><?php echo (isset($option['print_value']) ? $option['print_value'] : nl2br($this->escapeHtml($option['value']))) ?></dd>
            <?php endforeach; ?>
            </dl>
        <?php endif; ?>
        <?php if (isset($options['attributes_info'])): ?>
            <dl style="margin:0; padding:0;">
            <?php foreach ($options['attributes_info'] as $option): ?>
                <dt><strong><em><small><?php echo $option['label'] ?></small></em></strong></dt>
                <dd><?php echo (isset($option['print_value']) ? $option['print_value'] : nl2br($this->escapeHtml($option['value']))) ?></dd>
            <?php endforeach; ?>
            </dl>
        <?php endif; ?>
    <?php endif; ?>
| improve this answer | |
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – Ben Crook Jul 3 '17 at 16:46
  • 1
    cheers, I've updated the answer – Arithran Jul 3 '17 at 18:54
0

front this file it fetching app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php line 67

public function getItemOptions()
    {
        $result = array();
        if ($options = $this->getOrderItem()->getProductOptions()) {
            if (isset($options['options'])) {
                $result = array_merge($result, $options['options']);
            }
            if (isset($options['additional_options'])) {
                $result = array_merge($result, $options['additional_options']);
            }
            if (isset($options['attributes_info'])) {
                $result = array_merge($result, $options['attributes_info']);
            }
        }
        return $result;
    } 
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.