Skip to content

Commit eb6b977

Browse files
committed
1.75.0 (FINAL RELEASE)
1 parent 9b597da commit eb6b977

File tree

61 files changed

+782
-460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+782
-460
lines changed

Block/Adminhtml/Amazon/Listing/Product/Add/SourceMode/Category/Grid.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace Ess\M2ePro\Block\Adminhtml\Amazon\Listing\Product\Add\SourceMode\Category;
1010

11+
use Ess\M2ePro\Model\ResourceModel\Magento\Product\Filter\ExcludeSimpleProductsInVariation;
12+
1113
class Grid extends \Ess\M2ePro\Block\Adminhtml\Amazon\Listing\Product\Add\SourceMode\Product\Grid
1214
{
1315
private $selectedIds = [];
@@ -24,6 +26,7 @@ class Grid extends \Ess\M2ePro\Block\Adminhtml\Amazon\Listing\Product\Add\Source
2426
private $globalDataHelper;
2527

2628
public function __construct(
29+
ExcludeSimpleProductsInVariation $excludeSimpleProductsInVariation,
2730
\Ess\M2ePro\Helper\Magento\Category $magentoCategoryHelper,
2831
\Ess\M2ePro\Model\ResourceModel\Magento\Product\CollectionFactory $magentoProductCollectionFactory,
2932
\Magento\Catalog\Model\Product\Type $type,
@@ -39,6 +42,7 @@ public function __construct(
3942
$this->magentoCategoryHelper = $magentoCategoryHelper;
4043
$this->databaseHelper = $databaseHelper;
4144
parent::__construct(
45+
$excludeSimpleProductsInVariation,
4246
$magentoProductCollectionFactory,
4347
$type,
4448
$websiteFactory,

Block/Adminhtml/Amazon/Listing/Product/Add/SourceMode/Product/Grid.php

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,24 @@
88

99
namespace Ess\M2ePro\Block\Adminhtml\Amazon\Listing\Product\Add\SourceMode\Product;
1010

11+
use Ess\M2ePro\Block\Adminhtml\Listing\Product\ShowOthersListingsProductsFilter;
12+
use Ess\M2ePro\Model\ResourceModel\Magento\Product\Filter\ExcludeSimpleProductsInVariation;
13+
1114
class Grid extends \Ess\M2ePro\Block\Adminhtml\Magento\Product\Grid
1215
{
1316
private $listing;
1417

1518
protected $magentoProductCollectionFactory;
1619
protected $type;
1720
protected $websiteFactory;
18-
/** @var \Ess\M2ePro\Helper\Magento\Product */
19-
protected $magentoProductHelper;
20-
/** @var \Ess\M2ePro\Helper\Data\GlobalData */
21-
private $globalDataHelper;
21+
22+
protected \Ess\M2ePro\Helper\Magento\Product $magentoProductHelper;
23+
private \Ess\M2ePro\Helper\Data\GlobalData $globalDataHelper;
24+
/** @var \Ess\M2ePro\Model\ResourceModel\Magento\Product\Filter\ExcludeSimpleProductsInVariation */
25+
private ExcludeSimpleProductsInVariation $excludeSimpleProductsInVariation;
2226

2327
public function __construct(
28+
ExcludeSimpleProductsInVariation $excludeSimpleProductsInVariation,
2429
\Ess\M2ePro\Model\ResourceModel\Magento\Product\CollectionFactory $magentoProductCollectionFactory,
2530
\Magento\Catalog\Model\Product\Type $type,
2631
\Magento\Store\Model\WebsiteFactory $websiteFactory,
@@ -36,6 +41,7 @@ public function __construct(
3641
$this->websiteFactory = $websiteFactory;
3742
$this->magentoProductHelper = $magentoProductHelper;
3843
$this->globalDataHelper = $globalDataHelper;
44+
$this->excludeSimpleProductsInVariation = $excludeSimpleProductsInVariation;
3945
parent::__construct($context, $backendHelper, $dataHelper, $data);
4046
}
4147

@@ -88,7 +94,7 @@ protected function _prepareCollection()
8894
// Hide products others listings
8995
// ---------------------------------------
9096
$hideParam = true;
91-
if ($this->getRequest()->has('show_products_others_listings')) {
97+
if ($this->getRequest()->has(ShowOthersListingsProductsFilter::PARAM_NAME_SHOW_PRODUCT_IN_OTHER_LISTING)) {
9298
$hideParam = false;
9399
}
94100

@@ -106,6 +112,16 @@ protected function _prepareCollection()
106112
}
107113
// ---------------------------------------
108114

115+
$includeSimpleProductsInVariation = $this
116+
->getRequest()
117+
->has(ShowOthersListingsProductsFilter::PARAM_NAME_SHOW_CHILD_PRODUCTS_IN_VARIATIONS);
118+
if (
119+
!$includeSimpleProductsInVariation
120+
&& !empty($this->listing['id'] ?? 0)
121+
) {
122+
$this->excludeSimpleProductsInVariation->filter($collection, (int)$this->listing['id']);
123+
}
124+
109125
$collection->addFieldToFilter(
110126
[
111127
[

Block/Adminhtml/Amazon/Listing/View/Magento/Grid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected function _prepareColumns()
191191
]);
192192

193193
$this->addColumn('name', [
194-
'header' => __('Title'),
194+
'header' => __('Product Title'),
195195
'align' => 'left',
196196
'type' => 'text',
197197
'index' => 'name',
@@ -227,7 +227,7 @@ protected function _prepareColumns()
227227
]);
228228

229229
$this->addColumn('sku', [
230-
'header' => __('SKU'),
230+
'header' => __('Product SKU'),
231231
'align' => 'left',
232232
'width' => '90px',
233233
'type' => 'text',

Block/Adminhtml/Amazon/Order/Grid.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,17 +393,27 @@ protected function _prepareMassaction()
393393

394394
public function callbackPurchaseCreateDate($value, $row, $column, $isExport)
395395
{
396+
$purchaseDate = $row->getChildObject()->getData('purchase_create_date');
397+
if (empty($purchaseDate)) {
398+
return '';
399+
}
400+
396401
return $this->_localeDate->formatDate(
397-
$row->getChildObject()->getData('purchase_create_date'),
402+
$purchaseDate,
398403
\IntlDateFormatter::MEDIUM,
399404
true
400405
);
401406
}
402407

403408
public function callbackShippingDateTo($value, $row, $column, $isExport)
404409
{
410+
$shippingDate = $row->getChildObject()->getData('shipping_date_to');
411+
if (empty($shippingDate)) {
412+
return '';
413+
}
414+
405415
return $this->_localeDate->formatDate(
406-
$row->getChildObject()->getData('shipping_date_to'),
416+
$shippingDate,
407417
\IntlDateFormatter::MEDIUM,
408418
true
409419
);
@@ -413,7 +423,7 @@ public function callbackDeliveryDate($value, $row, $column, $isExport)
413423
{
414424
$deliveryDate = $row->getChildObject()->getData('delivery_date_from');
415425
if (empty($deliveryDate)) {
416-
return __('N/A');
426+
return '';
417427
}
418428

419429
return $this->_localeDate->formatDate(
Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,17 @@
11
<?php
22

3-
/**
4-
* @author M2E Pro Developers Team
5-
* @copyright M2E LTD
6-
* @license Commercial use is forbidden
7-
*/
8-
93
namespace Ess\M2ePro\Block\Adminhtml\ControlPanel\Inspection;
104

115
class VersionInfo extends AbstractInspection
126
{
13-
/** @var \Ess\M2ePro\Helper\Module */
14-
private $moduleHelper;
15-
/** @var \Ess\M2ePro\Model\Registry\Manager */
16-
private $registry;
7+
private \Ess\M2ePro\Helper\Module $moduleHelper;
178

18-
/**
19-
* @param \Ess\M2ePro\Helper\Module $moduleHelper
20-
* @param \Ess\M2ePro\Model\Registry\Manager $registry
21-
* @param \Ess\M2ePro\Block\Adminhtml\Magento\Context\Template $context
22-
* @param array $data
23-
*/
249
public function __construct(
2510
\Ess\M2ePro\Helper\Module $moduleHelper,
26-
\Ess\M2ePro\Model\Registry\Manager $registry,
2711
\Ess\M2ePro\Block\Adminhtml\Magento\Context\Template $context,
2812
array $data = []
2913
) {
3014
$this->moduleHelper = $moduleHelper;
31-
$this->registry = $registry;
3215
parent::__construct($context, $data);
3316
}
3417

@@ -42,14 +25,9 @@ public function _construct()
4225
$this->prepareInfo();
4326
}
4427

45-
// ----------------------------------------
46-
4728
protected function prepareInfo()
4829
{
4930
$this->currentVersion = $this->moduleHelper->getPublicVersion();
50-
51-
$this->latestPublicVersion = $this->registry->getValue(
52-
'/installation/public_last_version/'
53-
);
31+
$this->latestPublicVersion = $this->moduleHelper->getLatestVersion();
5432
}
5533
}

Block/Adminhtml/Ebay/Listing/Preview.php

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace Ess\M2ePro\Block\Adminhtml\Ebay\Listing;
1010

1111
use Ess\M2ePro\Block\Adminhtml\Magento\AbstractBlock;
12+
use Ess\M2ePro\Model\Ebay\Template\Description as TemplateDescription;
1213
use Ess\M2ePro\Model\Ebay\Template\Description\Source as DescriptionSource;
1314

1415
class Preview extends AbstractBlock
@@ -631,34 +632,22 @@ public function getSpecifics()
631632
private function getConditionHumanTitle($code)
632633
{
633634
$codes = [
634-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_NEW =>
635-
$this->__('New'),
636-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_NEW_OTHER =>
637-
$this->__('New Other'),
638-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_NEW_WITH_DEFECT =>
639-
$this->__('New With Defects'),
640-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_CERTIFIED_REFURBISHED =>
641-
$this->__('Manufacturer Refurbished'),
642-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_EXCELLENT_REFURBISHED =>
643-
$this->__('Excellent (Refurbished)'),
644-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_VERY_GOOD_REFURBISHED =>
645-
$this->__('Very Good (Refurbished)'),
646-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_GOOD_REFURBISHED =>
647-
$this->__('Good (Refurbished)'),
648-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_SELLER_REFURBISHED =>
649-
$this->__('Seller Refurbished, Re-manufactured'),
650-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_LIKE_NEW =>
651-
$this->__('Like New'),
652-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_USED =>
653-
$this->__('Used'),
654-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_VERY_GOOD =>
655-
$this->__('Very Good'),
656-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_GOOD =>
657-
$this->__('Good'),
658-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_ACCEPTABLE =>
659-
$this->__('Acceptable'),
660-
\Ess\M2ePro\Model\Ebay\Template\Description::CONDITION_EBAY_NOT_WORKING =>
661-
$this->__('For Parts or Not Working'),
635+
TemplateDescription::CONDITION_EBAY_NEW => __('New'),
636+
TemplateDescription::CONDITION_EBAY_NEW_OTHER => __('New Other'),
637+
TemplateDescription::CONDITION_EBAY_NEW_WITH_DEFECT => __('New With Defects'),
638+
TemplateDescription::CONDITION_EBAY_CERTIFIED_REFURBISHED => __('Manufacturer Refurbished'),
639+
TemplateDescription::CONDITION_EBAY_EXCELLENT_REFURBISHED => __('Excellent (Refurbished)'),
640+
TemplateDescription::CONDITION_EBAY_VERY_GOOD_REFURBISHED => __('Very Good (Refurbished)'),
641+
TemplateDescription::CONDITION_EBAY_GOOD_REFURBISHED => __('Good (Refurbished)'),
642+
TemplateDescription::CONDITION_EBAY_SELLER_REFURBISHED => __('Seller Refurbished, Re-manufactured'),
643+
TemplateDescription::CONDITION_EBAY_LIKE_NEW => __('Like New'),
644+
TemplateDescription::CONDITION_EBAY_PRE_OWNED_EXCELLENT => __('Excellent (Pre-owned)'),
645+
TemplateDescription::CONDITION_EBAY_USED_EXCELLENT => __('Good (Pre-owned)'),
646+
TemplateDescription::CONDITION_EBAY_PRE_OWNED_FAIR => __('Fair (Pre-owned)'),
647+
TemplateDescription::CONDITION_EBAY_VERY_GOOD => __('Very Good'),
648+
TemplateDescription::CONDITION_EBAY_GOOD => __('Good'),
649+
TemplateDescription::CONDITION_EBAY_ACCEPTABLE => __('Acceptable'),
650+
TemplateDescription::CONDITION_EBAY_NOT_WORKING => __('For Parts or Not Working'),
662651
];
663652

664653
if (!isset($codes[$code])) {

Block/Adminhtml/Ebay/Listing/Product/Add/Grid.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Ess\M2ePro\Block\Adminhtml\Ebay\Listing\Product\Add;
44

5+
use Ess\M2ePro\Block\Adminhtml\Listing\Product\ShowOthersListingsProductsFilter;
6+
57
abstract class Grid extends \Ess\M2ePro\Block\Adminhtml\Magento\Product\Grid
68
{
79
/** @var \Ess\M2ePro\Model\Listing */
@@ -69,7 +71,7 @@ protected function _prepareCollection()
6971
// Hide products others listings
7072
// ---------------------------------------
7173
$hideParam = true;
72-
if ($this->getRequest()->has('show_products_others_listings')) {
74+
if ($this->getRequest()->has(ShowOthersListingsProductsFilter::PARAM_NAME_SHOW_PRODUCT_IN_OTHER_LISTING)) {
7375
$hideParam = false;
7476
}
7577

Block/Adminhtml/Ebay/Listing/View/Magento/Grid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected function _prepareColumns()
184184
]);
185185

186186
$this->addColumn('name', [
187-
'header' => $this->__('Title'),
187+
'header' => $this->__('Product Title'),
188188
'align' => 'left',
189189
'type' => 'text',
190190
'index' => 'name',
@@ -220,7 +220,7 @@ protected function _prepareColumns()
220220
]);
221221

222222
$this->addColumn('sku', [
223-
'header' => $this->__('SKU'),
223+
'header' => $this->__('Product SKU'),
224224
'align' => 'left',
225225
'width' => '90px',
226226
'type' => 'text',

Block/Adminhtml/Ebay/Listing/Wizard/AbstractGrid.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Ess\M2ePro\Block\Adminhtml\Ebay\Listing\Wizard;
66

7+
use Ess\M2ePro\Block\Adminhtml\Listing\Product\ShowOthersListingsProductsFilter;
78
use Ess\M2ePro\Block\Adminhtml\Magento\Product\Grid as EbayMagentoGrid;
89
use Ess\M2ePro\Helper\Magento\Product as ProductHelper;
910
use Ess\M2ePro\Model\ResourceModel\Magento\Product\CollectionFactory;
@@ -15,6 +16,7 @@
1516
use Ess\M2ePro\Block\Adminhtml\Magento\Context\Template;
1617
use Ess\M2ePro\Helper\Module;
1718
use Magento\Catalog\Model\Product\Type;
19+
use Ess\M2ePro\Model\ResourceModel\Magento\Product\Filter\ExcludeSimpleProductsInVariation;
1820

1921
abstract class AbstractGrid extends EbayMagentoGrid
2022
{
@@ -26,8 +28,11 @@ abstract class AbstractGrid extends EbayMagentoGrid
2628
private ListingRuntimeStorage $uiListingRuntimeStorage;
2729
private WizardRuntimeStorage $uiWizardRuntimeStorage;
2830
private Module $moduleHelper;
31+
/** @var \Ess\M2ePro\Model\ResourceModel\Magento\Product\Filter\ExcludeSimpleProductsInVariation */
32+
private ExcludeSimpleProductsInVariation $excludeSimpleProductsInVariation;
2933

3034
public function __construct(
35+
ExcludeSimpleProductsInVariation $excludeSimpleProductsInVariation,
3136
WizardRuntimeStorage $uiWizardRuntimeStorage,
3237
ListingRuntimeStorage $uiListingRuntimeStorage,
3338
ListingResource $listingResource,
@@ -49,6 +54,7 @@ public function __construct(
4954
$this->uiListingRuntimeStorage = $uiListingRuntimeStorage;
5055
$this->uiWizardRuntimeStorage = $uiWizardRuntimeStorage;
5156
$this->moduleHelper = $moduleHelper;
57+
$this->excludeSimpleProductsInVariation = $excludeSimpleProductsInVariation;
5258

5359
parent::__construct($context, $backendHelper, $dataHelper, $data);
5460
}
@@ -125,10 +131,22 @@ protected function _prepareCollection()
125131
}
126132
// ---------------------------------------
127133

134+
$hideSimpleProducts = true;
135+
if ($this->getRequest()->has(ShowOthersListingsProductsFilter::PARAM_NAME_SHOW_CHILD_PRODUCTS_IN_VARIATIONS)) {
136+
$hideSimpleProducts = false;
137+
}
138+
139+
$includeSimpleProductsInVariation = $this
140+
->getRequest()
141+
->has(ShowOthersListingsProductsFilter::PARAM_NAME_SHOW_CHILD_PRODUCTS_IN_VARIATIONS);
142+
if (!$includeSimpleProductsInVariation) {
143+
$this->excludeSimpleProductsInVariation->filter($collection, (int)$this->getListing()->getId());
144+
}
145+
128146
// Hide products others listings
129147
// ---------------------------------------
130148
$hideParam = true;
131-
if ($this->getRequest()->has('show_products_others_listings')) {
149+
if ($this->getRequest()->has(ShowOthersListingsProductsFilter::PARAM_NAME_SHOW_PRODUCT_IN_OTHER_LISTING)) {
132150
$hideParam = false;
133151
}
134152

Block/Adminhtml/Ebay/Listing/Wizard/Product/Add/Category/Grid.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Ess\M2ePro\Helper\Module;
1616
use Ess\M2ePro\Helper\Magento\Category;
1717
use Ess\M2ePro\Helper\Module\Database\Structure;
18+
use Ess\M2ePro\Model\ResourceModel\Magento\Product\Filter\ExcludeSimpleProductsInVariation;
1819
use Magento\Catalog\Model\Product\Type;
1920

2021
class Grid extends AbstractGrid
@@ -25,6 +26,7 @@ class Grid extends AbstractGrid
2526
private Structure $databaseHelper;
2627

2728
public function __construct(
29+
ExcludeSimpleProductsInVariation $excludeSimpleProductsInVariation,
2830
WizardRuntimeStorage $uiWizardRuntimeStorage,
2931
ListingRuntimeStorage $uiListingRuntimeStorage,
3032
ListingResource $listingResource,
@@ -44,6 +46,7 @@ public function __construct(
4446
$this->databaseHelper = $databaseHelper;
4547

4648
parent::__construct(
49+
$excludeSimpleProductsInVariation,
4750
$uiWizardRuntimeStorage,
4851
$uiListingRuntimeStorage,
4952
$listingResource,

0 commit comments

Comments
 (0)