add CountryObjectGetter to ThankYouController

This commit is contained in:
MaxBUhe 2023-08-17 09:20:58 +02:00
parent e90aba2c55
commit a49c29d7aa
3 changed files with 27 additions and 1 deletions

View File

@ -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 {}
}

View File

@ -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;
}
}

View File

@ -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' => [