forked from extcode/cart_products
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext_localconf.php
125 lines (100 loc) · 3.91 KB
/
ext_localconf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
defined('TYPO3_MODE') or die();
$_LLL_be = 'LLL:EXT:cart_products/Resources/Private/Language/locallang_be.xlf:';
// configure plugins
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Extcode.cart_products',
'Products',
[
'Product' => 'show, list, teaser, showForm',
],
[
'Product' => 'showForm',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Extcode.cart_products',
'TeaserProducts',
[
'Product' => 'teaser, showForm',
],
[
'Product' => 'showForm',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Extcode.cart_products',
'SingleProduct',
[
'Product' => 'show, showForm',
],
[
'Product' => 'showForm',
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Extcode.cart_products',
'ProductPartial',
[
'Product' => 'showForm',
],
[
'Product' => 'showForm',
]
);
// Icon Registry
if (TYPO3_MODE === 'BE') {
$icons = [
'apps-pagetree-folder-cartproducts-products' => 'apps_pagetree_folder_cartproducts_products.svg',
'apps-pagetree-page-cartproducts-products' => 'apps_pagetree_page_cartproducts_products.svg',
'ext-cartproducts-wizard-icon' => 'cartproducts_plugin_wizard.svg',
];
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
foreach ($icons as $identifier => $fileName) {
$iconRegistry->registerIcon(
$identifier,
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
[
'source' => 'EXT:cart_products/Resources/Public/Icons/' . $fileName,
]
);
}
}
// TSconfig
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:cart_products/Configuration/TSconfig/ContentElementWizard.tsconfig">
');
// Cart Hooks
if (TYPO3_MODE === 'FE') {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cart']['CartProducts']['Cart']['AddToCartFinisher'] =
\Extcode\CartProducts\Domain\Finisher\Cart\AddToCartFinisher::class;
}
// processDatamapClass Hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['cartproducts_allowed'] =
\Extcode\CartProducts\Hooks\DatamapDataHandlerHook::class;
// clearCachePostProc Hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['cartproducts_clearcache'] =
\Extcode\CartProducts\Hooks\DataHandler::class . '->clearCachePostProc';
// Signal Slots
$dispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class
);
$dispatcher->connect(
\Extcode\Cart\Utility\StockUtility::class,
'handleStock',
\Extcode\CartProducts\Utility\StockUtility::class,
'handleStock'
);
// register "cartproducts:" namespace
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['cartproducts'][]
= 'Extcode\\CartProducts\\ViewHelpers';
// update wizard for slugs
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['cartProductsSlugUpdater'] =
\Extcode\CartProducts\Updates\SlugUpdater::class;
// register listTemplateLayouts
$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['products'][] = [$_LLL_be . 'flexforms_template.templateLayout.products.table', 'table'];
$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['products'][] = [$_LLL_be . 'flexforms_template.templateLayout.products.grid', 'grid'];
$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['teaser_products'][] = [$_LLL_be . 'flexforms_template.templateLayout.products.table', 'table'];
$GLOBALS['TYPO3_CONF_VARS']['EXT']['cart_products']['templateLayouts']['teaser_products'][] = [$_LLL_be . 'flexforms_template.templateLayout.products.grid', 'grid'];