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

PHP Helper\Data类代码示例

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

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



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

示例1: execute

 /**
  * Check move quote item to wishlist request
  *
  * @param   Observer $observer
  * @return  $this
  */
 public function execute(Observer $observer)
 {
     $cart = $observer->getEvent()->getCart();
     $data = $observer->getEvent()->getInfo()->toArray();
     $productIds = [];
     $wishlist = $this->getWishlist($cart->getQuote()->getCustomerId());
     if (!$wishlist) {
         return $this;
     }
     /**
      * Collect product ids marked for move to wishlist
      */
     foreach ($data as $itemId => $itemInfo) {
         if (!empty($itemInfo['wishlist']) && ($item = $cart->getQuote()->getItemById($itemId))) {
             $productId = $item->getProductId();
             $buyRequest = $item->getBuyRequest();
             if (array_key_exists('qty', $itemInfo) && is_numeric($itemInfo['qty'])) {
                 $buyRequest->setQty($itemInfo['qty']);
             }
             $wishlist->addNewItem($productId, $buyRequest);
             $productIds[] = $productId;
             $cart->getQuote()->removeItem($itemId);
         }
     }
     if (count($productIds)) {
         $wishlist->save();
         $this->wishlistData->calculate();
     }
     return $this;
 }
开发者ID:IlyaGluschenko,项目名称:protection,代码行数:36,代码来源:CartUpdateBefore.php


