/
VariantMatrixAsset.php
66 lines (57 loc) · 1.46 KB
/
VariantMatrixAsset.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
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\commerce\web\assets\variantmatrix;
use craft\commerce\web\assets\commercecp\CommerceCpAsset;
use craft\web\AssetBundle;
use craft\web\View;
/**
* Variant Matrix asset bundle.
*
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @since 2.0
*/
class VariantMatrixAsset extends AssetBundle
{
// Public Methods
// =========================================================================
/**
* @inheritdoc
*/
public function init()
{
$this->sourcePath = __DIR__ . '/dist';
$this->depends = [
CommerceCpAsset::class,
];
$this->js = [
'js/VariantMatrix.js',
];
parent::init();
}
/**
* @inheritdoc
*/
public function registerAssetFiles($view)
{
parent::registerAssetFiles($view);
if ($view instanceof View) {
$view->registerTranslations('commerce', [
'Actions',
'Add a variant',
'Add variant above',
'Are you sure you want to delete the selected variants?',
'Collapse',
'Default',
'Disable',
'Disabled',
'Enable',
'Expand',
'Set as the default variant',
]);
}
}
}