Completed
Pull Request — master (#287)
by Nic
07:56
created
code/objects/OrderDetail.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         'Price' => 'Currency'
26 26
     );
27 27
 
28
-	private static $has_one = array(
28
+    private static $has_one = array(
29 29
         'Product' => 'FoxyStripeProduct',
30 30
         'Order' => 'Order'
31 31
     );
Please login to merge, or discard this patch.
code/objects/OptionItem.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -181,6 +181,9 @@
 block discarded – undo
181 181
         return $result;
182 182
     }
183 183
 
184
+    /**
185
+     * @param string $oma
186
+     */
184 187
     public static function getOptionModifierActionSymbol($oma, $returnWithOnlyPlusMinus = false)
185 188
     {
186 189
         switch ($oma) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $parentCode = $product->Code;
73 73
 
74 74
         // ProductOptionGroup Dropdown field w/ add new
75
-        $groups = function () {
75
+        $groups = function() {
76 76
             return OptionGroup::get()->map()->toArray();
77 77
         };
78 78
         $groupFields = singleton('OptionGroup')->getCMSFields();
@@ -198,17 +198,17 @@  discard block
 block discarded – undo
198 198
 
199 199
     public function getWeightModifierWithSymbol()
200 200
     {
201
-        return self::getOptionModifierActionSymbol($this->WeightModifierAction) . $this->WeightModifier;
201
+        return self::getOptionModifierActionSymbol($this->WeightModifierAction).$this->WeightModifier;
202 202
     }
203 203
 
204 204
     public function getPriceModifierWithSymbol()
205 205
     {
206
-        return self::getOptionModifierActionSymbol($this->PriceModifierAction) . $this->PriceModifier;
206
+        return self::getOptionModifierActionSymbol($this->PriceModifierAction).$this->PriceModifier;
207 207
     }
208 208
 
209 209
     public function getCodeModifierWithSymbol()
210 210
     {
211
-        return self::getOptionModifierActionSymbol($this->CodeModifierAction) . $this->CodeModifier;
211
+        return self::getOptionModifierActionSymbol($this->CodeModifierAction).$this->CodeModifier;
212 212
     }
213 213
 
214 214
     public function getProductOptionGroupTitle()
@@ -219,18 +219,18 @@  discard block
 block discarded – undo
219 219
     public function getGeneratedValue()
220 220
     {
221 221
         $modPrice = ($this->PriceModifier) ? (string)$this->PriceModifier : '0';
222
-        $modPriceWithSymbol = OptionItem::getOptionModifierActionSymbol($this->PriceModifierAction) . $modPrice;
222
+        $modPriceWithSymbol = OptionItem::getOptionModifierActionSymbol($this->PriceModifierAction).$modPrice;
223 223
         $modWeight = ($this->WeightModifier) ? (string)$this->WeightModifier : '0';
224
-        $modWeight = OptionItem::getOptionModifierActionSymbol($this->WeightModifierAction) . $modWeight;
225
-        $modCode = OptionItem::getOptionModifierActionSymbol($this->CodeModifierAction) . $this->CodeModifier;
226
-        return $this->Title . '{p' . $modPriceWithSymbol . '|w' . $modWeight . '|c' . $modCode . '}';
224
+        $modWeight = OptionItem::getOptionModifierActionSymbol($this->WeightModifierAction).$modWeight;
225
+        $modCode = OptionItem::getOptionModifierActionSymbol($this->CodeModifierAction).$this->CodeModifier;
226
+        return $this->Title.'{p'.$modPriceWithSymbol.'|w'.$modWeight.'|c'.$modCode.'}';
227 227
     }
228 228
 
229 229
     public function getGeneratedTitle()
230 230
     {
231 231
         $modPrice = ($this->PriceModifier) ? (string)$this->PriceModifier : '0';
232 232
         $title = $this->Title;
233
-        $title .= ($this->PriceModifier != 0) ? ': (' . OptionItem::getOptionModifierActionSymbol($this->PriceModifierAction, $returnWithOnlyPlusMinus = true) . '$' . $modPrice . ')' : '';
233
+        $title .= ($this->PriceModifier != 0) ? ': ('.OptionItem::getOptionModifierActionSymbol($this->PriceModifierAction, $returnWithOnlyPlusMinus = true).'$'.$modPrice.')' : '';
234 234
         return $title;
235 235
     }
236 236
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,9 @@
 block discarded – undo
79 79
         $groupField = DropdownField::create('ProductOptionGroupID', _t("OptionItem.Group", "Group"), $groups())
80 80
             ->setEmptyString('')
81 81
             ->setDescription(_t('OptionItem.GroupDescription', 'Name of this group of options. Managed in <a href="admin/settings">Settings > FoxyStripe > Option Groups</a>'));
82
-        if (class_exists('QuickAddNewExtension')) $groupField->useAddNew('OptionGroup', $groups, $groupFields);
82
+        if (class_exists('QuickAddNewExtension')) {
83
+            $groupField->useAddNew('OptionGroup', $groups, $groupFields);
84
+        }
83 85
 
84 86
         $fields->addFieldsToTab('Root.Main', array(
85 87
             HeaderField::create('DetailsHD', _t("OptionItem.DetailsHD", "Product Option Details"), 2),
Please login to merge, or discard this patch.