2011-08-09 12 views

Respuesta

5

danny (OP) Ya he respondido la pregunta.

Cita:


Ok, he encontrado la solución here pero lo voy a publicar aquí también la lista de los mejores destacando: Crear un nuevo modulo y sobrescribir el bloque se encuentra en la lista de deseos: * * código/core/Mago/Lista/Bloquear/cliente/Wishlist.php ** y añadir lo siguiente a su Wishlist.php

class Company_Wishlist_Block_Customer_Wishlist extends Mage_Wishlist_Block_Customer_Wishlist 
{ 
    protected function _prepareLayout() 
    { 
     parent::_prepareLayout(); 
     $pager = $this->getLayout() 
         ->createBlock('page/html_pager', 'wishlist.customer.pager') 
         ->setCollection($this->getWishlist()); 
     $this->setChild('pager', $pager); 
     $this->getWishlist()->load(); 
     return $this; 
    } 
    public function getPagerHtml() 
    { 
     return $this->getChildHtml('pager'); 
    } 
} 

añadir ahora <?php echo $this->getPagerHtml(); ?> al inicio y/o final de la view.phtml ubicado en: app/design/frontend/default/your_theme/template/wishlist/view.phtml. Eso debería hacer el truco.


Nota: Es absolutamente OK to self-answer su propia pregunta. Por favor, simplemente publíquelo como una respuesta real, pero no en una pregunta o comentario. Publicar como respuesta real ayuda a mantener la lista "sin respuesta" más clara (evita que otras personas pierdan el tiempo).

+0

@Thelen: esto no funciona en magento 1.5.1.0 – Gowri

+0

@gowri hey gowri, esto funciona para mí en magento 1.5.1.0 sin problemas, ¿qué errores obtienes? – tecmec

+0

@danny: tienes razón Denny funciona para mí – Gowri

0

no necesita crear un nuevo módulo. Simplemente cree (con la carpeta) en su local: app \ code \ local \ Mage \ Wishlist \ Block \ Customer \ Wishlist.php.
y escriba el siguiente código en Wishlist.php

<?php class Mage_Wishlist_Block_Customer_Wishlist extends Mage_Wishlist_Block_Abstract { 
/** 
* Preparing global layout 
* 
* @return Mage_Wishlist_Block_Customer_Wishlist 
*/ 
protected function _prepareLayout() 
{ 
    parent::_prepareLayout(); 
    $pager = $this->getLayout()->createBlock('page/html_pager', 'wishlist.customer.pager'); 
    $pager->setAvailableLimit(array(5=>5,10=>10,20=>20,'all'=>'all')); 
    $pager->setCollection($this->getWishlist()); 
    $this->setChild('pager', $pager); 
    $this->getWishlist()->load(); 
    return $this; 
} 

/** 
* Pager HTML 
* 
* @return HTML 
*/ 
public function getPagerHtml() 
{ 
    return $this->getChildHtml('pager'); 
} 

}

Después que añadir siguiente código en/app/design/frontend/base/default/template/deseos/vista. phtml

<?php echo $this->getPagerHtml(); ?> 

después div título y después formkey en final de view.phtml : image example

probado en Magento ver. 1.9.0.1

Cuestiones relacionadas