当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Wishlist_Model_Wishlist类代码示例

本文整理汇总了PHP中Mage_Wishlist_Model_Wishlist的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Wishlist_Model_Wishlist类的具体用法?PHP Mage_Wishlist_Model_Wishlist怎么用?PHP Mage_Wishlist_Model_Wishlist使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Mage_Wishlist_Model_Wishlist类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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;
 }
开发者ID:njaeger,项目名称:magento_github,代码行数:14,代码来源:Wishlist.php

示例2: testWishlistAction

 /**
  * @magentoConfigFixture current_store rss/wishlist/active 1
  * @magentoDataFixture Mage/Wishlist/_files/wishlist.php
  * @magentoAppIsolation enabled
  */
 public function testWishlistAction()
 {
     $wishlist = new Mage_Wishlist_Model_Wishlist();
     $wishlist->load('fixture_unique_code', 'sharing_code');
     $this->getRequest()->setParam('wishlist_id', $wishlist->getId())->setParam('data', base64_encode('1'));
     Mage::getSingleton('Mage_Customer_Model_Session')->login('customer@example.com', 'password');
     $this->dispatch('rss/index/wishlist');
     $this->assertContains('<![CDATA[Simple Product]]>', $this->getResponse()->getBody());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:14,代码来源:IndexControllerTest.php

示例3: fetchItemsCount

 public function fetchItemsCount(Mage_Wishlist_Model_Wishlist $wishlist)
 {
     if (is_null($this->_itemsCount)) {
         $collection = $wishlist->getProductCollection()->addStoreFilter();
         Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
         Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($collection);
         $this->_itemsCount = $collection->getSize();
     }
     return $this->_itemsCount;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:10,代码来源:Wishlist.php

示例4: fetchItemsCount

 /**
  * Retrieve wishlist items count
  *
  * @deprecated after 1.6.0.0-rc2
  * @see Mage_Wishlist_Model_Wishlist::getItemsCount()
  *
  * @param Mage_Wishlist_Model_Wishlist $wishlist
  *
  * @return int
  */
 public function fetchItemsCount(Mage_Wishlist_Model_Wishlist $wishlist)
 {
     if (is_null($this->_itemsCount)) {
         $this->_itemsCount = $wishlist->getItemsCount();
     }
     return $this->_itemsCount;
 }
开发者ID:hirentricore,项目名称:devmagento,代码行数:17,代码来源:Wishlist.php

示例5: _getWishlist

 /**
  * Retrieve Wishlist model
  *
  * @return Mage_Wishlist_Model_Wishlist
  */
 protected function _getWishlist()
 {
     if (is_null($this->_wishlist)) {
         if (Mage::registry('shared_wishlist')) {
             $this->_wishlist = Mage::registry('shared_wishlist');
         } elseif (Mage::registry('wishlist')) {
             $this->_wishlist = Mage::registry('wishlist');
         } else {
             $this->_wishlist = Mage::getModel('wishlist/wishlist');
             if ($this->_getCustomerSession()->isLoggedIn()) {
                 $this->_wishlist->loadByCustomer($this->_getCustomerSession()->getCustomer());
             }
         }
     }
     return $this->_wishlist;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:21,代码来源:Abstract.php

示例6: getCustomerWishlist

 /**
  * Retrieve customer wishlist model object
  *
  * @params bool $cacheReload pass cached wishlist object and get new one
  * @return Mage_Wishlist_Model_Wishlist
  */
 public function getCustomerWishlist($cacheReload = false)
 {
     if (!is_null($this->_wishlist) && !$cacheReload) {
         return $this->_wishlist;
     }
     if ($this->getSession()->getCustomer()->getId()) {
         $this->_wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($this->getSession()->getCustomer(), true);
         $this->_wishlist->setStore($this->getSession()->getStore())->setSharedStoreIds($this->getSession()->getStore()->getWebsite()->getStoreIds());
     } else {
         $this->_wishlist = false;
     }
     return $this->_wishlist;
 }
开发者ID:beejhuff,项目名称:magento-1.13.0.2,代码行数:19,代码来源:Create.php

示例7: getCustomerWishlist

 /**
  * Retrieve customer wishlist model object
  *
  * @return Mage_Wishlist_Model_Wishlist
  */
 public function getCustomerWishlist()
 {
     if (!is_null($this->_wishlist)) {
         return $this->_wishlist;
     }
     if ($this->getSession()->getCustomer()->getId()) {
         $this->_wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($this->getSession()->getCustomer(), true);
         $this->_wishlist->setStore($this->getSession()->getStore());
     } else {
         $this->_wishlist = false;
     }
     return $this->_wishlist;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:18,代码来源:Create.php

示例8: _getWishlist

 /**
  * Retrieve Wishlist model
  *
  * @return Mage_Wishlist_Model_Wishlist
  */
 protected function _getWishlist()
 {
     if (is_null($this->_wishlist)) {
         $this->_wishlist = Mage::getModel('wishlist/wishlist');
         $wishlistId = $this->getRequest()->getParam('wishlist_id');
         if ($wishlistId) {
             $this->_wishlist->load($wishlistId);
         } else {
             if ($this->_getCustomer()->getId()) {
                 $this->_wishlist->loadByCustomer($this->_getCustomer());
             }
         }
     }
     return $this->_wishlist;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:20,代码来源:IndexController.php

示例9: getWishlist

 /**
  * Retrieve wishlist by logged in customer
  *
  * @return Mage_Wishlist_Model_Wishlist
  */
 public function getWishlist()
 {
     if (is_null($this->_wishlist)) {
         if (Mage::registry('shared_wishlist')) {
             $this->_wishlist = Mage::registry('shared_wishlist');
         } elseif (Mage::registry('wishlist')) {
             $this->_wishlist = Mage::registry('wishlist');
         } else {
             $this->_wishlist = Mage::getModel('wishlist/wishlist');
             if ($this->getCustomer()) {
                 $this->_wishlist->loadByCustomer($this->getCustomer());
             }
         }
     }
     return $this->_wishlist;
 }
开发者ID:vishalpatel14,项目名称:indiankalaniketan,代码行数:21,代码来源:Data.php

示例10: getWishlistManagementUrl

 /**
  * Build wishlist management page url
  *
  * @param Mage_Wishlist_Model_Wishlist $wishlist
  * @return string
  */
 public function getWishlistManagementUrl(Mage_Wishlist_Model_Wishlist $wishlist)
 {
     return $this->getUrl('wishlist/*/*', array('wishlist_id' => $wishlist->getId()));
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:10,代码来源:Management.php

示例11: _moveItem

 /**
  * Move item to given wishlist.
  * Check whether item belongs to one of customer's wishlists
  *
  * @param Mage_Wishlist_Model_Item $item
  * @param Mage_Wishlist_Model_Wishlist $wishlist
  * @param Mage_Wishlist_Model_Resource_Wishlist_Collection $customerWishlists
  * @param int $qty
  * @throws InvalidArgumentException|DomainException
  */
 protected function _moveItem(Mage_Wishlist_Model_Item $item, Mage_Wishlist_Model_Wishlist $wishlist, Mage_Wishlist_Model_Resource_Wishlist_Collection $customerWishlists, $qty = null)
 {
     if (!$item->getId()) {
         throw new InvalidArgumentException();
     }
     if ($item->getWishlistId() == $wishlist->getId()) {
         throw new DomainException(null, 1);
     }
     if (!$customerWishlists->getItemById($item->getWishlistId())) {
         throw new DomainException(null, 2);
     }
     $buyRequest = $item->getBuyRequest();
     if ($qty) {
         $buyRequest->setQty($qty);
     }
     $wishlist->addNewItem($item->getProduct(), $buyRequest);
     $qtyDiff = $item->getQty() - $qty;
     if ($qty && $qtyDiff > 0) {
         $item->setQty($qtyDiff);
         $item->save();
     } else {
         $item->delete();
     }
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:34,代码来源:IndexController.php

示例12: addWishlistFilter

 /**
  * Add filter by wishlist object
  *
  * @param Mage_Wishlist_Model_Wishlist $wishlist
  * @return Mage_Wishlist_Model_Resource_Item_Collection
  */
 public function addWishlistFilter(Mage_Wishlist_Model_Wishlist $wishlist)
 {
     $this->addFieldToFilter('wishlist_id', $wishlist->getId());
     return $this;
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:11,代码来源:Collection.php

示例13: _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;
 }
开发者ID:bevello,项目名称:bevello,代码行数:38,代码来源:Filter.php

示例14: addWishlistFilter

 public function addWishlistFilter(Mage_Wishlist_Model_Wishlist $wishlist)
 {
     $this->_joinFields['e_id'] = array('table' => 'e', 'field' => 'entity_id');
     $this->joinTable('wishlist/item', 'product_id=e_id', array('product_id' => 'product_id', 'wishlist_item_description' => 'description', 'store_id' => 'store_id', 'added_at' => 'added_at', 'wishlist_id' => 'wishlist_id', 'wishlist_item_id' => 'wishlist_item_id'), array('wishlist_id' => $wishlist->getId()));
     return $this;
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:6,代码来源:Collection.php

示例15: _getCustomerId

 /**
  * Get Customer ID from Quote/Wishlist
  *
  * @param int                          $ruleId
  * @param Mage_Sales_Model_Quote       $quote
  * @param Mage_Wishlist_Model_Wishlist $wishlist
  *
  * @return int
  */
 protected function _getCustomerId($ruleId, $quote, $wishlist)
 {
     if (!$ruleId || !$quote && !$wishlist) {
         return 0;
     }
     if ($quote) {
         return $quote->getCustomerId() ? $quote->getCustomerId() : 0;
     }
     if ($wishlist) {
         return $wishlist->getCustomerId() ? $wishlist->getCustomerId() : 0;
     }
     return 0;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:22,代码来源:LoadController.php


注:本文中的Mage_Wishlist_Model_Wishlist类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。