Skip to content

Commit

Permalink
Merge pull request #3725 from magento-epam/EPAM-PR-38-39-40
Browse files Browse the repository at this point in the history
* [MAGETWO-91631](https://jira.corp.magento.com/browse/MAGETWO-91631) [Magento Cloud]Prefix in checkout not starting with blank value
* [MAGETWO-95836](https://jira.corp.magento.com/browse/MAGETWO-95836) [Magento Cloud] If a product has a custom attributes which requires a Unique Value, it cannot be saved when there's an active Scheduled Update
* [MAGETWO-96852](https://jira.corp.magento.com/browse/MAGETWO-96852) [2.3.x] Impossible to sort Root Categories via drag'n'drop
* [MAGETWO-96421](https://jira.corp.magento.com/browse/MAGETWO-96421) [2.3.x] Header Minicart ,Shopping cart page and Checkout page show incorrect product name
* [MAGETWO-95812](https://jira.corp.magento.com/browse/MAGETWO-95812) Required RMA Attributes are not validated while Customer submits a return
* [MAGETWO-95186](https://jira.corp.magento.com/browse/MAGETWO-95186) [2.3] Incorrect table rates shipping charge at check out with cart price rule
* [MC-4316](https://jira.corp.magento.com/browse/MC-4316) Tax calculation process does not follow "Apply Tax On" setting - GitHub #14469
* [MAGETWO-96545](https://jira.corp.magento.com/browse/MAGETWO-96545) Wrong calculation of invoiced items in shipment document in order with bundle product after partial invoice
* [MC-10963](https://jira.corp.magento.com/browse/MC-10963) Can only export default store view items when upgrade to 2.3.0
* [MAGETWO-64324](https://jira.corp.magento.com/browse/MAGETWO-64324) WebAPI: product "has_options" flag not updated when options added via API
* [MC-10938](https://jira.corp.magento.com/browse/MC-10938) 2.3.0 - clearing pub/static makes me login 3 times
* [MC-10944](https://jira.corp.magento.com/browse/MC-10944) [B2B] My Quote disappears from Customer account when FPC is on
* [MC-5542](https://jira.corp.magento.com/browse/MC-5542) Fix testOutputErrorsWithMessageCategoryAndTrace on PHP 7.2
* [MAGETWO-58841](https://jira.corp.magento.com/browse/MAGETWO-58841) API call with pageSize and currentPage > items should return error
  • Loading branch information
rganin authored Feb 12, 2019
2 parents 7cdcb27 + 17c10c5 commit 49a25f2
Show file tree
Hide file tree
Showing 77 changed files with 1,183 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public function getChildren($item)
}

/**
* Check if item can be shipped separately
*
* @param mixed $item
* @return bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
Expand Down Expand Up @@ -136,6 +138,8 @@ public function isShipmentSeparately($item = null)
}

/**
* Check if child items calculated
*
* @param mixed $item
* @return bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
Expand Down Expand Up @@ -174,6 +178,8 @@ public function isChildCalculated($item = null)
}

/**
* Retrieve selection attributes values
*
* @param mixed $item
* @return mixed|null
*/
Expand All @@ -191,6 +197,8 @@ public function getSelectionAttributes($item)
}

/**
* Retrieve order item options array
*
* @return array
*/
public function getOrderOptions()
Expand All @@ -212,6 +220,8 @@ public function getOrderOptions()
}

/**
* Retrieve order item
*
* @return mixed
*/
public function getOrderItem()
Expand All @@ -223,6 +233,8 @@ public function getOrderItem()
}

/**
* Get html info for item
*
* @param mixed $item
* @return string
*/
Expand All @@ -245,6 +257,8 @@ public function getValueHtml($item)
}

/**
* Check if we can show price info for this item
*
* @param object $item
* @return bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,17 @@
<?php endif; ?>

<?php foreach ($items as $_item): ?>
<?php
$shipTogether = ($_item->getOrderItem()->getProductType() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) ?
!$_item->getOrderItem()->isShipSeparately() : !$_item->getOrderItem()->getParentItem()->isShipSeparately()
?>
<?php $block->setPriceDataObject($_item) ?>
<?php if ($_item->getOrderItem()->getParentItem()): ?>
<?php
if ($shipTogether) {
continue;
}
?>
<?php $attributes = $block->getSelectionAttributes($_item) ?>
<?php if ($_prevOptionId != $attributes['option_id']): ?>
<tr>
Expand Down Expand Up @@ -60,14 +69,14 @@
</td>
<?php endif; ?>
<td class="col-price">
<?php if ($block->canShowPriceInfo($_item)): ?>
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
<?= $block->getColumnHtml($_item, 'price') ?>
<?php else: ?>
&nbsp;
<?php endif; ?>
</td>
<td class="col-qty">
<?php if ($block->canShowPriceInfo($_item)): ?>
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
<table class="qty-table">
<tr>
<th><?= /* @escapeNotVerified */ __('Ordered') ?></th>
Expand Down Expand Up @@ -116,7 +125,7 @@
<?php endif; ?>
</td>
<td class="col-qty-invoice">
<?php if ($block->canShowPriceInfo($_item)): ?>
<?php if ($block->canShowPriceInfo($_item) || $shipTogether): ?>
<?php if ($block->canEditQty()) : ?>
<input type="text"
class="input-text admin__control-text qty-input"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public function getCategory()
}

/**
* Get category id
*
* @return int|string|null
*/
public function getCategoryId()
Expand All @@ -78,6 +80,8 @@ public function getCategoryId()
}

/**
* Get category name
*
* @return string
*/
public function getCategoryName()
Expand All @@ -86,6 +90,8 @@ public function getCategoryName()
}

/**
* Get category path
*
* @return mixed
*/
public function getCategoryPath()
Expand All @@ -97,6 +103,8 @@ public function getCategoryPath()
}

/**
* Check store root category
*
* @return bool
*/
public function hasStoreRootCategory()
Expand All @@ -109,6 +117,8 @@ public function hasStoreRootCategory()
}

/**
* Get store from request
*
* @return Store
*/
public function getStore()
Expand All @@ -118,6 +128,8 @@ public function getStore()
}

/**
* Get root category for tree
*
* @param mixed|null $parentNodeCategory
* @param int $recursionLevel
* @return Node|array|null
Expand Down Expand Up @@ -149,10 +161,11 @@ public function getRoot($parentNodeCategory = null, $recursionLevel = 3)

$root = $tree->getNodeById($rootId);

if ($root && $rootId != \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
if ($root) {
$root->setIsVisible(true);
} elseif ($root && $root->getId() == \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
$root->setName(__('Root'));
if ($root->getId() == \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
$root->setName(__('Root'));
}
}

$this->_coreRegistry->register('root', $root);
Expand All @@ -162,6 +175,8 @@ public function getRoot($parentNodeCategory = null, $recursionLevel = 3)
}

/**
* Get Default Store Id
*
* @return int
*/
protected function _getDefaultStoreId()
Expand All @@ -170,6 +185,8 @@ protected function _getDefaultStoreId()
}

/**
* Get category collection
*
* @return \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
*/
public function getCategoryCollection()
Expand Down Expand Up @@ -227,6 +244,8 @@ public function getRootByIds($ids)
}

/**
* Get category node for tree
*
* @param mixed $parentNodeCategory
* @param int $recursionLevel
* @return Node
Expand All @@ -249,6 +268,8 @@ public function getNode($parentNodeCategory, $recursionLevel = 2)
}

/**
* Get category save url
*
* @param array $args
* @return string
*/
Expand All @@ -260,6 +281,8 @@ public function getSaveUrl(array $args = [])
}

