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


PHP Mage_Wishlist_Model_Item::getProduct方法代码示例

本文整理汇总了PHP中Mage_Wishlist_Model_Item::getProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Wishlist_Model_Item::getProduct方法的具体用法?PHP Mage_Wishlist_Model_Item::getProduct怎么用?PHP Mage_Wishlist_Model_Item::getProduct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Wishlist_Model_Item的用法示例。


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

示例1: _getUrlStore

 /**
  * Retrieve Item Store for URL
  *
  * @param Mage_Catalog_Model_Product|Mage_Wishlist_Model_Item $item
  * @return Mage_Core_Model_Store
  */
 protected function _getUrlStore($item)
 {
     $storeId = null;
     $product = null;
     if ($item instanceof Mage_Wishlist_Model_Item) {
         $product = $item->getProduct();
     } elseif ($item instanceof Mage_Catalog_Model_Product) {
         $product = $item;
     }
     if ($product) {
         if ($product->isVisibleInSiteVisibility()) {
             $storeId = $product->getStoreId();
         } else {
             if ($product->hasUrlDataObject()) {
                 $storeId = $product->getUrlDataObject()->getStoreId();
             }
         }
     }
     return Mage::app()->getStore($storeId);
 }
开发者ID:vishalpatel14,项目名称:indiankalaniketan,代码行数:26,代码来源:Data.php

示例2: _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

示例3: getProductId

 /**
  * Retrieve product identifier linked with item
  *
  * @param   Mage_Wishlist_Model_Item $item
  * @return  int
  */
 public function getProductId($item)
 {
     return $item->getProduct()->getId();
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:10,代码来源:Wishlist.php

示例4: getDetailsHtml

 /**
  * Returns html for showing item options
  *
  * @deprecated after 1.6.2.0
  * @param Mage_Wishlist_Model_Item $item
  * @return string
  */
 public function getDetailsHtml(Mage_Wishlist_Model_Item $item)
 {
     $cfg = $this->getOptionsRenderCfg($item->getProduct()->getTypeId());
     if (!$cfg) {
         return '';
     }
     $helper = Mage::helper($cfg['helper']);
     if (!$helper instanceof Mage_Catalog_Helper_Product_Configuration_Interface) {
         Mage::throwException($this->__("Helper for wishlist options rendering doesn't implement required interface."));
     }
     $block = $this->getChild('item_options');
     if (!$block) {
         return '';
     }
     if ($cfg['template']) {
         $template = $cfg['template'];
     } else {
         $cfgDefault = $this->getOptionsRenderCfg('default');
         if (!$cfgDefault) {
             return '';
         }
         $template = $cfgDefault['template'];
     }
     return $block->setTemplate($template)->setOptionList($helper->getOptions($item))->toHtml();
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:32,代码来源:Wishlist.php

示例5: getProductUrl

 /**
  * Retrieve URL to item Product
  *
  * @param  Mage_Wishlist_Model_Item|Mage_Catalog_Model_Product $item
  * @param  array $additional
  * @return string
  */
 public function getProductUrl($item, $additional = array())
 {
     if ($item instanceof Mage_Catalog_Model_Product) {
         $product = $item;
     } else {
         $product = $item->getProduct();
     }
     $buyRequest = $item->getBuyRequest();
     if (is_object($buyRequest)) {
         $config = $buyRequest->getSuperProductConfig();
         if ($config && !empty($config['product_id'])) {
             $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getStoreId())->load($config['product_id']);
         }
     }
     return parent::getProductUrl($product, $additional);
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:23,代码来源:Abstract.php

示例6: _getWishlistItemUrl

 /**
  * @param Mage_Wishlist_Model_Item $item
  *
  * @return string
  */
 protected function _getWishlistItemUrl(Mage_Wishlist_Model_Item $item)
 {
     if ($item->getRedirectUrl()) {
         return $item->getRedirectUrl();
     }
     return $this->_getProductUrl($item->getProduct());
 }
开发者ID:bevello,项目名称:bevello,代码行数:12,代码来源:Filter.php


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