本文整理汇总了PHP中Mage_Wishlist_Model_Wishlist::getItemCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Wishlist_Model_Wishlist::getItemCollection方法的具体用法?PHP Mage_Wishlist_Model_Wishlist::getItemCollection怎么用?PHP Mage_Wishlist_Model_Wishlist::getItemCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Wishlist_Model_Wishlist
的用法示例。
在下文中一共展示了Mage_Wishlist_Model_Wishlist::getItemCollection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWishlist
public function getWishlist()
{
if (!$this->_wishlist) {
$this->_wishlist = AO::getModel('wishlist/wishlist')->loadByCustomer(AO::getSingleton('customer/session')->getCustomer());
$this->_wishlist->getItemCollection()->addAttributeToSelect('name')->addAttributeToSelect('price')->addAttributeToSelect('small_image')->addAttributeToFilter('store_id', array('in' => $this->_wishlist->getSharedStoreIds()))->addAttributeToSort('added_at', 'desc')->setCurPage(1)->setPageSize(3)->load();
}
return $this->_wishlist->getItemCollection();
}
示例2: fetchItemsCount
/**
* Fetch items count
*
* @param Mage_Wishlist_Model_Wishlist $wishlist
* @return int
*/
public function fetchItemsCount(Mage_Wishlist_Model_Wishlist $wishlist)
{
if (is_null($this->_itemsCount)) {
$collection = $wishlist->getItemCollection()->addStoreFilter()->setVisibilityFilter();
$this->_itemsCount = $collection->getSize();
}
return $this->_itemsCount;
}
示例3: getWishlistItemCount
/**
* Retrieve number of wishlist items in given wishlist
*
* @param Mage_Wishlist_Model_Wishlist $wishlist
* @return int
*/
public function getWishlistItemCount(Mage_Wishlist_Model_Wishlist $wishlist)
{
$collection = $wishlist->getItemCollection();
if (Mage::getStoreConfig(self::XML_PATH_WISHLIST_LINK_USE_QTY)) {
$count = $collection->getItemsQty();
} else {
$count = $collection->getSize();
}
return $count;
}
示例4: _filterWishlist
/**
* @param Mage_Wishlist_Model_Wishlist $wishlist
*
* @return Bronto_Common_Model_Email_Template_Filter
*/
protected function _filterWishlist(Mage_Wishlist_Model_Wishlist $wishlist)
{
if (!in_array('wishlist', $this->_filteredObjects)) {
$index = 1;
foreach ($wishlist->getItemCollection() as $item) {
if (!$item->getParentItem()) {
$this->_filterWishlistItem($item, $index);
$index++;
}
}
// Add Related Content
$this->_items = $wishlist->getItemCollection();
$queryParams = $this->getQueryParams();
$queryParams['wishlist_id'] = urlencode(base64_encode(Mage::helper('core')->encrypt($wishlist->getId())));
if ($store = $this->getStore()) {
$this->setField('wishlistURL', $store->getUrl('reminder/load/index', $queryParams));
} else {
$this->setField('wishlistURL', Mage::getUrl('reminder/load/index', $queryParams));
}
// Setup wishlist items as a template
if (class_exists('Bronto_Reminder_Block_Wishlist_Items', false)) {
$layout = Mage::getSingleton('core/layout');
/* @var $items Mage_Sales_Block_Items_Abstract */
$items = $layout->createBlock('bronto/bronto_reminder_wishlist_items', 'items');
$items->setTemplate('bronto/reminder/items.phtml');
$items->setWishlist($item->getWishlist());
$this->_respectDesignTheme();
$this->setField("wishlistItems", $items->toHtml());
}
$this->_filteredObjects[] = 'wishlist';
}
return $this;
}