本文整理汇总了PHP中Mage_Wishlist_Model_Wishlist类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Wishlist_Model_Wishlist类的具体用法?PHP Mage_Wishlist_Model_Wishlist怎么用?PHP Mage_Wishlist_Model_Wishlist使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Wishlist_Model_Wishlist类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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('[email protected]', '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
示例16: getWishlistLink
/**
* Return frontend registry link
*
* @param Mage_Wishlist_Model_Wishlist $item
* @return string
*/
public function getWishlistLink(Mage_Wishlist_Model_Wishlist $item)
{
return $this->getUrl('*/search/view', array('wishlist_id' => $item->getId()));
}
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:10,代码来源:Results.php
示例17: 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;
}
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:16,代码来源:Data.php
示例18: fetchItemsCount
public function fetchItemsCount(Mage_Wishlist_Model_Wishlist $wishlist)
{
$read = $this->_getReadAdapter();
$select = $read->select()->from($this->getTable('wishlist/item'), 'count(*)')->where('wishlist_id=?', $wishlist->getId())->where('store_id in (?)', $wishlist->getSharedStoreIds());
return $read->fetchOne($select);
}
开发者ID:arslbbt,项目名称:mangentovies,代码行数:6,代码来源:Wishlist.php
示例19: Mage_Wishlist_Model_Wishlist
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
* @package Mage_Wishlist
* @subpackage integration_tests
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
require __DIR__ . '/../../Customer/_files/customer.php';
require __DIR__ . '/../../Catalog/_files/product_simple.php';
$wishlist = new Mage_Wishlist_Model_Wishlist();
$wishlist->loadByCustomer($customer->getId(), true);
$item = $wishlist->addNewItem($product, new Varien_Object(array()));
$wishlist->setSharingCode('fixture_unique_code')->save();
开发者ID:nemphys,项目名称:magento2,代码行数:31,代码来源:wishlist.php
示例20: 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();
}
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:8,代码来源:Account_Dashboard_Sidebar.php
注:本文中的Mage_Wishlist_Model_Wishlist类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论