示例2: testExecute

 /**
  *
  * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  */
 public function testExecute()
 {
     $customerId = 1;
     $itemId = 5;
     $itemQty = 123;
     $productId = 321;
     $eventObserver = $this->getMockBuilder('Magento\\Framework\\Event\\Observer')->disableOriginalConstructor()->getMock();
     $event = $this->getMockBuilder('Magento\\Framework\\Event')->setMethods(['getCart', 'getInfo'])->disableOriginalConstructor()->getMock();
     $eventObserver->expects($this->exactly(2))->method('getEvent')->willReturn($event);
     $quoteItem = $this->getMockBuilder('Magento\\Quote\\Model\\Quote\\Item')->setMethods(['getProductId', 'getBuyRequest', '__wakeup'])->disableOriginalConstructor()->getMock();
     $buyRequest = $this->getMockBuilder('Magento\\Framework\\DataObject')->setMethods(['setQty'])->disableOriginalConstructor()->getMock();
     $infoData = $this->getMockBuilder('Magento\\Framework\\DataObject')->setMethods(['toArray'])->disableOriginalConstructor()->getMock();
     $infoData->expects($this->once())->method('toArray')->willReturn([$itemId => ['qty' => $itemQty, 'wishlist' => true]]);
     $cart = $this->getMockBuilder('Magento\\Checkout\\Model\\Cart')->disableOriginalConstructor()->getMock();
     $quote = $this->getMockBuilder('Magento\\Quote\\Model\\Quote')->setMethods(['getCustomerId', 'getItemById', 'removeItem', '__wakeup'])->disableOriginalConstructor()->getMock();
     $event->expects($this->once())->method('getCart')->willReturn($cart);
     $event->expects($this->once())->method('getInfo')->willReturn($infoData);
     $cart->expects($this->any())->method('getQuote')->willReturn($quote);
     $quoteItem->expects($this->once())->method('getProductId')->willReturn($productId);
     $quoteItem->expects($this->once())->method('getBuyRequest')->willReturn($buyRequest);
     $buyRequest->expects($this->once())->method('setQty')->with($itemQty)->willReturnSelf();
     $quote->expects($this->once())->method('getCustomerId')->willReturn($customerId);
     $quote->expects($this->once())->method('getItemById')->with($itemId)->willReturn($quoteItem);
     $quote->expects($this->once())->method('removeItem')->with($itemId);
     $this->wishlist->expects($this->once())->method('loadByCustomerId')->with($this->logicalOr($customerId, true))->willReturnSelf();
     $this->wishlist->expects($this->once())->method('addNewItem')->with($this->logicalOr($productId, $buyRequest));
     $this->wishlist->expects($this->once())->method('save');
     $this->helper->expects($this->once())->method('calculate');
     /** @var $eventObserver \Magento\Framework\Event\Observer */
     $this->assertSame($this->observer, $this->observer->execute($eventObserver));
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:35,代码来源:CartUpdateBeforeTest.php


示例3: testGetSharedAddAllToCartUrl

 public function testGetSharedAddAllToCartUrl()
 {
     $url = 'result url';
     $this->store->expects($this->once())->method('getUrl')->with('*/*/allcart', ['_current' => true])->willReturn($url);
     $this->postDataHelper->expects($this->once())->method('getPostData')->with($url)->willReturn($url);
     $this->assertEquals($url, $this->model->getSharedAddAllToCartUrl());
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:7,代码来源:DataTest.php


示例4: getName

 /**
  * Retrieve wishlist name
  *
  * @return string
  */
 public function getName()
 {
     $name = $this->_getData('name');
     if (!strlen($name)) {
         return $this->_wishlistData->getDefaultWishlistName();
     }
     return $name;
 }
开发者ID:pavelnovitsky,项目名称:magento2,代码行数:13,代码来源:Wishlist.php


示例5: _prepareLayout

 /**
  * Configure product view blocks
  *
  * @return $this
  */
 protected function _prepareLayout()
 {
     // Set custom add to cart url
     $block = $this->getLayout()->getBlock('product.info');
     if ($block && $this->getWishlistItem()) {
         $url = $this->_wishlistData->getAddToCartUrl($this->getWishlistItem());
         $block->setCustomAddToCartUrl($url);
     }
     return parent::_prepareLayout();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:15,代码来源:Configure.php


示例6: setUp

 protected function setUp()
 {
     $wishlist = $this->getMock('Magento\\Wishlist\\Model\\Wishlist', ['getId', 'getSharingCode'], [], '', false);
     $wishlist->expects($this->any())->method('getId')->will($this->returnValue(5));
     $wishlist->expects($this->any())->method('getSharingCode')->will($this->returnValue('somesharingcode'));
     $customer = $this->getMock('Magento\\Customer\\Api\\Data\\CustomerInterface', [], [], '', false);
     $customer->expects($this->any())->method('getId')->will($this->returnValue(8));
     $customer->expects($this->any())->method('getEmail')->will($this->returnValue('[email protected]'));
     $this->wishlistHelper = $this->getMock('Magento\\Wishlist\\Helper\\Data', ['getWishlist', 'getCustomer', 'urlEncode'], [], '', false);
     $this->urlEncoder = $this->getMock('Magento\\Framework\\Url\\EncoderInterface', ['encode'], [], '', false);
     $this->wishlistHelper->expects($this->any())->method('getWishlist')->will($this->returnValue($wishlist));
     $this->wishlistHelper->expects($this->any())->method('getCustomer')->will($this->returnValue($customer));
     $this->urlEncoder->expects($this->any())->method('encode')->willReturnCallback(function ($url) {
         return strtr(base64_encode($url), '+/=', '-_,');
     });
     $this->urlBuilder = $this->getMock('Magento\\Framework\\App\\Rss\\UrlBuilderInterface');
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->link = $this->objectManagerHelper->getObject('Magento\\Wishlist\\Block\\Rss\\EmailLink', ['wishlistHelper' => $this->wishlistHelper, 'rssUrlBuilder' => $this->urlBuilder, 'urlEncoder' => $this->urlEncoder]);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:19,代码来源:EmailLinkTest.php


示例7: testGetSectionDataWithoutItems

 public function testGetSectionDataWithoutItems()
 {
     $items = [];
     $result = ['counter' => null, 'items' => []];
     $this->wishlistHelperMock->expects($this->once())->method('getItemCount')->willReturn(count($items));
     $this->viewMock->expects($this->never())->method('loadLayout');
     $this->wishlistHelperMock->expects($this->never())->method('getWishlistItemCollection');
     $this->catalogImageHelperMock->expects($this->never())->method('init');
     $this->catalogImageHelperMock->expects($this->never())->method('getUrl');
     $this->catalogImageHelperMock->expects($this->never())->method('getLabel');
     $this->catalogImageHelperMock->expects($this->never())->method('getWidth');
     $this->catalogImageHelperMock->expects($this->never())->method('getHeight');
     $this->wishlistHelperMock->expects($this->never())->method('getProductUrl');
     $this->sidebarMock->expects($this->never())->method('getProductPriceHtml');
     $this->wishlistHelperMock->expects($this->never())->method('getAddToCartParams');
     $this->wishlistHelperMock->expects($this->never())->method('getRemoveParams');
     $this->assertEquals($result, $this->model->getSectionData());
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:18,代码来源:WishlistTest.php


示例8: testExecuteWithoutQuantityArrayAndConfigurable

 /**
  * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  */
 public function testExecuteWithoutQuantityArrayAndConfigurable()
 {
     $itemId = 2;
     $wishlistId = 1;
     $qty = [];
     $productId = 4;
     $indexUrl = 'index_url';
     $configureUrl = 'configure_url';
     $options = [5 => 'option'];
     $params = ['item' => $itemId, 'qty' => $qty];
     $this->formKeyValidator->expects($this->once())->method('validate')->with($this->requestMock)->willReturn(true);
     $itemMock = $this->getMockBuilder('Magento\\Wishlist\\Model\\Item')->disableOriginalConstructor()->setMethods(['load', 'getId', 'getWishlistId', 'setQty', 'setOptions', 'getBuyRequest', 'mergeBuyRequest', 'addToCart', 'getProduct', 'getProductId'])->getMock();
     $this->requestMock->expects($this->at(0))->method('getParam')->with('item', null)->willReturn($itemId);
     $this->itemFactoryMock->expects($this->once())->method('create')->willReturn($itemMock);
     $itemMock->expects($this->once())->method('load')->with($itemId, null)->willReturnSelf();
     $itemMock->expects($this->exactly(2))->method('getId')->willReturn($itemId);
     $itemMock->expects($this->once())->method('getWishlistId')->willReturn($wishlistId);
     $wishlistMock = $this->getMockBuilder('Magento\\Wishlist\\Model\\Wishlist')->disableOriginalConstructor()->getMock();
     $this->wishlistProviderMock->expects($this->once())->method('getWishlist')->with($wishlistId)->willReturn($wishlistMock);
     $this->requestMock->expects($this->at(1))->method('getParam')->with('qty', null)->willReturn($qty);
     $this->quantityProcessorMock->expects($this->once())->method('process')->with(1)->willReturnArgument(0);
     $itemMock->expects($this->once())->method('setQty')->with(1)->willReturnSelf();
     $this->urlMock->expects($this->at(0))->method('getUrl')->with('*/*', null)->willReturn($indexUrl);
     $itemMock->expects($this->once())->method('getProductId')->willReturn($productId);
     $this->urlMock->expects($this->at(1))->method('getUrl')->with('*/*/configure/', ['id' => $itemId, 'product_id' => $productId])->willReturn($configureUrl);
     $optionMock = $this->getMockBuilder('Magento\\Wishlist\\Model\\Item\\Option')->disableOriginalConstructor()->getMock();
     $this->optionFactoryMock->expects($this->once())->method('create')->willReturn($optionMock);
     $optionsMock = $this->getMockBuilder('Magento\\Wishlist\\Model\\ResourceModel\\Item\\Option\\Collection')->disableOriginalConstructor()->getMock();
     $optionMock->expects($this->once())->method('getCollection')->willReturn($optionsMock);
     $optionsMock->expects($this->once())->method('addItemFilter')->with([$itemId])->willReturnSelf();
     $optionsMock->expects($this->once())->method('getOptionsByItem')->with($itemId)->willReturn($options);
     $itemMock->expects($this->once())->method('setOptions')->with($options)->willReturnSelf();
     $this->requestMock->expects($this->once())->method('getParams')->willReturn($params);
     $buyRequestMock = $this->getMockBuilder('Magento\\Framework\\DataObject')->disableOriginalConstructor()->getMock();
     $itemMock->expects($this->once())->method('getBuyRequest')->willReturn($buyRequestMock);
     $this->productHelperMock->expects($this->once())->method('addParamsToBuyRequest')->with($params, ['current_config' => $buyRequestMock])->willReturn($buyRequestMock);
     $itemMock->expects($this->once())->method('mergeBuyRequest')->with($buyRequestMock)->willReturnSelf();
     $itemMock->expects($this->once())->method('addToCart')->with($this->checkoutCartMock, true)->willThrowException(new \Magento\Framework\Exception\LocalizedException(__('message')));
     $this->messageManagerMock->expects($this->once())->method('addNotice')->with('message', null)->willReturnSelf();
     $this->helperMock->expects($this->once())->method('calculate')->willReturnSelf();
     $this->resultRedirectMock->expects($this->once())->method('setUrl')->with($configureUrl)->willReturnSelf();
     $this->assertSame($this->resultRedirectMock, $this->model->execute());
 }
开发者ID:hientruong90,项目名称:magento2_installer,代码行数:46,代码来源:CartTest.php


示例9: execute

 /**
  * @param Observer $observer
  * @return void
  */
 public function execute(Observer $observer)
 {
     $this->wishlistData->calculate();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:8,代码来源:CustomerLogin.php


示例10: getWishlist

 /**
  * Retrieve current wishlist
  *
  * @return \Magento\Wishlist\Model\Wishlist
  */
 public function getWishlist()
 {
     return $this->_wishlistData->getWishlist();
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:9,代码来源:Button.php


示例11: __construct

 /**
  * @param \Magento\Framework\App\Helper\Context $context
  * @param \Magento\Core\Helper\Data $coreData
  * @param \Magento\Framework\Registry $coreRegistry
  * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
  * @param \Magento\Customer\Model\Session $customerSession
  * @param \Magento\Wishlist\Model\WishlistFactory $wishlistFactory
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Core\Helper\PostData $postDataHelper
  * @param \Magento\Customer\Helper\View $customerViewHelper
  * @param \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider
  * @param \Magento\Customer\Service\V1\Data\CustomerBuilder $customerBuilder
  */
 public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Customer\Model\Session $customerSession, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Core\Helper\PostData $postDataHelper, \Magento\Customer\Helper\View $customerViewHelper, \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider, \Magento\Customer\Service\V1\Data\CustomerBuilder $customerBuilder)
 {
     $this->_customerBuilder = $customerBuilder;
     parent::__construct($context, $coreData, $coreRegistry, $scopeConfig, $customerSession, $wishlistFactory, $storeManager, $postDataHelper, $customerViewHelper, $wishlistProvider);
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:18,代码来源:WishlistRss.php


示例12: __construct

 /**
  * @param \Magento\Framework\App\Helper\Context $context
  * @param \Magento\Framework\Registry $coreRegistry
  * @param \Magento\Customer\Model\Session $customerSession
  * @param \Magento\Wishlist\Model\WishlistFactory $wishlistFactory
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
  * @param \Magento\Customer\Helper\View $customerViewHelper
  * @param \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider
  * @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
  * @param \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerFactory
  * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
  * @SuppressWarnings(PHPMD.ExcessiveParameterList)
  */
 public function __construct(\Magento\Framework\App\Helper\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Data\Helper\PostHelper $postDataHelper, \Magento\Customer\Helper\View $customerViewHelper, \Magento\Wishlist\Controller\WishlistProviderInterface $wishlistProvider, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerFactory, \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository)
 {
     $this->_customerFactory = $customerFactory;
     $this->_customerRepository = $customerRepository;
     parent::__construct($context, $coreRegistry, $customerSession, $wishlistFactory, $storeManager, $postDataHelper, $customerViewHelper, $wishlistProvider, $productRepository);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:20,代码来源:Rss.php


示例13: getItemData

 /**
  * Retrieve wishlist item data
  *
  * @param \Magento\Wishlist\Model\Item $wishlistItem
  * @return array
  */
 protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem)
 {
     $product = $wishlistItem->getProduct();
     return ['image' => $this->getImageData($product), 'product_url' => $this->wishlistHelper->getProductUrl($wishlistItem), 'product_name' => $product->getName(), 'product_price' => $this->block->getProductPriceHtml($product, \Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_PRICE_CODE, \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, ['item' => $wishlistItem]), 'product_is_saleable_and_visible' => $product->isSaleable() && $product->isVisibleInSiteVisibility(), 'product_has_required_options' => $product->getTypeInstance()->hasRequiredOptions($product), 'add_to_cart_params' => $this->wishlistHelper->getAddToCartParams($wishlistItem, true), 'delete_item_params' => $this->wishlistHelper->getRemoveParams($wishlistItem, true)];
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:11,代码来源:Wishlist.php


示例14: customerLogin

 /**
  * Customer login processing
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return $this
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function customerLogin(\Magento\Framework\Event\Observer $observer)
 {
     $this->_wishlistData->calculate();
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:12,代码来源:Observer.php


示例15: testExecute

 public function testExecute()
 {
     $event = $this->getMockBuilder('Magento\\Framework\\Event\\Observer')->disableOriginalConstructor()->getMock();
     /** @var $event \Magento\Framework\Event\Observer */
     $this->helper->expects($this->once())->method('calculate');
     $this->observer->execute($event);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:7,代码来源:CustomerLoginTest.php


示例16: execute

 /**
  * Add cart item to wishlist and remove from cart
  *
  * @return \Magento\Framework\Controller\Result\Redirect
  * @throws NotFoundException
  * @SuppressWarnings(PHPMD.UnusedLocalVariable)
  */
 public function execute()
 {
     $wishlist = $this->wishlistProvider->getWishlist();
     if (!$wishlist) {
         throw new NotFoundException(__('Page not found.'));
     }
     try {
         $itemId = (int) $this->getRequest()->getParam('item');
         $item = $this->cart->getQuote()->getItemById($itemId);
         if (!$item) {
             throw new LocalizedException(__('The requested cart item doesn\'t exist.'));
         }
         $productId = $item->getProductId();
         $buyRequest = $item->getBuyRequest();
         $wishlist->addNewItem($productId, $buyRequest);
         $this->cart->getQuote()->removeItem($itemId);
         $this->cart->save();
         $this->wishlistHelper->calculate();
         $wishlist->save();
         $this->messageManager->addSuccessMessage(__("%1 has been moved to your wish list.", $this->escaper->escapeHtml($item->getProduct()->getName())));
     } catch (LocalizedException $e) {
         $this->messageManager->addErrorMessage($e->getMessage());
     } catch (\Exception $e) {
         $this->messageManager->addExceptionMessage($e, __('We can\'t move the item to the wish list.'));
     }
     /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
     $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
     return $resultRedirect->setUrl($this->cartHelper->getCartUrl());
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:36,代码来源:Fromcart.php


示例17: _toHtml

 /**
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->_wishlistHelper->isAllow()) {
         return parent::_toHtml();
     }
     return '';
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Link.php


示例18: testGetMoveFromCartParams

 public function testGetMoveFromCartParams()
 {
     $itemId = 45;
     $json = '{json;}';
     /**
      * @var Item|\PHPUnit_Framework_MockObject_MockObject $itemMock
      */
     $itemMock = $this->getMockBuilder('Magento\\Quote\\Model\\Quote\\Item')->disableOriginalConstructor()->getMock();
     $itemMock->expects($this->once())->method('getId')->willReturn($itemId);
     $this->wishlistHelperMock->expects($this->once())->method('getMoveFromCartParams')->with($itemId)->willReturn($json);
     $this->model->setItem($itemMock);
     $this->assertEquals($json, $this->model->getMoveFromCartParams());
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:MoveToWishlistTest.php


示例19: getItems

 /**
  * Get wishlist items
  *
  * @return array
  */
 protected function getItems()
 {
     $this->view->loadLayout();
     $collection = $this->wishlistHelper->getWishlistItemCollection();
     $collection->clear()->setPageSize(self::SIDEBAR_ITEMS_NUMBER)->setInStockFilter(true)->setOrder('added_at');
     $items = [];
     foreach ($collection as $wishlistItem) {
         /** @var \Magento\Catalog\Model\Product $product */
         $product = $wishlistItem->getProduct();
         $this->productImageView->init($product, 'wishlist_sidebar_block', 'Magento_Catalog');
         $items[] = ['image' => ['src' => $this->productImageView->getUrl(), 'alt' => $this->productImageView->getLabel(), 'width' => $this->productImageView->getWidth(), 'height' => $this->productImageView->getHeight()], 'product_url' => $this->wishlistHelper->getProductUrl($wishlistItem), 'product_name' => $product->getName(), 'product_price' => $this->block->getProductPriceHtml($product, \Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_PRICE_CODE, \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, ['item' => $wishlistItem]), 'product_is_saleable_and_visible' => $product->isSaleable() && $product->isVisibleInSiteVisibility(), 'product_has_required_options' => $product->getTypeInstance()->hasRequiredOptions($product), 'add_to_cart_params' => $this->wishlistHelper->getAddToCartParams($wishlistItem), 'delete_item_params' => $this->wishlistHelper->getRemoveParams($wishlistItem)];
     }
     return $items;
 }
开发者ID:vasiljok,项目名称:magento2,代码行数:19,代码来源:Wishlist.php


示例20: getLinkParams

 /**
  * @return string
  */
 protected function getLinkParams()
 {
     $params = [];
     $wishlistId = $this->wishlistHelper->getWishlist()->getId();
     $customer = $this->wishlistHelper->getCustomer();
     if ($customer) {
         $key = $customer->getId() . ',' . $customer->getEmail();
         $params = ['type' => 'wishlist', 'data' => $this->urlEncoder->encode($key), '_secure' => false];
     }
     if ($wishlistId) {
         $params['wishlist_id'] = $wishlistId;
     }
     return $params;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:Link.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Mailgun\Mailgun类代码示例发布时间:2022-05-23
下一篇:
PHP Controller\WishlistProviderInterface类代码示例发布时间: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