@@ -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; |
@@ -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 | |
@@ -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'); |
@@ -30,10 +30,16 @@ |
||
| 30 | 30 | // protected static $cart_url = 'https://yourdomain.foxycart.com/cart'; |
| 31 | 31 | protected static $cart_url; |
| 32 | 32 | |
| 33 | + /** |
|
| 34 | + * @param string $storeName |
|
| 35 | + */ |
|
| 33 | 36 | public static function setCartURL($storeName = null){ |
| 34 | 37 | self::$cart_url = 'https://'.$storeName.'.faxycart.com/cart'; |
| 35 | 38 | } |
| 36 | 39 | |
| 40 | + /** |
|
| 41 | + * @param string $secret |
|
| 42 | + */ |
|
| 37 | 43 | public static function setSecret($secret = null){ |
| 38 | 44 | self::$secret = $secret; |
| 39 | 45 | } |
@@ -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) { |
@@ -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), |