在愿望清单 magento 1.9 中显示日期

show date in wishlist magento 1.9

我想在 magento 1.9 中显示 日期 项目添加到心愿单的位置。

我在 xml 找到这个区块,价格

   <block type="wishlist/customer_wishlist_item_column_cart" name="customer.wishlist.item.price" template="wishlist/item/column/price.phtml">
                    <action method="setTitle" translate="title">
                        <title>Price</title>
                    </action>
                    <block type="wishlist/customer_wishlist_item_options" name="customer.wishlist.item.options" />
                </block>

我想在心愿单价格后显示日期。

只需三个简单的步骤即可完成:

  1. 将此 xml 添加到您的 local.xml

    <wishlist_index_index translate="label">
     <reference name="customer.wishlist.items">
            <block type="wishlist/customer_wishlist_item_column_cart" name="customer.wishlist.item.date" after="customer.wishlist.item.price" template="wishlist/item/date.phtml">
                    <action method="setTitle" translate="title">
                        <title>Date</title>
                    </action>
                    <block type="wishlist/customer_wishlist_item_options" name="customer.wishlist.item.options" />
            </block>
     </reference>
    

  2. 在模板文件夹中添加 date.phtml 文件 wishlist/item/date.phtml

  3. 将此代码粘贴到 date.phtml 文件中

    $item = $this->getItem();
     $product = $item->getProduct();
    $options = $this->getChild('customer.wishlist.item.options')
    ->setItem($item)
    ->getConfiguredOptions();
    ?>
    <div class="cart-cell">    
          <?php echo $this->getItem()->getAddedAt();?>
        </div>
    

你已经完成了。