Skip to content

Commit f15d049

Browse files
committed
Merge remote-tracking branch 'af/MC-13853' into MC-13852
2 parents 5be86d6 + dfc3f64 commit f15d049

File tree

9 files changed

+19
-64
lines changed

9 files changed

+19
-64
lines changed

app/code/Magento/Catalog/Model/Category.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
7272

7373
const CACHE_TAG = 'cat_c';
7474

75-
/**
76-
* Category Store Id
77-
*/
78-
const STORE_ID = 'store_id';
79-
8075
/**#@-*/
8176
protected $_eventPrefix = 'catalog_category';
8277

@@ -573,8 +568,8 @@ public function getStoreIds()
573568
*/
574569
public function getStoreId()
575570
{
576-
if ($this->hasData(self::STORE_ID)) {
577-
return (int)$this->_getData(self::STORE_ID);
571+
if ($this->hasData('store_id')) {
572+
return (int)$this->_getData('store_id');
578573
}
579574
return (int)$this->_storeManager->getStore()->getId();
580575
}
@@ -590,7 +585,7 @@ public function setStoreId($storeId)
590585
if (!is_numeric($storeId)) {
591586
$storeId = $this->_storeManager->getStore($storeId)->getId();
592587
}
593-
$this->setData(self::STORE_ID, $storeId);
588+
$this->setData('store_id', $storeId);
594589
$this->getResource()->setStoreId($storeId);
595590
return $this;
596591
}

app/code/Magento/Catalog/Model/Product.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements
7171
*/
7272
const STORE_ID = 'store_id';
7373

74-
/**
75-
* Product Url path.
76-
*/
77-
const URL_PATH = 'url_path';
78-
7974
/**
8075
* @var string
8176
*/

app/code/Magento/Catalog/Model/Product/Copier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function copy(Product $product)
8383
? $matches[1] . '-' . ($matches[2] + 1)
8484
: $urlKey . '-1';
8585
$duplicate->setUrlKey($urlKey);
86-
$duplicate->setData(Product::URL_PATH, null);
86+
$duplicate->setData('url_path', null);
8787
try {
8888
$duplicate->save();
8989
$isDuplicateSaved = true;

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,6 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
133133
*/
134134
const COL_NAME = 'name';
135135

136-
/**
137-
* Column new_from_date.
138-
*/
139-
const COL_NEW_FROM_DATE = 'new_from_date';
140-
141-
/**
142-
* Column new_to_date.
143-
*/
144-
const COL_NEW_TO_DATE = 'new_to_date';
145-
146136
/**
147137
* Column product website.
148138
*/
@@ -309,7 +299,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
309299
ValidatorInterface::ERROR_INVALID_WEIGHT => 'Product weight is invalid',
310300
ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually',
311301
ValidatorInterface::ERROR_DUPLICATE_MULTISELECT_VALUES => 'Value for multiselect attribute %s contains duplicated values',
312-
ValidatorInterface::ERROR_NEW_TO_DATE => 'Make sure new_to_date is later than or the same as new_from_date',
302+
'invalidNewToDateValue' => 'Make sure new_to_date is later than or the same as new_from_date',
313303
];
314304
//@codingStandardsIgnoreEnd
315305

@@ -331,8 +321,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
331321
Product::COL_TYPE => 'product_type',
332322
Product::COL_PRODUCT_WEBSITES => 'product_websites',
333323
'status' => 'product_online',
334-
'news_from_date' => self::COL_NEW_FROM_DATE,
335-
'news_to_date' => self::COL_NEW_TO_DATE,
324+
'news_from_date' => 'new_from_date',
325+
'news_to_date' => 'new_to_date',
336326
'options_container' => 'display_product_options_in',
337327
'minimal_price' => 'map_price',
338328
'msrp' => 'msrp_price',
@@ -2564,16 +2554,16 @@ public function validateRow(array $rowData, $rowNum)
25642554
}
25652555
}
25662556

