[Added] add_to_cart to start-template

This commit is contained in:
MaxBUhe 2023-12-18 11:23:43 +01:00
parent ab6b7f7454
commit 9ea5408e44
4 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="addtocart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -28,6 +28,7 @@ namespace D3\GoogleAnalytics4\Modules\Application\Controller{
use OxidEsales\Eshop\Application\Controller\AccountRecommlistController; use OxidEsales\Eshop\Application\Controller\AccountRecommlistController;
use OxidEsales\Eshop\Application\Controller\AccountWishlistController; use OxidEsales\Eshop\Application\Controller\AccountWishlistController;
use OxidEsales\Eshop\Application\Controller\ArticleListController; use OxidEsales\Eshop\Application\Controller\ArticleListController;
use OxidEsales\Eshop\Application\Controller\StartController;
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {} class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {}
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {} class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
@ -41,6 +42,8 @@ namespace D3\GoogleAnalytics4\Modules\Application\Controller{
class d3GtmAccountRecommlistController_parent extends AccountRecommlistController {} class d3GtmAccountRecommlistController_parent extends AccountRecommlistController {}
class d3GtmAccountWishlistController_parent extends AccountWishlistController {} class d3GtmAccountWishlistController_parent extends AccountWishlistController {}
class d3GtmStartController_parent extends StartController {}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Component{ namespace D3\GoogleAnalytics4\Modules\Application\Component{

View File

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmStartController extends d3GtmStartController_parent
{
public function render()
{
$return = parent::render();
if (false === in_array('oxcmp_basket', $this->getComponents())){
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
}
return $return;
}
}

View File

@ -7,6 +7,7 @@ use D3\GoogleAnalytics4\Modules\Application\Controller\BasketController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountNoticeListController; use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountNoticeListController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountRecommlistController; use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountRecommlistController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountWishlistController; use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountWishlistController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmStartController;
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController; use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket; use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category; use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
@ -19,6 +20,7 @@ use OxidEsales\Eshop\Application\Controller\AccountWishlistController as OEAccou
use OxidEsales\Eshop\Application\Controller\ArticleDetailsController as OEArticleDetailsController; use OxidEsales\Eshop\Application\Controller\ArticleDetailsController as OEArticleDetailsController;
use OxidEsales\Eshop\Application\Controller\ArticleListController as OEArticleListController; use OxidEsales\Eshop\Application\Controller\ArticleListController as OEArticleListController;
use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController; use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController;
use OxidEsales\Eshop\Application\Controller\StartController as OEStartController;
use OxidEsales\Eshop\Application\Controller\ThankYouController as OEThankYouController; use OxidEsales\Eshop\Application\Controller\ThankYouController as OEThankYouController;
use OxidEsales\Eshop\Application\Model\Basket as OEBasket; use OxidEsales\Eshop\Application\Model\Basket as OEBasket;
use OxidEsales\Eshop\Application\Model\Category as OECategory; use OxidEsales\Eshop\Application\Model\Category as OECategory;
@ -56,7 +58,8 @@ $aModule = [
OEArticleDetailsController::class => ArticleDetailsController::class, OEArticleDetailsController::class => ArticleDetailsController::class,
OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class, OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class,
OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class, OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class,
OEAccountWishlistController::class => d3GtmAccountWishlistController::class OEAccountWishlistController::class => d3GtmAccountWishlistController::class,
OEStartController::class => d3GtmStartController::class
], ],
'templates' => [ 'templates' => [
// own callable files // own callable files
@ -128,6 +131,12 @@ $aModule = [
'file' => '/Application/views/blocks/page_list_listbody.tpl', 'file' => '/Application/views/blocks/page_list_listbody.tpl',
'position' => 150 'position' => 150
], ],
[
'template' => 'page/shop/start.tpl',
'block' => 'start_welcome_text',
'file' => '/Application/views/blocks/start_welcome_text.tpl',
'position' => 150
],
// remove_from_cart // remove_from_cart
[ [
'template' => 'page/checkout/basket.tpl', 'template' => 'page/checkout/basket.tpl',