1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,32 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+declare(strict_types=1); |
|
4 |
+ |
|
5 |
+namespace App\Model; |
|
6 |
+ |
|
7 |
+use Contao\Model; |
|
8 |
+ |
|
9 |
+/** |
|
10 |
+ * add properties for IDE support |
|
11 |
+ * |
|
12 |
+ * @property string $not_buyable |
|
13 |
+ */ |
|
14 |
+class Standard extends \Isotope\Model\Product\Standard |
|
15 |
+{ |
|
16 |
+ public function generate(array $arrConfig) |
|
17 |
+ { |
|
18 |
+ |
|
19 |
+ $arrButtons = array(); |
|
20 |
+ foreach ($arrConfig['buttons'] as $button) |
|
21 |
+ { |
|
22 |
+ if ($button == 'add_to_cart' && $this->not_buyable) |
|
23 |
+ { |
|
24 |
+ continue; |
|
25 |
+ } |
|
26 |
+ $arrButtons[] = $button; |
|
27 |
+ } |
|
28 |
+ $arrConfig['buttons'] = $arrButtons; |
|
29 |
+ |
|
30 |
+ return parent::generate($arrConfig); |
|
31 |
+ } |
|
32 |
+} |