• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mage_Wishlist_Model_Item类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: loadByProductWishlist

 public function loadByProductWishlist(Mage_Wishlist_Model_Item $item, $wishlistId, $productId, array $sharedStores)
 {
     $select = $this->_getReadAdapter()->select()->from(array('main_table' => $this->getTable('item')))->where('main_table.wishlist_id = ?', $wishlistId)->where('main_table.product_id = ?', $productId)->where('main_table.store_id in (?)', $sharedStores);
     if ($_data = $this->_getReadAdapter()->fetchRow($select)) {
         $item->setData($_data);
     }
     return $item;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:8,代码来源:Item.php


示例2: loadByProductWishlist

 /**
  * Load item by wishlist, product and shared stores
  *
  * @param Mage_Wishlist_Model_Item $object
  * @param int $wishlistId
  * @param int $productId
  * @param array $sharedStores
  * @return Mage_Wishlist_Model_Mysql4_Item
  */
 public function loadByProductWishlist($object, $wishlistId, $productId, $sharedStores)
 {
     $adapter = $this->_getReadAdapter();
     $select = $adapter->select()->from($this->getMainTable())->where('wishlist_id=?', $wishlistId)->where('product_id=?', $productId)->where('store_id IN(?)', $sharedStores);
     $data = $adapter->fetchRow($select);
     if ($data) {
         $object->setData($data);
     }
     $this->_afterLoad($object);
     return $this;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:20,代码来源:Item.php


示例3: loadByProductWishlist

 /**
  * Load item by wishlist, product and shared stores
  *
  * @param Mage_Wishlist_Model_Item $object
  * @param int $wishlistId
  * @param int $productId
  * @param array $sharedStores
  * @return Mage_Wishlist_Model_Resource_Item
  */
 public function loadByProductWishlist($object, $wishlistId, $productId, $sharedStores)
 {
     $adapter = $this->_getReadAdapter();
     $storeWhere = $adapter->quoteInto('store_id IN (?)', $sharedStores);
     $select = $adapter->select()->from($this->getMainTable())->where('wishlist_id=:wishlist_id AND ' . 'product_id=:product_id AND ' . $storeWhere);
     $bind = array('wishlist_id' => $wishlistId, 'product_id' => $productId);
     $data = $adapter->fetchRow($select, $bind);
     if ($data) {
         $object->setData($data);
     }
     $this->_afterLoad($object);
     return $this;
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:22,代码来源:Item.php


示例4: setItem

 /**
  * Set quote item
  *
  * @param   Mage_Wishlist_Model_Item $item
  * @return  Mage_Wishlist_Model_Item_Option
  */
 public function setItem($item)
 {
     $this->setWishlistItemId($item->getId());
     $this->_item = $item;
     return $this;
 }
开发者ID:okite11,项目名称:frames21,代码行数:12,代码来源:Option.php


示例5: 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


示例6: addItem

 /**
  * Adding item to wishlist
  *
  * @param   Mage_Wishlist_Model_Item $item
  * @return  Mage_Wishlist_Model_Wishlist
  */
 public function addItem(Mage_Wishlist_Model_Item $item)
 {
     $item->setWishlist($this);
     if (!$item->getId()) {
         $this->getItemCollection()->addItem($item);
         Mage::dispatchEvent('wishlist_add_item', array('item' => $item));
     }
     return $this;
 }
开发者ID:njaeger,项目名称:magento_github,代码行数:15,代码来源:Wishlist.php


示例7: getAddToCartQty

 /**
  * Returns qty to show visually to user
  *
  * @param Mage_Wishlist_Model_Item $item
  * @return float
  */
 public function getAddToCartQty(Mage_Wishlist_Model_Item $item)
 {
     $qty = $item->getQty();
     return $qty ? $qty : 1;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:11,代码来源:Cart.php


示例8: 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


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


示例10: getAddToCartUrlBase64

 /**
  * Retrieve url for adding item to shoping cart with b64 referer
  *
  * @param   Mage_Wishlist_Model_Item $item
  * @return  string
  */
 public function getAddToCartUrlBase64($item)
 {
     return $this->_getUrl('wishlist/index/cart', array('item' => $item->getWishlistItemId(), Mage_Core_Controller_Front_Action::PARAM_NAME_BASE64_URL => AO::helper('core')->urlEncode($this->_getUrl('*/*/*', array('_current' => true)))));
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:10,代码来源:Data.php


示例11: getAddUrlWithParams

 /**
  * Retrieve url for adding product to wishlist with params
  *
  * @param Mage_Catalog_Model_Product|Mage_Wishlist_Model_Item $item
  * @param array $params
  *
  * @return  string|bool
  */
 public function getAddUrlWithParams($item, array $params = array())
 {
     $productId = null;
     if ($item instanceof Mage_Catalog_Model_Product) {
         $productId = $item->getEntityId();
     }
     if ($item instanceof Mage_Wishlist_Model_Item) {
         $productId = $item->getProductId();
     }
     if ($productId) {
         $params['product'] = $productId;
         return $this->_getUrlStore($item)->getUrl('wishlist/index/add', $params);
     }
     return false;
 }
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:23,代码来源:Data.php


示例12: getConfigureUrl

 /**
  * Retrieve URL for removing item from wishlist
  *
  * @param Mage_Catalog_Model_Product|Mage_Wishlist_Model_Item $item
  * @return string
  */
 public function getConfigureUrl($item)
 {
     return $this->_getUrl('wishlist/index/configure', array('item' => $item->getWishlistItemId()));
 }
开发者ID:votanlean,项目名称:Magento-Pruebas,代码行数:10,代码来源:Data.php


示例13: getRemoveUrl

 /**
  * Retrieve URL for removing item from wishlist
  *
  * @param Mage_Catalog_Model_Product|Mage_Wishlist_Model_Item $item
  * @return string
  */
 public function getRemoveUrl($item)
 {
     return $this->_getUrl('wishlist/index/remove', array('item' => $item->getWishlistItemId()));
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:10,代码来源:Data.php


示例14: getAddToCartUrl

 /**
  * Retrieve url for adding item to shoping cart
  *
  * @param   Mage_Wishlist_Model_Item $item
  * @return  string
  */
 public function getAddToCartUrl($item)
 {
     return $this->_getUrl('wishlist/index/cart', array('item' => $item->getWishlistItemId()));
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:10,代码来源:Data.php


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


示例16: getAddUrlWithParams

 /**
  * Retrieve url for adding product to wishlist with params
  *
  * @param Mage_Catalog_Model_Product|Mage_Wishlist_Model_Item $item
  * @param array $params
  *
  * @return  string|bool
  */
 public function getAddUrlWithParams($item, array $params = array())
 {
     $productId = null;
     if ($item instanceof Mage_Catalog_Model_Product) {
         $productId = $item->getEntityId();
     }
     if ($item instanceof Mage_Wishlist_Model_Item) {
         $productId = $item->getProductId();
     }
     if ($productId) {
         $params['product'] = $productId;
         $params[Mage_Core_Model_Url::FORM_KEY] = $this->_getSingletonModel('core/session')->getFormKey();
         return $this->_getUrlStore($item)->getUrl('wishlist/index/add', $params);
     }
     return false;
 }
开发者ID:vishalpatel14,项目名称:indiankalaniketan,代码行数:24,代码来源:Data.php


示例17: 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


示例18: representProduct

 public function representProduct($product)
 {
     return $product->getWebtoprintTemplate() ? false : parent::representProduct($product);
 }
开发者ID:james-hickman-arc,项目名称:magento-w2p,代码行数:4,代码来源:Item.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Mage_Wishlist_Model_Wishlist类代码示例发布时间:2022-05-23
下一篇:
PHP Mage_Wishlist_Block_Abstract类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap