@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class StoreSettingsTest extends FS_Test{ |
|
3 | +class StoreSettingsTest extends FS_Test { |
|
4 | 4 | |
5 | 5 | protected static $use_draft_site = true; |
6 | 6 | |
7 | - function setUp(){ |
|
7 | + function setUp() { |
|
8 | 8 | parent::setUp(); |
9 | 9 | |
10 | 10 | $siteConf = SiteConfig::current_site_config(); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $siteConf->write(); |
14 | 14 | } |
15 | 15 | |
16 | - function testStoreKey(){ |
|
16 | + function testStoreKey() { |
|
17 | 17 | $pref = FoxyCart::getKeyPrefix(); |
18 | 18 | $siteConf = SiteConfig::current_site_config(); |
19 | 19 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $this->assertEquals(substr($siteConf->StoreKey, 0, 6), $pref); |
23 | 23 | } |
24 | 24 | |
25 | - function testStoreName(){ |
|
25 | + function testStoreName() { |
|
26 | 26 | $siteConf = SiteConfig::current_site_config(); |
27 | 27 | |
28 | 28 | $this->assertEquals($siteConf->StoreName, 'foxystripe'); |
@@ -2,28 +2,28 @@ |
||
2 | 2 | |
3 | 3 | class StoreSettingsTest extends FS_Test{ |
4 | 4 | |
5 | - protected static $use_draft_site = true; |
|
5 | + protected static $use_draft_site = true; |
|
6 | 6 | |
7 | - function setUp(){ |
|
8 | - parent::setUp(); |
|
7 | + function setUp(){ |
|
8 | + parent::setUp(); |
|
9 | 9 | |
10 | - $siteConf = SiteConfig::current_site_config(); |
|
11 | - $siteConf->StoreName = 'foxystripe'; |
|
10 | + $siteConf = SiteConfig::current_site_config(); |
|
11 | + $siteConf->StoreName = 'foxystripe'; |
|
12 | 12 | $siteConf->requireDefaultRecords(); |
13 | - $siteConf->write(); |
|
14 | - } |
|
13 | + $siteConf->write(); |
|
14 | + } |
|
15 | 15 | |
16 | - function testStoreKey(){ |
|
17 | - $siteConf = SiteConfig::current_site_config(); |
|
16 | + function testStoreKey(){ |
|
17 | + $siteConf = SiteConfig::current_site_config(); |
|
18 | 18 | |
19 | - $this->assertTrue(ctype_alnum($siteConf->StoreKey)); |
|
19 | + $this->assertTrue(ctype_alnum($siteConf->StoreKey)); |
|
20 | 20 | $this->assertEquals(strlen($siteConf->StoreKey), 60); |
21 | - } |
|
21 | + } |
|
22 | 22 | |
23 | - function testStoreName(){ |
|
24 | - $siteConf = SiteConfig::current_site_config(); |
|
23 | + function testStoreName(){ |
|
24 | + $siteConf = SiteConfig::current_site_config(); |
|
25 | 25 | |
26 | 26 | $this->assertEquals($siteConf->StoreName, 'foxystripe'); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | 29 | } |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class ProductDiscountTierTest extends FS_Test{ |
|
3 | +class ProductDiscountTierTest extends FS_Test { |
|
4 | 4 | |
5 | 5 | protected static $use_draft_site = true; |
6 | 6 | |
7 | - function setUp(){ |
|
7 | + function setUp() { |
|
8 | 8 | parent::setUp(); |
9 | 9 | |
10 | 10 | $productHolder = ProductHolder::create(); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $product->write(); |
17 | 17 | } |
18 | 18 | |
19 | - public function testProductDiscountTierCreation(){ |
|
19 | + public function testProductDiscountTierCreation() { |
|
20 | 20 | $this->logInWithPermission('Product_CANCRUD'); |
21 | 21 | |
22 | 22 | $discount = ProductPage::get()->first(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->logOut(); |
35 | 35 | } |
36 | 36 | |
37 | - public function testProductDiscountTierEdit(){ |
|
37 | + public function testProductDiscountTierEdit() { |
|
38 | 38 | $this->logInWithPermission('ADMIN'); |
39 | 39 | |
40 | 40 | $discount = ProductPage::get()->first(); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $this->logOut(); |
58 | 58 | } |
59 | 59 | |
60 | - public function testProductDiscountTierDeletion(){ |
|
60 | + public function testProductDiscountTierDeletion() { |
|
61 | 61 | $this->logInWithPermission('ADMIN'); |
62 | 62 | |
63 | 63 | $discount = ProductPage::get()->first(); |
@@ -2,79 +2,79 @@ |
||
2 | 2 | |
3 | 3 | class ProductDiscountTierTest extends FS_Test{ |
4 | 4 | |
5 | - protected static $use_draft_site = true; |
|
5 | + protected static $use_draft_site = true; |
|
6 | 6 | |
7 | - function setUp(){ |
|
8 | - parent::setUp(); |
|
7 | + function setUp(){ |
|
8 | + parent::setUp(); |
|
9 | 9 | |
10 | - $productHolder = ProductHolder::create(); |
|
11 | - $productHolder->Title = 'Product Holder'; |
|
12 | - $productHolder->write(); |
|
10 | + $productHolder = ProductHolder::create(); |
|
11 | + $productHolder->Title = 'Product Holder'; |
|
12 | + $productHolder->write(); |
|
13 | 13 | |
14 | - $product = $this->objFromFixture('ShippableProduct', 'product1'); |
|
15 | - $product->ParentID = $productHolder->ID; |
|
16 | - $product->write(); |
|
17 | - } |
|
14 | + $product = $this->objFromFixture('ShippableProduct', 'product1'); |
|
15 | + $product->ParentID = $productHolder->ID; |
|
16 | + $product->write(); |
|
17 | + } |
|
18 | 18 | |
19 | - public function testProductDiscountTierCreation(){ |
|
20 | - $this->logInWithPermission('Product_CANCRUD'); |
|
19 | + public function testProductDiscountTierCreation(){ |
|
20 | + $this->logInWithPermission('Product_CANCRUD'); |
|
21 | 21 | |
22 | - $discount = ShippableProduct::get()->first(); |
|
22 | + $discount = ShippableProduct::get()->first(); |
|
23 | 23 | |
24 | - $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
25 | - $tier->ShippableProductID = $discount->ID; |
|
26 | - $tier->write(); |
|
27 | - $tierID = $tier->ID; |
|
24 | + $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
25 | + $tier->ShippableProductID = $discount->ID; |
|
26 | + $tier->write(); |
|
27 | + $tierID = $tier->ID; |
|
28 | 28 | |
29 | - $checkTier = ProductDiscountTier::get()->byID($tierID); |
|
29 | + $checkTier = ProductDiscountTier::get()->byID($tierID); |
|
30 | 30 | |
31 | - $this->assertEquals($checkTier->Quantity, 5); |
|
32 | - $this->assertEquals($checkTier->Percentage, 10); |
|
31 | + $this->assertEquals($checkTier->Quantity, 5); |
|
32 | + $this->assertEquals($checkTier->Percentage, 10); |
|
33 | 33 | |
34 | - $this->logOut(); |
|
35 | - } |
|
34 | + $this->logOut(); |
|
35 | + } |
|
36 | 36 | |
37 | - public function testProductDiscountTierEdit(){ |
|
38 | - $this->logInWithPermission('ADMIN'); |
|
37 | + public function testProductDiscountTierEdit(){ |
|
38 | + $this->logInWithPermission('ADMIN'); |
|
39 | 39 | |
40 | - $discount = ShippableProduct::get()->first(); |
|
40 | + $discount = ShippableProduct::get()->first(); |
|
41 | 41 | |
42 | - $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
43 | - $tier->ShippableProductID = $discount->ID; |
|
44 | - $tier->write(); |
|
45 | - $tierID = $tier->ID; |
|
46 | - $this->logInWithPermission('Product_CANCRUD'); |
|
42 | + $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
43 | + $tier->ShippableProductID = $discount->ID; |
|
44 | + $tier->write(); |
|
45 | + $tierID = $tier->ID; |
|
46 | + $this->logInWithPermission('Product_CANCRUD'); |
|
47 | 47 | |
48 | - $tier->Quantity = 2; |
|
49 | - $tier->Percentage = 5; |
|
50 | - $tier->write(); |
|
48 | + $tier->Quantity = 2; |
|
49 | + $tier->Percentage = 5; |
|
50 | + $tier->write(); |
|
51 | 51 | |
52 | - $checkTier = ProductDiscountTier::get()->byID($tierID); |
|
52 | + $checkTier = ProductDiscountTier::get()->byID($tierID); |
|
53 | 53 | |
54 | - $this->assertEquals($checkTier->Quantity, 2); |
|
55 | - $this->assertEquals($checkTier->Percentage, 5); |
|
54 | + $this->assertEquals($checkTier->Quantity, 2); |
|
55 | + $this->assertEquals($checkTier->Percentage, 5); |
|
56 | 56 | |
57 | - $this->logOut(); |
|
58 | - } |
|
57 | + $this->logOut(); |
|
58 | + } |
|
59 | 59 | |
60 | - public function testProductDiscountTierDeletion(){ |
|
61 | - $this->logInWithPermission('ADMIN'); |
|
60 | + public function testProductDiscountTierDeletion(){ |
|
61 | + $this->logInWithPermission('ADMIN'); |
|
62 | 62 | |
63 | - $discount = ShippableProduct::get()->first(); |
|
63 | + $discount = ShippableProduct::get()->first(); |
|
64 | 64 | |
65 | - $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
66 | - $tier->ShippableProductID = $discount->ID; |
|
67 | - $tier->write(); |
|
68 | - $tierID = $tier->ID; |
|
65 | + $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
66 | + $tier->ShippableProductID = $discount->ID; |
|
67 | + $tier->write(); |
|
68 | + $tierID = $tier->ID; |
|
69 | 69 | |
70 | - $this->logOut(); |
|
70 | + $this->logOut(); |
|
71 | 71 | |
72 | - $this->logInWithPermission('Product_CANCRUD'); |
|
72 | + $this->logInWithPermission('Product_CANCRUD'); |
|
73 | 73 | |
74 | - $tier->delete(); |
|
75 | - $this->assertTrue(!ProductDiscountTier::get()->byID($tierID)); |
|
74 | + $tier->delete(); |
|
75 | + $this->assertTrue(!ProductDiscountTier::get()->byID($tierID)); |
|
76 | 76 | |
77 | - $this->logOut(); |
|
78 | - } |
|
77 | + $this->logOut(); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | private $product; |
21 | 21 | |
22 | 22 | /** |
23 | - * @param $siteConfig |
|
23 | + * @param SiteConfig|null $siteConfig |
|
24 | 24 | * @return $this |
25 | 25 | */ |
26 | 26 | public function setSiteConfig($siteConfig) |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $fields->push(HiddenField::create(ProductPage::getGeneratedValue($code, 'product_id', |
121 | 121 | $this->product->ID))->setValue($this->product->ID)); |
122 | 122 | $fields->push(HiddenField::create(ProductPage::getGeneratedValue($code, 'price', |
123 | - $this->product->Price))->setValue($this->product->Price));//can't override id |
|
123 | + $this->product->Price))->setValue($this->product->Price)); //can't override id |
|
124 | 124 | $fields->push(HiddenField::create(ProductPage::getGeneratedValue($code, 'weight', |
125 | 125 | $this->product->Weight))->setValue($this->product->Weight)); |
126 | 126 | if ($this->DiscountTitle && $this->ProductDiscountTiers()->exists()) { |
@@ -151,11 +151,11 @@ discard block |
||
151 | 151 | |
152 | 152 | $fields->push(DropdownField::create('quantity', 'Quantity', $quantity)); |
153 | 153 | |
154 | - $fields->push(HeaderField::create('submitPrice', '$' . $this->product->Price, 4)); |
|
154 | + $fields->push(HeaderField::create('submitPrice', '$'.$this->product->Price, 4)); |
|
155 | 155 | |
156 | 156 | |
157 | 157 | $this->extend('updatePurchaseFormFields', $fields); |
158 | - } else { |
|
158 | + }else { |
|
159 | 159 | $fields->push(HeaderField::create('submitPrice', 'Currently Out of Stock'), 4); |
160 | 160 | } |
161 | 161 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | protected function getProductOptionSet() |
193 | 193 | { |
194 | 194 | |
195 | - $assignAvailable = function ($self) { |
|
195 | + $assignAvailable = function($self) { |
|
196 | 196 | $this->extend('updateFoxyStripePurchaseForm', $form); |
197 | 197 | $self->Available = ($self->getAvailability()) ? true : false; |
198 | 198 | }; |
@@ -81,7 +81,9 @@ |
||
81 | 81 | { |
82 | 82 | if ($children = $this->AllChildren()) { |
83 | 83 | foreach ($children as $child) { |
84 | - if (in_array($child->ID, $idList)) continue; |
|
84 | + if (in_array($child->ID, $idList)) { |
|
85 | + continue; |
|
86 | + } |
|
85 | 87 | |
86 | 88 | if ($child instanceof ProductHolder) { |
87 | 89 | $idList[] = $child->ID; |
@@ -85,8 +85,8 @@ |
||
85 | 85 | |
86 | 86 | public function getReceiptLink() |
87 | 87 | { |
88 | - $obj= HTMLVarchar::create(); |
|
89 | - $obj->setValue('<a href="' . $this->ReceiptURL . '" target="_blank" class="cms-panel-link action external-link">view</a>'); |
|
88 | + $obj = HTMLVarchar::create(); |
|
89 | + $obj->setValue('<a href="'.$this->ReceiptURL.'" target="_blank" class="cms-panel-link action external-link">view</a>'); |
|
90 | 90 | return $obj; |
91 | 91 | } |
92 | 92 |
@@ -55,14 +55,18 @@ |
||
55 | 55 | |
56 | 56 | $versions = DB::query('Select * FROM "FoxyStripeProduct_versions" WHERE "RecordID" = ' . $productID); |
57 | 57 | $versionsPostPublish = array(); |
58 | - foreach ($versions as $versionRow) $versionsPostPublish[] = $versionRow; |
|
58 | + foreach ($versions as $versionRow) { |
|
59 | + $versionsPostPublish[] = $versionRow; |
|
60 | + } |
|
59 | 61 | |
60 | 62 | $product2->delete(); |
61 | 63 | $this->assertTrue(!$product2->isPublished()); |
62 | 64 | |
63 | 65 | $versions = DB::query('Select * FROM "FoxyStripeProduct_versions" WHERE "RecordID" = ' . $productID); |
64 | 66 | $versionsPostDelete = array(); |
65 | - foreach ($versions as $versionRow) $versionsPostDelete[] = $versionRow; |
|
67 | + foreach ($versions as $versionRow) { |
|
68 | + $versionsPostDelete[] = $versionRow; |
|
69 | + } |
|
66 | 70 | |
67 | 71 | $this->assertEquals($versionsPostPublish, $versionsPostDelete); |
68 | 72 |
@@ -53,14 +53,14 @@ |
||
53 | 53 | $product2->doPublish(); |
54 | 54 | $this->assertTrue($product2->isPublished()); |
55 | 55 | |
56 | - $versions = DB::query('Select * FROM "ShippableProduct_versions" WHERE "RecordID" = ' . $productID); |
|
56 | + $versions = DB::query('Select * FROM "ShippableProduct_versions" WHERE "RecordID" = '.$productID); |
|
57 | 57 | $versionsPostPublish = array(); |
58 | 58 | foreach ($versions as $versionRow) $versionsPostPublish[] = $versionRow; |
59 | 59 | |
60 | 60 | $product2->delete(); |
61 | 61 | $this->assertTrue(!$product2->isPublished()); |
62 | 62 | |
63 | - $versions = DB::query('Select * FROM "ShippableProduct_versions" WHERE "RecordID" = ' . $productID); |
|
63 | + $versions = DB::query('Select * FROM "ShippableProduct_versions" WHERE "RecordID" = '.$productID); |
|
64 | 64 | $versionsPostDelete = array(); |
65 | 65 | foreach ($versions as $versionRow) $versionsPostDelete[] = $versionRow; |
66 | 66 |
@@ -141,11 +141,15 @@ |
||
141 | 141 | Settings > FoxyStripe > Categories |
142 | 142 | </a>' |
143 | 143 | )); |
144 | - if (class_exists('QuickAddNewExtension')) $catField->useAddNew('FoxyCartProductCategory', $source); |
|
144 | + if (class_exists('QuickAddNewExtension')) { |
|
145 | + $catField->useAddNew('FoxyCartProductCategory', $source); |
|
146 | + } |
|
145 | 147 | |
146 | 148 | // Product Images gridfield |
147 | 149 | $config = GridFieldConfig_RelationEditor::create(); |
148 | - if (class_exists('GridFieldSortableRows')) $config->addComponent(new GridFieldSortableRows('SortOrder')); |
|
150 | + if (class_exists('GridFieldSortableRows')) { |
|
151 | + $config->addComponent(new GridFieldSortableRows('SortOrder')); |
|
152 | + } |
|
149 | 153 | if (class_exists('GridFieldBulkImageUpload')) { |
150 | 154 | $config->addComponent(new GridFieldBulkUpload()); |
151 | 155 | $config->getComponentByType('GridFieldBulkUpload')->setUfConfig('folderName', 'Uploads/ProductImages'); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $previewDescription = ($this->stat('customPreviewDescription')) ? $this->stat('customPreviewDescription') : _t('ProductPage.PreviewImageDescription', 'Image used throughout site to represent this product'); |
123 | 123 | |
124 | 124 | // Cateogry Dropdown field w/ add new |
125 | - $source = function () { |
|
125 | + $source = function() { |
|
126 | 126 | return FoxyCartProductCategory::get()->map()->toArray(); |
127 | 127 | }; |
128 | 128 | $catField = DropdownField::create('CategoryID', _t('ProductPage.Category', 'FoxyCart Category'), $source()) |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if (class_exists('GridFieldSortableRows')) { |
160 | 160 | $config->addComponent(new GridFieldSortableRows('SortOrder')); |
161 | 161 | $products = $this->ProductOptions()->sort('SortOrder'); |
162 | - } else { |
|
162 | + }else { |
|
163 | 163 | $products = $this->ProductOptions(); |
164 | 164 | } |
165 | 165 | $config->removeComponentsByType('GridFieldAddExistingAutocompleter'); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | ->setFolderName('Uploads/Products') |
216 | 216 | ->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']) |
217 | 217 | ->setAllowedMaxFileNumber(1), |
218 | - HeaderField::create('ProductImagesHD', _t('ProductPage.ProductImagesHD' . 'Product Image Gallery'), 2), |
|
218 | + HeaderField::create('ProductImagesHD', _t('ProductPage.ProductImagesHD'.'Product Image Gallery'), 2), |
|
219 | 219 | $prodImagesField |
220 | 220 | ->setDescription(_t( |
221 | 221 | 'ProductPage.ProductImagesDescription', |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $product = ProductPage::get()->byID($this->ID); |
274 | 274 | if (isset($product->ParentID)) { |
275 | 275 | $origParent = $product->ParentID; |
276 | - } else { |
|
276 | + }else { |
|
277 | 277 | $origParent = null; |
278 | 278 | } |
279 | 279 | $currentParent = $this->ParentID; |
@@ -348,8 +348,7 @@ discard block |
||
348 | 348 | { |
349 | 349 | $optionName = ($optionName !== null) ? preg_replace('/\s/', '_', $optionName) : $optionName; |
350 | 350 | return (SiteConfig::current_site_config()->CartValidation) |
351 | - ? FoxyCart_Helper::fc_hash_value($productCode, $optionName, $optionValue, $method, $output, $urlEncode) : |
|
352 | - $optionValue; |
|
351 | + ? FoxyCart_Helper::fc_hash_value($productCode, $optionName, $optionValue, $method, $output, $urlEncode) : $optionValue; |
|
353 | 352 | } |
354 | 353 | |
355 | 354 | /** |
@@ -25,7 +25,7 @@ |
||
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 | ); |
@@ -181,6 +181,9 @@ |
||
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) { |
@@ -72,7 +72,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -79,7 +79,9 @@ |
||
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), |