-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from mageplaza/2.4-develop
v4.0.0
- Loading branch information
Showing
5 changed files
with
144 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_DeleteOrders | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
namespace Mageplaza\DeleteOrders\Model\Config\Source; | ||
|
||
use Magento\Store\Model\System\Store; | ||
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; | ||
|
||
/** | ||
* Class StoreView | ||
* | ||
* @package Mageplaza\DeleteOrders\Model\Config\Source | ||
*/ | ||
class StoreView extends AbstractSource | ||
{ | ||
/** | ||
* @var Store | ||
*/ | ||
private $store; | ||
|
||
/** | ||
* StoreView constructor. | ||
* | ||
* @param Store $store | ||
*/ | ||
public function __construct(Store $store) | ||
{ | ||
$this->store = $store; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
$this->_options[] = [ | ||
'label' => __('All Store Views'), | ||
'value' => 0, | ||
]; | ||
|
||
foreach ($this->store->toOptionArray() as $item) { | ||
$this->_options[] = [ | ||
'label' => __($item['label']), | ||
'value' => $item['value'], | ||
]; | ||
} | ||
|
||
return $this->_options; | ||
} | ||
|
||
/** | ||
* Get all options | ||
* | ||
* @return array | ||
*/ | ||
public function getAllOptions() | ||
{ | ||
$this->_options[] = [ | ||
'label' => __('All Store Views'), | ||
'value' => 0, | ||
]; | ||
|
||
foreach ($this->store->toOptionArray() as $item) { | ||
$this->_options[] = [ | ||
'label' => __($item['label']), | ||
'value' => $item['value'], | ||
]; | ||
} | ||
|
||
return $this->_options; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
{ | ||
"name": "mageplaza/module-delete-orders", | ||
"description": "Magento 2 Delete Orders extension", | ||
"require": { | ||
"mageplaza/module-core": "^1.4.5" | ||
}, | ||
"type": "magento2-module", | ||
"version": "1.2.1", | ||
"license": "proprietary", | ||
"authors": [ | ||
{ | ||
"name": "Mageplaza", | ||
"email": "[email protected]", | ||
"homepage": "https://www.mageplaza.com", | ||
"role": "Technical Support" | ||
} | ||
], | ||
"autoload": { | ||
"files": [ | ||
"registration.php" | ||
], | ||
"psr-4": { | ||
"Mageplaza\\DeleteOrders\\": "" | ||
} | ||
} | ||
} | ||
{ | ||
"name": "mageplaza/module-delete-orders", | ||
"description": "Magento 2 Delete Orders extension", | ||
"require": { | ||
"mageplaza/module-core": "^1.4.5" | ||
}, | ||
"type": "magento2-module", | ||
"version": "4.0.0", | ||
"license": "proprietary", | ||
"authors": [ | ||
{ | ||
"name": "Mageplaza", | ||
"email": "[email protected]", | ||
"homepage": "https://www.mageplaza.com", | ||
"role": "Technical Support" | ||
} | ||
], | ||
"autoload": { | ||
"files": [ | ||
"registration.php" | ||
], | ||
"psr-4": { | ||
"Mageplaza\\DeleteOrders\\": "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters