Skip to content

Commit

Permalink
Fixes getOrderIdPrefix return #141
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin-Magmodules committed Feb 16, 2022
1 parent 25676a0 commit 7a5ddcd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Model/Config/System/BaseRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public function __construct(
* @param string $path
* @param int|null $storeId
* @param string|null $scope
* @return mixed
* @return string|null
*/
protected function getStoreValue(string $path, int $storeId = null, string $scope = null)
protected function getStoreValue(string $path, int $storeId = null, string $scope = null): ?string
{
if (empty($scope)) {
$scope = ScopeInterface::SCOPE_STORE;
Expand Down Expand Up @@ -132,9 +132,9 @@ protected function getStore(): StoreInterface
* @param string $path
* @param int|null $storeId
* @param string|null $scope
* @return mixed
* @return bool
*/
protected function isSetFlag(string $path, int $storeId = null, string $scope = null)
protected function isSetFlag(string $path, int $storeId = null, string $scope = null): bool
{
if (empty($scope)) {
$scope = ScopeInterface::SCOPE_STORE;
Expand Down
2 changes: 1 addition & 1 deletion Model/Config/System/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function useChannelOrderAsOrderIncrementId(int $storeId = null): bool
*/
public function getOrderIdPrefix(int $storeId = null): ?string
{
return $this->isSetFlag(self::XML_PATH_ORDERID_PREFIX, $storeId);
return $this->getStoreValue(self::XML_PATH_ORDERID_PREFIX, $storeId);
}

/**
Expand Down
1 change: 0 additions & 1 deletion etc/adminhtml/system/order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
<field id="orderid_prefix" translate="label" type="text" sortOrder="48" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Order ID Prefix</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>magmodules_channable_marketplace/order/orderid_prefix</config_path>
<comment><![CDATA[<strong>NOTE:</strong> As the Order Increment ID is a unique value, we strongly
recommend to add a prefix to the Channable Order ID to make sure the order number is unique.
Expand Down

0 comments on commit 7a5ddcd

Please sign in to comment.