2011-06-22 77 views
2

我們目前有一個報價頁面,其中列出了所有我們想要顯示尋呼機的現有報價。使尋呼機顯示在magento列表上

我們在列表頁面中添加了以下代碼,我們已將呼叫添加到分頁器中,但它似乎沒有顯示前端。

我還添加了歷史頁面,它顯示了一個帶有尋呼機的列表,作爲我們試圖模擬的工作頁面的一個例子。

誰能爲我們指出了正確的方向,我們似乎失去了一些東西

列表

<?php $_quotation = $this->getQuotations();?> 
<?php if($_quotation->getSize()): ?> 
<?php echo $this->getPagerHtml(); ?> 
<table cellspacing="0" class="data-table" id="my-quotations-table"> 
    <thead> 
     <tr> 
      <th class="quote-quote"><?php echo $this->__('Quote #') ?></th> 
      <th class="quote-date"><?php echo $this->__('Creation Date') ?></th> 
      <th class="quote-valid"><?php echo $this->__('Valid until') ?></th> 
      <th class="quote-status"><?php echo $this->__('Status') ?></th> 
      <th class="quote-view-link">&nbsp;</th> 
     </tr> 
    </thead> 
    <tbody> 
     <?php $_odd = ''; ?> 
     <?php foreach ($this->getQuotations() as $_quotation): ?> 
      <?php $_quotation->checkExpirationDateAndApply(); ?> 
      <tr> 
       <td><?php echo $_quotation->getincrement_id() ?></td> 
       <td><?php echo $this->formatDate($_quotation->getcreated_time()) ?></td> 
       <td><?php echo $this->formatDate($_quotation->getValidEndTime()); ?> 
       <td><?php echo $this->__($_quotation->getstatus()); ?></td> 
       <td class="a-center"><?php if ($_quotation->isViewableByCustomer()): ?> 
         <a href="<?php echo $this->getViewUrl($_quotation) ?>"><?php echo $this->__('View Quotation') ?></a> 
         <?php endif; ?> 
       </td> 
      </tr> 
     <?php endforeach; ?> 
    </tbody> 
</table> 
<script type="text/javascript">decorateTable('my-quotations-table')</script> 
<?php echo $this->getPagerHtml(); ?> 
<?php else: ?> 
    <p><?php echo $this->__('You have no quotes available.') ?></p> 
<?php endif ?> 

歷史

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> 
<?php $_orders = $this->getOrders(); ?> 
<div class="pager"><?php echo $this->getPagerHtml(); ?></div> 
<?php if($_orders->getSize()): ?> 
<table class="data-table" id="my-orders-table"> 
    <col width="1" /> 
    <col width="1" /> 
    <col /> 
    <col width="1" /> 
    <col width="1" /> 
    <col width="1" /> 
    <thead> 
     <tr> 
      <th><?php echo $this->__('Order #') ?></th> 
      <th><?php echo $this->__('Date') ?></th> 
      <th><?php echo $this->__('Delivery To') ?></th> 
      <th><span class="nobr"><?php echo $this->__('Order Total') ?></span></th> 
      <th><span class="nobr"><?php echo $this->__('Order Status') ?></span></th> 
      <th>&nbsp;</th> 
     </tr> 
    </thead> 
    <tbody> 
     <?php $_odd = ''; ?> 
     <?php foreach ($_orders as $_order): ?> 
     <tr> 
      <td><?php echo $_order->getRealOrderId() ?></td> 
      <td><span class="nobr"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></span></td> 
      <td><?php echo $_order->getShippingAddress() ? $this->htmlEscape($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td> 
      <td><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td> 
      <td><em><?php echo $_order->getStatusLabel() ?></em></td> 
      <td class="a-center"> 
       <span class="nobr"><a href="<?php echo $this->getViewUrl($_order) ?>"><?php echo $this->__('View Order') ?></a> 
        <?php /*<span class="separator">|</span><a href="<?php echo $this->getTrackUrl($_order) ?>"><?php echo $this->__('Track Order') ?></a>&nbsp;*/ ?> 
        <?php if ($this->helper('sales/reorder')->canReorder($_order)) : ?> 
        <span class="separator">|</span> <a href="<?php echo $this->getReorderUrl($_order) ?>" class="link-reorder"><?php echo $this->__('Reorder') ?></a> 
       <?php endif ?> 
       </span> 
      </td> 
     </tr> 
     <?php endforeach; ?> 
    </tbody> 
</table> 
<script type="text/javascript">decorateTable('my-orders-table');</script> 
<?php echo $this->getPagerHtml(); ?> 
<?php else: ?> 
    <p><?php echo $this->__('You have placed no orders.'); ?></p> 
<?php endif ?> 

佈局塊列表

<quotation_quote_list> 
    <reference name="root"> 
     <action method="setTemplate"><template>page/3columns-account.phtml</template></action> 
    </reference> 
    <update handle="customer_account"/> 
    <reference name="content"> 
      <block type="Quotation/Frontend_Grid" name="quotationslist" as="quotationslist" template="Quotation/List.phtml"/> 
    </reference> 
</quotation_quote_list> 
+0

您可以顯示兩個頁面佈局的更新?好像尋呼機模塊不包含在列表頁面中。 – Zyava

+0

以上更新了列表的佈局塊...看起來像缺少尋呼機。我們應該在這裏添加什麼? –

+0

在哪裏?您還沒有將頁面模塊添加到頁面,爲什麼它應該出現在頁面上? – Zyava

回答

3

我們可以通過在塊類中擴展Mage_Catalog_Block_Product_List類來實現具有magento分頁的自定義模型集合。假設我想用分頁顯示用戶博客文章。下面是實施它的步驟:

  1. 創建一個塊類(posts.php)並在其中添加下面的代碼。

    class Blog_User_Block_Posts extends Mage_Catalog_Block_Product_List 
    { 
        protected function _beforeToHtml() 
        { 
         $toolbar = $this->getToolbarBlock(); 
         $collection = $this->_getPostsCollection(); 
         $toolbar->setCollection($collection);  /*(Add toolbar to collection)*/ 
         return parent::_beforeToHtml(); 
        } 
    } 
    
  2. view.phptml文件中添加下面的代碼在它

    <?php echo $this->getToolbarHtml() ?>