|
6 | 6 |
|
7 | 7 | namespace Magento\Theme\CustomerData;
|
8 | 8 |
|
9 |
| -use Magento\Catalog\Model\Product\ProductFrontendAction\Synchronizer; |
10 | 9 | use Magento\Customer\CustomerData\SectionSourceInterface;
|
11 | 10 | use Magento\Framework\App\Config;
|
12 | 11 | use Magento\Framework\App\RequestInterface;
|
@@ -42,32 +41,24 @@ class Messages implements SectionSourceInterface
|
42 | 41 | */
|
43 | 42 | private $appConfig;
|
44 | 43 |
|
45 |
| - /** |
46 |
| - * @var Synchronizer |
47 |
| - */ |
48 |
| - private $synchronizer; |
49 |
| - |
50 | 44 | /**
|
51 | 45 | * Constructor
|
52 | 46 | *
|
53 | 47 | * @param MessageManager $messageManager
|
54 | 48 | * @param InterpretationStrategyInterface $interpretationStrategy
|
55 | 49 | * @param RequestInterface $request
|
56 | 50 | * @param Config $appConfig
|
57 |
| - * @param Synchronizer $synchronizer |
58 | 51 | */
|
59 | 52 | public function __construct(
|
60 | 53 | MessageManager $messageManager,
|
61 | 54 | InterpretationStrategyInterface $interpretationStrategy,
|
62 | 55 | ?RequestInterface $request = null,
|
63 |
| - ?Config $appConfig = null, |
64 |
| - ?Synchronizer $synchronizer = null |
| 56 | + ?Config $appConfig = null |
65 | 57 | ) {
|
66 | 58 | $this->messageManager = $messageManager;
|
67 | 59 | $this->interpretationStrategy = $interpretationStrategy;
|
68 | 60 | $this->request = $request ?: ObjectManager::getInstance()->get(RequestInterface::class);
|
69 | 61 | $this->appConfig = $appConfig ?: ObjectManager::getInstance()->get(Config::class);
|
70 |
| - $this->synchronizer = $synchronizer ?: ObjectManager::getInstance()->get(Synchronizer::class); |
71 | 62 | }
|
72 | 63 |
|
73 | 64 | /**
|
@@ -103,18 +94,13 @@ private function sectionTimestampFlag(): bool
|
103 | 94 | {
|
104 | 95 | $forceNewSectionTimestampFlg = true;
|
105 | 96 |
|
106 |
| - if ((bool) $this->appConfig->getValue($this->synchronizer::ALLOW_SYNC_WITH_BACKEND_PATH)) { |
107 |
| - $sections = $this->request->getParam('sections') ?? null; |
108 |
| - $sectionNames = $sections ? explode(',', $sections) : []; |
109 |
| - |
110 |
| - if (in_array('cart', $sectionNames)) { |
111 |
| - $forceNewSectionTimestampFlg = false; |
112 |
| - $forceNewSectionTimestamp = $this->request->getParam('force_new_section_timestamp') |
113 |
| - ?? null; |
| 97 | + if ((bool) $this->appConfig->getValue('catalog/recently_products/synchronize_with_backend')) { |
| 98 | + $forceNewSectionTimestampFlg = false; |
| 99 | + $forceNewSectionTimestamp = $this->request->getParam('force_new_section_timestamp') |
| 100 | + ?? null; |
114 | 101 |
|
115 |
| - if ('true' === $forceNewSectionTimestamp) { |
116 |
| - $forceNewSectionTimestampFlg = true; |
117 |
| - } |
| 102 | + if ('true' === $forceNewSectionTimestamp) { |
| 103 | + $forceNewSectionTimestampFlg = true; |
118 | 104 | }
|
119 | 105 | }
|
120 | 106 | return $forceNewSectionTimestampFlg;
|
|
0 commit comments