add CountryObjectGetter to ThankYouController

This commit is contained in:
MaxBUhe 2023-08-17 09:20:58 +02:00
bovenliggende e90aba2c55
commit a49c29d7aa
3 gewijzigde bestanden met toevoegingen van 27 en 1 verwijderingen

Bestand weergeven

@ -24,4 +24,5 @@ namespace D3\GoogleAnalytics4\Modules\Application\Model{
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {}
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
}

Bestand weergeven

@ -0,0 +1,22 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use OxidEsales\Eshop\Application\Model\Country;
class ThankYouController extends ThankYouController_parent
{
/**
* @return Country
*/
public function d3GAGetUserCountry()
{
$sCountryId = $this->getOrder()->getFieldData('oxbillcountryid');
/** @var Country $oCountry */
$oCountry = oxNew(Country::class);
$oCountry->load($sCountryId);
return $oCountry;
}
}

Bestand weergeven

@ -1,10 +1,12 @@
<?php
use D3\GoogleAnalytics4\Modules\Application\Controller\BasketController;
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController;
use OxidEsales\Eshop\Application\Controller\ThankYouController as OEThankYouController;
use OxidEsales\Eshop\Application\Model\Basket as OEBasket;
use OxidEsales\Eshop\Application\Model\Category as OECategory;
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
@ -32,7 +34,8 @@ $aModule = [
OEViewConfig::class => ViewConfig::class,
OECategory::class => Category::class,
OEBasket::class => Basket::class,
OEBasketController::class => BasketController::class
OEBasketController::class => BasketController::class,
OEThankYouController::class => ThankYouController::class
],
'templates' => [],
'blocks' => [