File tree Expand file tree Collapse file tree 2 files changed +28
-14
lines changed
app/code/Magento/Customer
view/frontend/templates/js/customer-data Expand file tree Collapse file tree 2 files changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -50,4 +50,30 @@ public function getWebsiteId()
50
50
{
51
51
return (int )$ this ->_storeManager ->getStore ()->getWebsiteId ();
52
52
}
53
+
54
+ /**
55
+ * Get the invalidation rules json encoded
56
+ *
57
+ * @return string
58
+ */
59
+ public function getInvalidationRulesJson ()
60
+ {
61
+ return $ this ->jsonEncoder ->encode (
62
+ [
63
+ '* ' => [
64
+ 'Magento_Customer/js/invalidation-processor ' => [
65
+ 'invalidationRules ' => [
66
+ 'website-rule ' => [
67
+ 'Magento_Customer/js/invalidation-rules/website-rule ' => [
68
+ 'scopeConfig ' => [
69
+ 'websiteId ' => $ this ->getWebsiteId (),
70
+ ]
71
+ ]
72
+ ]
73
+ ]
74
+ ]
75
+ ],
76
+ ]
77
+ );
78
+ }
53
79
}
Original file line number Diff line number Diff line change 12
12
<script type="text/x-magento-init">
13
13
<?php
14
14
/* @noEscape */
15
- echo \Zend_Json::encode ([
16
- '* ' => ['Magento_Customer/js/invalidation-processor ' => [
17
- 'invalidationRules ' => [
18
- 'website-rule ' => [
19
- 'Magento_Customer/js/invalidation-rules/website-rule ' => [
20
- 'scopeConfig ' => [
21
- 'websiteId ' => $ block ->getWebsiteId (),
22
- ]
23
- ]
24
- ]
25
- ]
26
- ]],
27
- ]);
28
- ?>
15
+ echo $ block ->getInvalidationRulesJson ();
16
+ ?>
29
17
</script>
You can’t perform that action at this time.
0 commit comments