@@ -34,6 +34,9 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | + /** |
|
| 38 | + * @param string $encrypted |
|
| 39 | + */ |
|
| 37 | 40 | public function handleDataFeed($encrypted, $decrypted){ |
| 38 | 41 | //handle encrypted & decrypted data |
| 39 | 42 | $orders = new SimpleXMLElement($decrypted); |
@@ -79,6 +82,10 @@ discard block |
||
| 79 | 82 | } |
| 80 | 83 | } |
| 81 | 84 | |
| 85 | + /** |
|
| 86 | + * @param SimpleXMLElement $orders |
|
| 87 | + * @param DataObject $transaction |
|
| 88 | + */ |
|
| 82 | 89 | public function parseOrderInfo($orders, $transaction) { |
| 83 | 90 | |
| 84 | 91 | foreach ($orders->transactions->transaction as $order) { |
@@ -95,6 +102,10 @@ discard block |
||
| 95 | 102 | } |
| 96 | 103 | } |
| 97 | 104 | |
| 105 | + /** |
|
| 106 | + * @param SimpleXMLElement $orders |
|
| 107 | + * @param DataObject $transaction |
|
| 108 | + */ |
|
| 98 | 109 | public function parseOrderCustomer($orders, $transaction) { |
| 99 | 110 | |
| 100 | 111 | foreach ($orders->transactions->transaction as $order) { |
@@ -133,6 +144,10 @@ discard block |
||
| 133 | 144 | } |
| 134 | 145 | } |
| 135 | 146 | |
| 147 | + /** |
|
| 148 | + * @param SimpleXMLElement $orders |
|
| 149 | + * @param DataObject $transaction |
|
| 150 | + */ |
|
| 136 | 151 | public function parseOrderDetails($orders, $transaction) { |
| 137 | 152 | |
| 138 | 153 | // remove previous OrderDetails so we don't end up with duplicates |
@@ -269,7 +269,9 @@ |
||
| 269 | 269 | self::$log[] = '<strong>Options:</strong> <pre>'.htmlspecialchars(print_r($options, true)).'</pre>'; |
| 270 | 270 | unset( $form_part_signed ); |
| 271 | 271 | foreach ($options as $option) { |
| 272 | - if( !isset($form_part_signed) ) $form_part_signed = $list[0]; |
|
| 272 | + if( !isset($form_part_signed) ) { |
|
| 273 | + $form_part_signed = $list[0]; |
|
| 274 | + } |
|
| 273 | 275 | $option_signed = preg_replace( |
| 274 | 276 | '%'.preg_quote($option[1]).preg_quote($option[2]).preg_quote($option[1]).'%', |
| 275 | 277 | $option[1].self::fc_hash_value($code, $list[2], $option[2], 'value', FALSE).$option[1], |
@@ -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 | } |
@@ -81,13 +81,17 @@ discard block |
||
| 81 | 81 | public static function getCustomer($Member = null) { |
| 82 | 82 | |
| 83 | 83 | // throw error if no $Member Object |
| 84 | - if (!isset($Member)) trigger_error('No Member set', E_USER_ERROR); |
|
| 84 | + if (!isset($Member)) { |
|
| 85 | + trigger_error('No Member set', E_USER_ERROR); |
|
| 86 | + } |
|
| 85 | 87 | |
| 86 | 88 | // grab customer record from API |
| 87 | 89 | |
| 88 | 90 | $foxyData = array(); |
| 89 | 91 | $foxyData["api_action"] = "customer_get"; |
| 90 | - if ($Member->Customer_ID) $foxyData["customer_id"] = $Member->Customer_ID; |
|
| 92 | + if ($Member->Customer_ID) { |
|
| 93 | + $foxyData["customer_id"] = $Member->Customer_ID; |
|
| 94 | + } |
|
| 91 | 95 | $foxyData["customer_email"] = $Member->Email; |
| 92 | 96 | |
| 93 | 97 | return self::getAPIRequest($foxyData); |
@@ -102,7 +106,9 @@ discard block |
||
| 102 | 106 | $foxyData = array(); |
| 103 | 107 | $foxyData["api_action"] = "customer_save"; |
| 104 | 108 | // customer_id will be 0 if created in SilverStripe. |
| 105 | - if ($Member->Customer_ID) $foxyData["customer_id"] = $Member->Customer_ID; |
|
| 109 | + if ($Member->Customer_ID) { |
|
| 110 | + $foxyData["customer_id"] = $Member->Customer_ID; |
|
| 111 | + } |
|
| 106 | 112 | $foxyData["customer_email"] = $Member->Email; |
| 107 | 113 | $foxyData["customer_password_hash"] = $Member->Password; |
| 108 | 114 | $foxyData["customer_password_salt"] = $Member->Salt; |
@@ -65,7 +65,9 @@ |
||
| 65 | 65 | $groupField = DropdownField::create('ProductOptionGroupID', _t("OptionItem.Group", "Group"), $groups()) |
| 66 | 66 | ->setEmptyString('') |
| 67 | 67 | ->setDescription(_t('OptionItem.GroupDescription', 'Name of this group of options. Managed in <a href="admin/settings">Settings > FoxyStripe > Option Groups</a>')); |
| 68 | - if (class_exists('QuickAddNewExtension')) $groupField->useAddNew('OptionGroup', $groups, $groupFields); |
|
| 68 | + if (class_exists('QuickAddNewExtension')) { |
|
| 69 | + $groupField->useAddNew('OptionGroup', $groups, $groupFields); |
|
| 70 | + } |
|
| 69 | 71 | |
| 70 | 72 | $fields->addFieldsToTab('Root.Main', array( |
| 71 | 73 | HeaderField::create('DetailsHD', _t("OptionItem.DetailsHD", "Product Option Details"), 2), |
@@ -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) |
@@ -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'); |