1 | <?php |
||
14 | class CombinationProductModifier extends OrderModifier |
||
|
|||
15 | { |
||
16 | |||
17 | // ######################################## *** other (non) static variables (e.g. private static $special_name_for_something, protected $order) |
||
18 | |||
19 | private static $savings = 0; |
||
20 | |||
21 | |||
22 | /** |
||
23 | * standard modifier method |
||
24 | * @param Boolean $force - should the update run no matter what |
||
25 | */ |
||
26 | public function runUpdate($force = false) |
||
31 | |||
32 | |||
33 | // ######################################## *** form functions (e. g. showform and getform) |
||
34 | |||
35 | /** |
||
36 | * standard OrderModifier Method |
||
37 | * Should we show a form in the checkout page for this modifier? |
||
38 | */ |
||
39 | public function ShowForm() |
||
43 | |||
44 | // ######################################## *** template functions (e.g. ShowInTable, TableTitle, etc...) ... USES DB VALUES |
||
45 | |||
46 | /** |
||
47 | * standard OrderModifer Method |
||
48 | * Tells us if the modifier should take up a row in the table on the checkout page. |
||
49 | * @return Boolean |
||
50 | */ |
||
51 | public function ShowInTable() |
||
55 | |||
56 | /** |
||
57 | * standard OrderModifer Method |
||
58 | * Tells us if the modifier can be removed (hidden / turned off) from the order. |
||
59 | * @return Boolean |
||
60 | */ |
||
61 | public function CanBeRemoved() |
||
65 | |||
66 | // ######################################## *** inner calculations.... USES CALCULATED VALUES |
||
67 | |||
68 | /** |
||
69 | * loads the items in the static variable $order_items |
||
70 | * and saves the items for future use. |
||
71 | * @return Null | DataObjectSet |
||
72 | */ |
||
73 | protected function loadIncludedProductItems() |
||
77 | |||
78 | /** |
||
79 | * loads the items in the static variable $order_items |
||
80 | * and saves the items for future use. |
||
81 | * @return Null | DataObjectSet |
||
82 | */ |
||
83 | protected function loadCombinationProducts() |
||
87 | |||
88 | /** |
||
89 | * checks for Combination Products and makes sure that enough of the component products are added. |
||
90 | * |
||
91 | */ |
||
92 | protected function addProductsPerCombo() |
||
131 | |||
132 | /** |
||
133 | * Tells us the number of times a product has been added to the order (quantity) |
||
134 | * @param Product $product - the product we are checking. |
||
135 | * @return Integer |
||
136 | */ |
||
137 | protected function countOfProductInOrder($product) |
||
150 | |||
151 | // ######################################## *** calculate database fields: protected function Live[field name] ... USES CALCULATED VALUES |
||
152 | |||
153 | public function LiveName() |
||
157 | |||
158 | public function LiveTableValue() |
||
172 | |||
173 | // ######################################## *** Type Functions (IsChargeable, IsDeductable, IsNoChange, IsRemoved) |
||
174 | |||
175 | |||
176 | // ######################################## *** standard database related functions (e.g. onBeforeWrite, onAfterWrite, etc...) |
||
177 | |||
178 | // ######################################## *** AJAX related functions |
||
179 | |||
180 | // ######################################## *** debug functions |
||
181 | } |
||
182 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.