Help with Magneto code

owas

Free Member
Jan 3, 2010
1,422
256
If any one could help with this I would be very grateful.

Below is the code from default.phtml file which I guess is the layout for the cart I would like to remove the summary column, or just the custom options and have the product name appear in this column.

The reason for this, as the site is selling a service rather than a product and a lot of costume options are required, and this are shown the cart page,making it look long and messy.

thanks

PHP:
  <td class="a-center">
        <h2 class="product-name">
        </h2>
        <?php if ($_options = $this->getOptionList()):?>
        <dl class="item-options">
            <?php foreach ($_options as $_option) : ?>
            <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>
            <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
            <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
                <?php if (isset($_formatedOptionValue['full_view'])): ?>
                <div class="truncated_full_value">
                    <dl class="item-options">
                        <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
                        <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
                    </dl>
                </div>
                <?php endif; ?>
            </dd>
            <?php endforeach; ?>
        </dl>
        <?php endif;?>
        <?php if ($messages = $this->getMessages()): ?>
        <?php foreach ($messages as $message): ?>
            <p class="item-msg <?php echo $message['type'] ?>">* <?php echo $message['text'] ?></p>
        <?php endforeach; ?>
        <?php endif; ?>
        <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?>
            <?php echo $addtInfoBlock->setItem($_item)->toHtml() ?>
        <?php endif;?>
    </td>
 
Removing this bit should remove the options:

PHP:
    <?php if ($_options = $this->getOptionList()):?> 
        <dl class="item-options"> 
            <?php foreach ($_options as $_option) : ?> 
            <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?> 
            <dt><?php echo $this->htmlEscape($_option['label']) ?></dt> 
            <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?> 
                <?php if (isset($_formatedOptionValue['full_view'])): ?> 
                <div class="truncated_full_value"> 
                    <dl class="item-options"> 
                        <dt><?php echo $this->htmlEscape($_option['label']) ?></dt> 
                        <dd><?php echo $_formatedOptionValue['full_view'] ?></dd> 
                    </dl> 
                </div> 
                <?php endif; ?> 
            </dd> 
            <?php endforeach; ?> 
        </dl> 
    <?php endif;?>
 
Last edited:
  • Like
Reactions: dx3webs
Upvote 0
Hi,
thanks for this, here is the start of it with the name options

PHP:
?>
<?php
$_item = $this->getItem();
$isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
?>
<tr> <td class="a-center">
        <h2 class="product-name"></h2>
        <?php if ($messages = $this->getMessages()): ?>
        <?php foreach ($messages as $message): ?>
            <p class="item-msg <?php echo $message['type'] ?>">* <?php echo $message['text'] ?></p>
        <?php endforeach; ?>
        <?php endif; ?>
        <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?>
            <?php echo $addtInfoBlock->setItem($_item)->toHtml() ?>
        <?php endif;?>
    </td><td class="a-center"><?php if ($this->hasProductUrl()):?><a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getProductName()) ?>" class="product-image"><?php endif;?><img src="<?php echo $this->getProductThumbnail()->resize(0); ?>" width="0" height="0" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /><?php if ($this->hasProductUrl()):?></a><?php endif;?></td>
    <td class="a-center">
        <?php if ($isVisibleProduct): ?>
        <a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo $this->__('Edit item parameters') ?>"><?php echo $this->__('Edit') ?></a>
        <?php endif ?>
    </td>
 
Upvote 0

Latest Articles