Skip to content

Commit 7327bc3

Browse files
author
netorodrigues
committed
🐛 gets default store view code correctly
1 parent 49adc9b commit 7327bc3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Concrete/Magento2CoreSetup.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,15 @@ protected function _formatToCurrency($price)
479479
return $priceHelper->currency($price, true, false);
480480
}
481481

482+
public static function getDefaultStoreViewCode()
483+
{
484+
$objectManager = ObjectManager::getInstance();
485+
$storeInterfaceName = '\Magento\Store\Model\StoreManagerInterface';
486+
$storeManager = $objectManager->get($storeInterfaceName);
487+
488+
return $storeManager->getDefaultStoreView()->getCode();
489+
}
490+
482491
public static function getCurrentStoreId()
483492
{
484493
$objectManager = ObjectManager::getInstance();
@@ -571,4 +580,4 @@ static private function fillWithRecurrenceConfig(&$dataObj, $storeConfig)
571580
$section
572581
);
573582
}
574-
}
583+
}

Helper/Adminhtml/CheckoutHelper.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ public function getYears()
7979
}
8080
public function getInstallmentsUrl($baseUrl)
8181
{
82-
return $baseUrl . "rest/default/V1/mundipagg/installments/brandbyamount";
82+
$defaultStoreViewCode = Magento2CoreSetup::getDefaultStoreViewCode();
83+
return $baseUrl . "rest/{$defaultStoreViewCode}/V1/mundipagg/installments/brandbyamount";
8384
}
8485

8586
public function formatGrandTotal($granTotal)
8687
{
8788
$number = number_format((float)$granTotal, 2, '.', '');
8889
return $number;
8990
}
90-
}
91+
}

0 commit comments

Comments
 (0)