Commit c64862c7 by dhn

Merge branch 'developer' of http://47.99.244.21:9999/root/joshine into Branch_developer

parents 8966b011 17d0c5f5
......@@ -59,7 +59,7 @@ class Images extends \Magento\Framework\View\Element\Template
/**
* @return int
*/
public function getReviewId(): int
public function getReviewId()
{
return $this->reviewId;
}
......@@ -69,13 +69,13 @@ class Images extends \Magento\Framework\View\Element\Template
*
* @return $this
*/
public function setReviewId($reviewId): Images
public function setReviewId($reviewId)
{
$this->reviewId = $reviewId;
return $this;
}
public function setProductId($productId): Images
public function setProductId($productId)
{
$this->productId = $productId;
return $this;
......@@ -96,7 +96,7 @@ class Images extends \Magento\Framework\View\Element\Template
}
public function getFullImagePath($item): string
public function getFullImagePath($item)
{
return $this->imageHelper->getFullPath($item->getPath());
}
......@@ -106,7 +106,7 @@ class Images extends \Magento\Framework\View\Element\Template
* @return string
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function getResizedImagePath($item): string
public function getResizedImagePath($item)
{
return $this->imageHelper->resize($item->getPath(), self::REVIEW_COVER_WIDTH);
}
......@@ -116,7 +116,7 @@ class Images extends \Magento\Framework\View\Element\Template
* @return string
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function getResizedImagePathByLimit($item, $width): string
public function getResizedImagePathByLimit($item, $width)
{
return $this->imageHelper->resize($item->getPath(), $width);
}
......
......@@ -2,6 +2,7 @@
namespace Joshine\Sales\Plugin;
use \Magento\Catalog\Helper\Image as ImageHelper;
use Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer;
class DefaultRendererPlugin {
......@@ -40,4 +41,13 @@ class DefaultRendererPlugin {
return $result;
}
public function afterGetColumns(DefaultRenderer $subject, $result)
{
if (isset($result['image'])) {
unset($result['image']);
$result = array_merge(['image'=>'col-image'], $result);
}
return $result;
}
}
\ No newline at end of file
<?php
namespace Joshine\Sales\Plugin;
use \Magento\Catalog\Helper\Image as ImageHelper;
use Magento\Sales\Block\Adminhtml\Order\View\Items;
class ItemsSortPlugin {
public function afterGetColumns(Items $subject, $result)
{
if (isset($result['image'])) {
unset($result['image']);
$result = array_merge(['image'=>'Product Image'], $result);
}
return $result;
}
}
......@@ -3,4 +3,7 @@
<type name="Magento\Sales\Block\Adminhtml\Order\View\Items\Renderer\DefaultRenderer">
<plugin name="order-view-image" type="Joshine\Sales\Plugin\DefaultRendererPlugin" sortOrder="1" />
</type>
<type name="\Magento\Sales\Block\Adminhtml\Order\View\Items">
<plugin name="order-item-sort" type="Joshine\Sales\Plugin\ItemsSortPlugin" sortOrder="1" />
</type>
</config>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment