-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.2.x (#156) Refactor - same search design everywhere
- Refactor - same search design everywhere - Update contact form
- Loading branch information
1 parent
32017e7
commit a4fa9c3
Showing
27 changed files
with
578 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Smile\StoreLocator\Plugin\Model\Layout; | ||
|
||
use Magento\Customer\Model\Layout\DepersonalizePlugin; | ||
use Magento\Customer\Model\Session as CustomerSession; | ||
use Magento\Framework\View\LayoutInterface; | ||
use Magento\PageCache\Model\DepersonalizeChecker; | ||
use Smile\StoreLocator\CustomerData\CurrentStore; | ||
|
||
/** | ||
* Depersonalize customer data. | ||
* | ||
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse) | ||
*/ | ||
class RetailerDepersonalizePlugin | ||
{ | ||
//@SmileAnalyserSkip magento2/badpractices | ||
public function __construct( | ||
protected DepersonalizeChecker $depersonalizeChecker, | ||
protected CustomerSession $customerSession, | ||
protected CurrentStore $currentStore | ||
) { | ||
} | ||
|
||
/** | ||
* Prevent losing retailer_id chosen - show product offer price if shop has been selected, even in Retail mode | ||
*/ | ||
public function afterAfterGenerateElements( | ||
DepersonalizePlugin $subject, | ||
mixed $result, | ||
LayoutInterface $layout | ||
): void { | ||
if ($this->depersonalizeChecker->checkIfDepersonalize($layout)) { | ||
$retailer = $this->currentStore->getRetailer(); | ||
if ($retailer && $retailer->getId()) { | ||
$data = $this->customerSession->getData(); | ||
$data['retailer_id'] = $retailer->getId(); | ||
$this->customerSession->setData($data); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.