【发布时间】:2014-07-23 22:36:54
【问题描述】:
这里有没有人在 Magento 的结帐页面的 reivew/info.phtml 模板中遇到过这个奇怪的问题。我在源代码中有 5 个表头标题,即项目、描述、价格、数量和小计:
<thead>
<tr>
<th><?php echo $this->__('Item') ?></th>
<th class="a-center"><?php echo $this->__('Description') ?></th>
<th class="a-center"><?php echo $this->__('Price') ?></th>
<th class="a-center"><?php echo $this->__('Qty') ?></th>
<th class="a-center"><?php echo $this->__('Subtotal') ?></th>
</tr>
</thead>
但是当我查看结帐页面时,第二个 th 消失了。我检查了元素,也许它只是通过 CSS 隐藏了,但事实并非如此。我的结帐产品评论块中只出现了 4 个标题,如屏幕截图所示:http://i.imgur.com/kbEP29Z.png
您可能已经注意到,描述标题不见了。但这里有一个问题,当我将价格移到商品的正下方时,例如:
<thead>
<tr>
<th><?php echo $this->__('Item') ?></th>
<th class="a-center"><?php echo $this->__('Price') ?></th>
<th class="a-center"><?php echo $this->__('Description') ?></th>
<th class="a-center"><?php echo $this->__('Qty') ?></th>
<th class="a-center"><?php echo $this->__('Subtotal') ?></th>
</tr>
</thead>
描述栏会突然出现,价格栏会消失。奇怪,但是,是的,这真的很奇怪。有东西使第二列无法显示,我不知道它是什么。
希望这里的 Magento 专家能告诉我如何显示 review/info.phtml 的第二个 tr 列。
更新:与此同时,我这样做了:
<th><?php echo $this->__('Item') ?></th>
<th></th>
<th class="a-center"><?php echo $this->__('Price') ?></th>
<th class="a-center"><?php echo $this->__('Description') ?></th>
<th class="a-center"><?php echo $this->__('Qty') ?></th>
<th class="a-center"><?php echo $this->__('Subtotal') ?></th>
注意项目后面的空 th。这不会显示在 HTML 输出中,因为它位于第二列(我不知道为什么它没有显示)。现在一切正常。第一、三、四、五、六栏。哈哈哈..奇怪... O__O
【问题讨论】:
-
没关系,我已经在第一个 th 之后又解决了另一个问题。我仍然不知道它没有出现什么,但至少它现在已经解决了。 O_O
-
我最好的客人是查看 decorateTable('checkout-review-table')(您可以在 review/info.phtml 中找到它),看看它是否负责。
-
如果您输出 HTML,您需要对字符串进行 HTML 编码。也许不是您的问题,但您给出的代码示例肯定是错误的。
-
@hakre - 我所做的是在项目后添加一个空白 th。这暂时解决了一切。 O__O
-
@WilliamTran 里面没有 decorateTable,这很奇怪。嗯嗯..