/**
* Get category edit url
*
* @return string
*/
public function getEditUrl()
Expand Down
10 changes: 7 additions & 3 deletions app/code/Magento/Catalog/Model/CategoryList.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface;

/**
* Class for getting category list.
*/
class CategoryList implements CategoryListInterface
{
/**
Expand Down Expand Up @@ -64,7 +67,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getList(SearchCriteriaInterface $searchCriteria)
{
Expand All @@ -73,10 +76,11 @@ public function getList(SearchCriteriaInterface $searchCriteria)
$this->extensionAttributesJoinProcessor->process($collection);

$this->collectionProcessor->process($searchCriteria, $collection);
$collection->load();

$items = [];
foreach ($collection->getAllIds() as $id) {
$items[] = $this->categoryRepository->get($id);
foreach ($collection->getItems() as $category) {
$items[] = $this->categoryRepository->get($category->getId());
}

/** @var CategorySearchResultsInterface $searchResult */
Expand Down
22 changes: 13 additions & 9 deletions app/code/Magento/Catalog/Model/Product/Option/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Magento\Framework\App\ObjectManager;

/**
* Product custom options repository
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Repository implements \Magento\Catalog\Api\ProductCustomOptionRepositoryInterface
Expand Down Expand Up @@ -83,7 +85,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getList($sku)
{
Expand All @@ -92,7 +94,7 @@ public function getList($sku)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getProductOptions(ProductInterface $product, $requiredOnly = false)
{
Expand All @@ -104,7 +106,7 @@ public function getProductOptions(ProductInterface $product, $requiredOnly = fal
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function get($sku, $optionId)
{
Expand All @@ -117,7 +119,7 @@ public function get($sku, $optionId)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function delete(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $entity)
{
Expand All @@ -126,7 +128,7 @@ public function delete(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $e
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function duplicate(
\Magento\Catalog\Api\Data\ProductInterface $product,
Expand All @@ -142,7 +144,7 @@ public function duplicate(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $option)
{
Expand Down Expand Up @@ -184,7 +186,7 @@ public function save(\Magento\Catalog\Api\Data\ProductCustomOptionInterface $opt
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function deleteByIdentifier($sku, $optionId)
{
Expand All @@ -209,8 +211,8 @@ public function deleteByIdentifier($sku, $optionId)
/**
* Mark original values for removal if they are absent among new values
*
* @param $newValues array
* @param $originalValues \Magento\Catalog\Model\Product\Option\Value[]
* @param array $newValues
* @param \Magento\Catalog\Model\Product\Option\Value[] $originalValues
* @return array
*/
protected function markRemovedValues($newValues, $originalValues)
Expand All @@ -234,6 +236,8 @@ protected function markRemovedValues($newValues, $originalValues)
}

/**
* Get hydrator pool
*
* @return \Magento\Framework\EntityManager\HydratorPool
* @deprecated 101.0.0
*/
Expand Down
6 changes: 6 additions & 0 deletions app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ public function __construct(
}

/**
* Perform action on relation/extension attribute
*
* @param object $entity
* @param array $arguments
* @return \Magento\Catalog\Api\Data\ProductInterface|object
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function execute($entity, $arguments = [])
{
if ($entity->getOptionsSaved()) {
return $entity;
}

$options = $entity->getOptions();
$optionIds = [];

Expand Down
Loading

0 comments on commit 49a25f2

Please sign in to comment.