@@ -2,13 +2,13 @@ |
||
| 2 | 2 | |
| 3 | 3 | class OrderAdmin extends ModelAdmin { |
| 4 | 4 | |
| 5 | - public static $managed_models = array( |
|
| 6 | - 'Order' |
|
| 7 | - ); |
|
| 5 | + public static $managed_models = array( |
|
| 6 | + 'Order' |
|
| 7 | + ); |
|
| 8 | 8 | |
| 9 | - static $url_segment = 'orders'; |
|
| 9 | + static $url_segment = 'orders'; |
|
| 10 | 10 | |
| 11 | - static $menu_title = 'Orders'; |
|
| 11 | + static $menu_title = 'Orders'; |
|
| 12 | 12 | |
| 13 | 13 | public function getEditForm($id = null, $fields = null) { |
| 14 | 14 | $form = parent::getEditForm($id, $fields); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @package forms |
| 49 | 49 | * @subpackage fields-basic |
| 50 | 50 | */ |
| 51 | -class FoxyStripeDropdownField extends DropdownField{ |
|
| 51 | +class FoxyStripeDropdownField extends DropdownField { |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Mark certain elements as disabled, |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | * |
| 57 | 57 | * @param array $items Collection of array keys, as defined in the $source array |
| 58 | 58 | */ |
| 59 | - public function setDisabledItems($items){ |
|
| 59 | + public function setDisabledItems($items) { |
|
| 60 | 60 | $controller = Controller::curr(); |
| 61 | 61 | $code = $controller->data()->Code; |
| 62 | 62 | $updated = []; |
| 63 | - if(is_array($items) && !empty($items)){ |
|
| 64 | - foreach($items as $item){ |
|
| 63 | + if (is_array($items) && !empty($items)) { |
|
| 64 | + foreach ($items as $item) { |
|
| 65 | 65 | array_push($updated, ProductPage::getGeneratedValue($code, $this->getName(), $item, 'value')); |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | $controller = Controller::curr(); |
| 77 | 77 | $code = $controller->data()->Code; |
| 78 | 78 | $updated = []; |
| 79 | - if(is_array($source) && !empty($source)){ |
|
| 80 | - foreach($source as $key => $val){ |
|
| 79 | + if (is_array($source) && !empty($source)) { |
|
| 80 | + foreach ($source as $key => $val) { |
|
| 81 | 81 | $updated[ProductPage::getGeneratedValue($code, $this->getName(), $key, 'value')] = $val; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -50,41 +50,41 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | class FoxyStripeDropdownField extends DropdownField{ |
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Mark certain elements as disabled, |
|
| 55 | - * regardless of the {@link setDisabled()} settings. |
|
| 56 | - * |
|
| 57 | - * @param array $items Collection of array keys, as defined in the $source array |
|
| 53 | + /** |
|
| 54 | + * Mark certain elements as disabled, |
|
| 55 | + * regardless of the {@link setDisabled()} settings. |
|
| 56 | + * |
|
| 57 | + * @param array $items Collection of array keys, as defined in the $source array |
|
| 58 | 58 | * @return $this |
| 59 | - */ |
|
| 60 | - public function setDisabledItems($items){ |
|
| 61 | - $controller = Controller::curr(); |
|
| 62 | - $code = $controller->data()->Code; |
|
| 63 | - $updated = []; |
|
| 64 | - if(is_array($items) && !empty($items)){ |
|
| 65 | - foreach($items as $item){ |
|
| 66 | - array_push($updated, FoxyStripeProduct::getGeneratedValue($code, $this->getName(), $item, 'value')); |
|
| 67 | - } |
|
| 68 | - } |
|
| 69 | - $this->disabledItems = $updated; |
|
| 70 | - return $this; |
|
| 71 | - } |
|
| 59 | + */ |
|
| 60 | + public function setDisabledItems($items){ |
|
| 61 | + $controller = Controller::curr(); |
|
| 62 | + $code = $controller->data()->Code; |
|
| 63 | + $updated = []; |
|
| 64 | + if(is_array($items) && !empty($items)){ |
|
| 65 | + foreach($items as $item){ |
|
| 66 | + array_push($updated, FoxyStripeProduct::getGeneratedValue($code, $this->getName(), $item, 'value')); |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | + $this->disabledItems = $updated; |
|
| 70 | + return $this; |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * @param array $source |
|
| 73 | + /** |
|
| 74 | + * @param array $source |
|
| 75 | 75 | * @return $this |
| 76 | - */ |
|
| 77 | - public function setSource($source) { |
|
| 78 | - $controller = Controller::curr(); |
|
| 79 | - $code = $controller->data()->Code; |
|
| 80 | - $updated = []; |
|
| 81 | - if(is_array($source) && !empty($source)){ |
|
| 82 | - foreach($source as $key => $val){ |
|
| 83 | - $updated[FoxyStripeProduct::getGeneratedValue($code, $this->getName(), $key, 'value')] = $val; |
|
| 84 | - } |
|
| 85 | - } |
|
| 86 | - $this->source = $updated; |
|
| 87 | - return $this; |
|
| 88 | - } |
|
| 76 | + */ |
|
| 77 | + public function setSource($source) { |
|
| 78 | + $controller = Controller::curr(); |
|
| 79 | + $code = $controller->data()->Code; |
|
| 80 | + $updated = []; |
|
| 81 | + if(is_array($source) && !empty($source)){ |
|
| 82 | + foreach($source as $key => $val){ |
|
| 83 | + $updated[FoxyStripeProduct::getGeneratedValue($code, $this->getName(), $key, 'value')] = $val; |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | + $this->source = $updated; |
|
| 87 | + return $this; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | 90 | } |
@@ -2,30 +2,30 @@ |
||
| 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 | - $pref = FoxyCart::getKeyPrefix(); |
|
| 18 | - $siteConf = SiteConfig::current_site_config(); |
|
| 16 | + function testStoreKey(){ |
|
| 17 | + $pref = FoxyCart::getKeyPrefix(); |
|
| 18 | + $siteConf = SiteConfig::current_site_config(); |
|
| 19 | 19 | |
| 20 | - $this->assertTrue(ctype_alnum($siteConf->StoreKey)); |
|
| 20 | + $this->assertTrue(ctype_alnum($siteConf->StoreKey)); |
|
| 21 | 21 | $this->assertEquals(strlen($siteConf->StoreKey), 60); |
| 22 | 22 | $this->assertEquals(substr($siteConf->StoreKey, 0, 6), $pref); |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - function testStoreName(){ |
|
| 26 | - $siteConf = SiteConfig::current_site_config(); |
|
| 25 | + function testStoreName(){ |
|
| 26 | + $siteConf = SiteConfig::current_site_config(); |
|
| 27 | 27 | |
| 28 | 28 | $this->assertEquals($siteConf->StoreName, 'foxystripe'); |
| 29 | - } |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | 31 | } |
@@ -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'); |
@@ -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 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | 'Image used throughout site to represent this product'); |
| 92 | 92 | |
| 93 | 93 | // Cateogry Dropdown field w/ add new |
| 94 | - $source = function () { |
|
| 94 | + $source = function() { |
|
| 95 | 95 | return ProductCategory::get()->map()->toArray(); |
| 96 | 96 | }; |
| 97 | 97 | $catField = DropdownField::create('CategoryID', _t('ProductPage.Category', 'FoxyCart Category'), $source()) |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if (class_exists('GridFieldSortableRows')) { |
| 136 | 136 | $config->addComponent(new GridFieldSortableRows('SortOrder')); |
| 137 | 137 | $products = $this->ProductOptions()->sort('SortOrder'); |
| 138 | - } else { |
|
| 138 | + }else { |
|
| 139 | 139 | $products = $this->ProductOptions(); |
| 140 | 140 | } |
| 141 | 141 | $config->removeComponentsByType('GridFieldAddExistingAutocompleter'); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | ->setFolderName('Uploads/Products') |
| 192 | 192 | ->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png')) |
| 193 | 193 | ->setAllowedMaxFileNumber(1), |
| 194 | - HeaderField::create('ProductImagesHD', _t('ProductPage.ProductImagesHD' . 'Product Image Gallery'), 2), |
|
| 194 | + HeaderField::create('ProductImagesHD', _t('ProductPage.ProductImagesHD'.'Product Image Gallery'), 2), |
|
| 195 | 195 | $prodImagesField |
| 196 | 196 | ->setDescription(_t( |
| 197 | 197 | 'ProductPage.ProductImagesDescription', |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $product = ProductPage::get()->byID($this->ID); |
| 253 | 253 | if (isset($product->ParentID)) { |
| 254 | 254 | $origParent = $product->ParentID; |
| 255 | - } else { |
|
| 255 | + }else { |
|
| 256 | 256 | $origParent = null; |
| 257 | 257 | } |
| 258 | 258 | $currentParent = $this->ParentID; |
@@ -333,14 +333,13 @@ discard block |
||
| 333 | 333 | ) { |
| 334 | 334 | $optionName = ($optionName !== null) ? preg_replace('/\s/', '_', $optionName) : $optionName; |
| 335 | 335 | return (SiteConfig::current_site_config()->CartValidation) |
| 336 | - ? FoxyCart_Helper::fc_hash_value($productCode, $optionName, $optionValue, $method, $output, $urlEncode) : |
|
| 337 | - $optionValue; |
|
| 336 | + ? FoxyCart_Helper::fc_hash_value($productCode, $optionName, $optionValue, $method, $output, $urlEncode) : $optionValue; |
|
| 338 | 337 | } |
| 339 | 338 | |
| 340 | 339 | // get FoxyCart Store Name for JS call |
| 341 | 340 | public function getCartScript() |
| 342 | 341 | { |
| 343 | - return '<script src="https://cdn.foxycart.com/' . FoxyCart::getFoxyCartStoreName() . '/loader.js" async defer></script>'; |
|
| 342 | + return '<script src="https://cdn.foxycart.com/'.FoxyCart::getFoxyCartStoreName().'/loader.js" async defer></script>'; |
|
| 344 | 343 | } |
| 345 | 344 | |
| 346 | 345 | public function getDiscountFieldValue() |
@@ -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'); |