Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-wishlist
Controller
Shared
WishlistProvider.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Wishlist\Controller\Shared
;
8
9
use
Magento\Wishlist\Controller\WishlistProviderInterface
;
10
11
class
WishlistProvider
implements
WishlistProviderInterface
12
{
16
protected
$request
;
17
21
protected
$wishlistFactory
;
22
26
protected
$checkoutSession
;
27
31
protected
$wishlist
;
32
38
public
function
__construct
(
39
\
Magento
\Framework\
App
\
RequestInterface
$request
,
40
\
Magento
\Wishlist\Model\WishlistFactory
$wishlistFactory
,
41
\
Magento
\Checkout\Model\Session
$checkoutSession
42
) {
43
$this->request =
$request
;
44
$this->wishlistFactory =
$wishlistFactory
;
45
$this->checkoutSession =
$checkoutSession
;
46
}
47
53
public
function
getWishlist
($wishlistId =
null
)
54
{
55
if
($this->wishlist) {
56
return
$this->wishlist
;
57
}
58
$code
= (string)$this->request->getParam(
'code'
);
59
if
(empty(
$code
)) {
60
return
false
;
61
}
62
63
$wishlist
= $this->wishlistFactory->create()->loadByCode(
$code
);
64
if
(!
$wishlist
->getId()) {
65
return
false
;
66
}
67
68
$this->checkoutSession->setSharedWishlist(
$code
);
69
$this->wishlist =
$wishlist
;
70
return
$wishlist
;
71
}
72
}
Magento\Framework\App
Magento\Wishlist\Controller\Shared\WishlistProvider\__construct
__construct(\Magento\Framework\App\RequestInterface $request, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Checkout\Model\Session $checkoutSession)
Definition:
WishlistProvider.php:38
Magento\Wishlist\Controller\Shared\WishlistProvider\$request
$request
Definition:
WishlistProvider.php:16
Magento\Wishlist\Controller\WishlistProviderInterface
Definition:
WishlistProviderInterface.php:13
Magento\Wishlist\Controller\Shared\WishlistProvider\$wishlist
$wishlist
Definition:
WishlistProvider.php:31
Magento\Framework\App\RequestInterface
Definition:
RequestInterface.php:14
Magento\Wishlist\Controller\Shared\WishlistProvider\$wishlistFactory
$wishlistFactory
Definition:
WishlistProvider.php:21
Magento\Wishlist\Controller\Shared\WishlistProvider\$checkoutSession
$checkoutSession
Definition:
WishlistProvider.php:26
Magento
Magento\Wishlist\Controller\Shared\WishlistProvider
Definition:
WishlistProvider.php:11
Magento\Wishlist\Controller\Shared
Definition:
Allcart.php:6
Magento\Wishlist\Controller\Shared\WishlistProvider\getWishlist
getWishlist($wishlistId=null)
Definition:
WishlistProvider.php:53
$code
$code
Definition:
info.phtml:12