2567-
if (!empty($rowData[self::COL_NEW_FROM_DATE]) && !empty($rowData[self::COL_NEW_TO_DATE])
2557+
if (!empty($rowData['new_from_date']) && !empty($rowData['new_to_date'])
25682558
) {
2569-
$newFromTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_FROM_DATE], false));
2570-
$newToTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_TO_DATE], false));
2559+
$newFromTimestamp = strtotime($this->dateTime->formatDate($rowData['new_from_date'], false));
2560+
$newToTimestamp = strtotime($this->dateTime->formatDate($rowData['new_to_date'], false));
25712561
if ($newFromTimestamp > $newToTimestamp) {
25722562
$this->skipRow(
25732563
$rowNum,
2574-
ValidatorInterface::ERROR_NEW_TO_DATE,
2564+
'invalidNewToDateValue',
25752565
$errorLevel,
2576-
$rowData[self::COL_NEW_TO_DATE]
2566+
$rowData['new_to_date']
25772567
);
25782568
}
25792569
}

app/code/Magento/CatalogImportExport/Model/Import/Product/RowValidatorInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ interface RowValidatorInterface extends \Magento\Framework\Validator\ValidatorIn
8787

8888
const ERROR_DUPLICATE_MULTISELECT_VALUES = 'duplicatedMultiselectValues';
8989

90-
const ERROR_NEW_TO_DATE = 'invalidNewToDateValue';
91-
9290
/**
9391
* Value that means all entities (e.g. websites, groups etc.)
9492
*/

app/code/Magento/Directory/Model/Config/Source/WeightUnit.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,14 @@
1414
*/
1515
class WeightUnit implements \Magento\Framework\Option\ArrayInterface
1616
{
17-
/**
18-
* @var string
19-
*/
20-
const CODE_LBS = 'lbs';
21-
22-
/**
23-
* @var string
24-
*/
25-
const CODE_KGS = 'kgs';
26-
2717
/**
2818
* @inheritdoc
2919
*/
3020
public function toOptionArray()
3121
{
3222
return [
33-
['value' => self::CODE_LBS, 'label' => __('lbs')],
34-
['value' => self::CODE_KGS, 'label' => __('kgs')]
23+
['value' => 'lbs', 'label' => __('lbs')],
24+
['value' => 'kgs', 'label' => __('kgs')]
3525
];
3626
}
3727
}

app/code/Magento/Sales/Model/Order/Creditmemo.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ class Creditmemo extends AbstractModel implements EntityInterface, CreditmemoInt
4242

4343
const REPORT_DATE_TYPE_REFUND_CREATED = 'refund_created';
4444

45-
/**
46-
* Allow Zero Grandtotal for Creditmemo path
47-
*/
48-
const XML_PATH_ALLOW_ZERO_GRANDTOTAL = 'sales/zerograndtotal_creditmemo/allow_zero_grandtotal';
49-
5045
/**
5146
* Identifier for order history item
5247
*
@@ -658,7 +653,7 @@ public function isValidGrandTotal()
658653
public function isAllowZeroGrandTotal()
659654
{
660655
$isAllowed = $this->scopeConfig->getValue(
661-
self::XML_PATH_ALLOW_ZERO_GRANDTOTAL,
656+
'sales/zerograndtotal_creditmemo/allow_zero_grandtotal',
662657
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
663658
);
664659
return $isAllowed;

app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ abstract class AbstractCarrierOnline extends AbstractCarrier
2929

3030
const GUAM_REGION_CODE = 'GU';
3131

32-
const SPAIN_COUNTRY_ID = 'ES';
33-
34-
const CANARY_ISLANDS_COUNTRY_ID = 'IC';
35-
36-
const SANTA_CRUZ_DE_TENERIFE_REGION_ID = 'Santa Cruz de Tenerife';
37-
38-
const LAS_PALMAS_REGION_ID = 'Las Palmas';
39-
4032
/**
4133
* Array of quotes
4234
*

app/code/Magento/Ups/Model/Carrier.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,11 @@ public function setRequest(RateRequest $request)
333333
}
334334

335335
// For UPS, Las Palmas and Santa Cruz de Tenerife will be represented by Canary Islands country
336-
if ($destCountry === self::SPAIN_COUNTRY_ID &&
337-
($request->getDestRegionCode() === self::LAS_PALMAS_REGION_ID
338-
|| $request->getDestRegionCode() === self::SANTA_CRUZ_DE_TENERIFE_REGION_ID)
336+
if ($destCountry === 'ES' &&
337+
($request->getDestRegionCode() === 'Las Palmas'
338+
|| $request->getDestRegionCode() === 'Santa Cruz de Tenerife')
339339
) {
340-
$destCountry = self::CANARY_ISLANDS_COUNTRY_ID;
340+
$destCountry = 'IC';
341341
}
342342

343343
$country = $this->_countryFactory->create()->load($destCountry);

0 commit comments

Comments
 (0)