From ab6b7f7454c4e2782c768e0e4d4fe73fc9afdc59 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Tue, 7 Nov 2023 15:23:40 +0100 Subject: [PATCH] [Added] add_to_cart to recommlist, wishlist, noticelist, Class-Extensions for corresponding templates --- .../tpl/page/account/d3gtmnoticelist.tpl | 18 ++++++++ .../page/account/d3gtmrecommendationlist.tpl | 32 ++++++++++++++ .../views/tpl/page/account/d3gtmwishlist.tpl | 44 +++++++++++++++++++ IntelliSenseHelper.php | 9 ++++ .../d3GtmAccountNoticeListController.php | 17 +++++++ .../d3GtmAccountRecommlistController.php | 17 +++++++ .../d3GtmAccountWishlistController.php | 17 +++++++ metadata.php | 36 ++++++++++----- 8 files changed, 180 insertions(+), 10 deletions(-) create mode 100644 Application/views/tpl/page/account/d3gtmnoticelist.tpl create mode 100644 Application/views/tpl/page/account/d3gtmrecommendationlist.tpl create mode 100644 Application/views/tpl/page/account/d3gtmwishlist.tpl create mode 100644 Modules/Application/Controller/d3GtmAccountNoticeListController.php create mode 100644 Modules/Application/Controller/d3GtmAccountRecommlistController.php create mode 100644 Modules/Application/Controller/d3GtmAccountWishlistController.php diff --git a/Application/views/tpl/page/account/d3gtmnoticelist.tpl b/Application/views/tpl/page/account/d3gtmnoticelist.tpl new file mode 100644 index 0000000..3b25c57 --- /dev/null +++ b/Application/views/tpl/page/account/d3gtmnoticelist.tpl @@ -0,0 +1,18 @@ +[{capture append="oxidBlock_content"}] + [{assign var="template_title" value="MY_WISH_LIST"|oxmultilangassign}] +

[{oxmultilang ident="MY_WISH_LIST"}]

+ + [{if $oView->getNoticeProductList()}] + [{include file="widget/product/list.tpl" type="line" listId="noticelistProductList" title="" products=$oView->getNoticeProductList() removeFunction="tonoticelist" owishid=$oxcmp_user->oxuser__oxid->value}] + [{else}] +

[{oxmultilang ident="WISH_LIST_EMPTY"}]

+ [{/if}] + + [{include file="addtocart.tpl" htmlIdAmountOfArticles='#amountToBasket'}] + + [{insert name="oxid_tracker" title=$template_title}] + [{/capture}] +[{capture append="oxidBlock_sidebar"}] + [{include file="page/account/inc/account_menu.tpl" active_link="noticelist"}] + [{/capture}] +[{include file="layout/page.tpl" sidebar="Left"}] \ No newline at end of file diff --git a/Application/views/tpl/page/account/d3gtmrecommendationlist.tpl b/Application/views/tpl/page/account/d3gtmrecommendationlist.tpl new file mode 100644 index 0000000..e3cf2a7 --- /dev/null +++ b/Application/views/tpl/page/account/d3gtmrecommendationlist.tpl @@ -0,0 +1,32 @@ +[{capture append="oxidBlock_content"}] + [{assign var="template_title" value="LISTMANIA"|oxmultilangassign}] + [{assign var="_actvrecommlist" value=$oView->getActiveRecommList()}] + +

[{oxmultilang ident="LISTMANIA"}]

+ + [{if $oView->isSavedList()}] + [{assign var="_statusMessage" value="LISTMANIA_LIST_SAVED"|oxmultilangassign}] + [{include file="message/success.tpl" statusMessage=$_statusMessage}] + [{/if}] + + [{block name="account_redommendationlist_content"}] + + [{include file="form/recommendation_edit.tpl" actvrecommlist=$_actvrecommlist}] + +
+ + [{if !$oView->getActiveRecommList()}] + [{assign var="blEdit" value=true}] + [{include file="page/recommendations/inc/list.tpl"}] + [{/if}] + [{/block}] + + [{include file="addtocart.tpl" htmlIdAmountOfArticles='#amountToBasket'}] + + [{insert name="oxid_tracker" title=$template_title}] +[{/capture}] +[{capture append="oxidBlock_sidebar"}] + [{include file="page/account/inc/account_menu.tpl" active_link="recommendationlist"}] +[{/capture}] +[{include file="layout/page.tpl" sidebar="Left"}] + diff --git a/Application/views/tpl/page/account/d3gtmwishlist.tpl b/Application/views/tpl/page/account/d3gtmwishlist.tpl new file mode 100644 index 0000000..dfda499 --- /dev/null +++ b/Application/views/tpl/page/account/d3gtmwishlist.tpl @@ -0,0 +1,44 @@ +[{capture append="oxidBlock_content"}] + [{assign var="template_title" value="MY_GIFT_REGISTRY"|oxmultilangassign}] + [{if !$oView->getWishListUsers() && $oView->getWishListSearchParam()}] + [{assign var="_statusMessage" value="MESSAGE_SORRY_NO_GIFT_REGISTRY"|oxmultilangassign}] + [{include file="message/error.tpl" statusMessage=$_statusMessage}] + [{/if}] + [{assign var="editval" value=$oView->getEnteredData()}] + [{if $oView->isWishListEmailSent()}] + [{assign var="_statusMessage" value="GIFT_REGISTRY_SENT_SUCCESSFULLY"|oxmultilangassign:$editval->rec_email}] + [{include file="message/notice.tpl" statusMessage=$_statusMessage}] + [{/if}] + +

[{$oView->getTitle()}]

+ + + +
+ +
+ [{if $oView->getWishList()}] + [{include file="form/wishlist_publish.tpl"}] +
+ [{include file="form/wishlist_suggest.tpl"}] + [{/if}] +
+ + [{if $oView->getWishList()}] + [{include file="widget/product/list.tpl" type="line" listId="wishlistProductList" title="" products=$oView->getWishProductList() removeFunction="towishlist" toBasketFunction="tobasket" owishid=$oxcmp_user->oxuser__oxid->value}] + [{else}] +

+ [{oxmultilang ident="GIFT_REGISTRY_EMPTY"}] +

+ [{/if}] + + [{include file="addtocart.tpl" htmlIdAmountOfArticles='#amountToBasket'}] + + [{insert name="oxid_tracker" title=$template_title}] +[{/capture}] +[{capture append="oxidBlock_sidebar"}] + [{include file="page/account/inc/account_menu.tpl" active_link="wishlist"}] +[{/capture}] +[{include file="layout/page.tpl" sidebar="Left"}] \ No newline at end of file diff --git a/IntelliSenseHelper.php b/IntelliSenseHelper.php index a7192ca..b34e102 100644 --- a/IntelliSenseHelper.php +++ b/IntelliSenseHelper.php @@ -24,6 +24,9 @@ namespace D3\GoogleAnalytics4\Modules\Application\Model{ namespace D3\GoogleAnalytics4\Modules\Application\Controller{ + use OxidEsales\Eshop\Application\Controller\AccountNoticeListController; + use OxidEsales\Eshop\Application\Controller\AccountRecommlistController; + use OxidEsales\Eshop\Application\Controller\AccountWishlistController; use OxidEsales\Eshop\Application\Controller\ArticleListController; class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {} @@ -32,6 +35,12 @@ namespace D3\GoogleAnalytics4\Modules\Application\Controller{ class ArticleListController_AddToCartHelpMethods_parent extends ArticleListController {} class ArticleDetailsController_parent extends \OxidEsales\Eshop\Application\Controller\ArticleDetailsController {} + + class d3GtmAccountNoticeListController_parent extends AccountNoticeListController {} + + class d3GtmAccountRecommlistController_parent extends AccountRecommlistController {} + + class d3GtmAccountWishlistController_parent extends AccountWishlistController {} } namespace D3\GoogleAnalytics4\Modules\Application\Component{ diff --git a/Modules/Application/Controller/d3GtmAccountNoticeListController.php b/Modules/Application/Controller/d3GtmAccountNoticeListController.php new file mode 100644 index 0000000..8c62241 --- /dev/null +++ b/Modules/Application/Controller/d3GtmAccountNoticeListController.php @@ -0,0 +1,17 @@ +addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket')); + + return $return; + } +} \ No newline at end of file diff --git a/Modules/Application/Controller/d3GtmAccountRecommlistController.php b/Modules/Application/Controller/d3GtmAccountRecommlistController.php new file mode 100644 index 0000000..6e9e825 --- /dev/null +++ b/Modules/Application/Controller/d3GtmAccountRecommlistController.php @@ -0,0 +1,17 @@ +addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket')); + + return $return; + } +} \ No newline at end of file diff --git a/Modules/Application/Controller/d3GtmAccountWishlistController.php b/Modules/Application/Controller/d3GtmAccountWishlistController.php new file mode 100644 index 0000000..731d6d4 --- /dev/null +++ b/Modules/Application/Controller/d3GtmAccountWishlistController.php @@ -0,0 +1,17 @@ +addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket')); + + return $return; + } +} \ No newline at end of file diff --git a/metadata.php b/metadata.php index f42d279..8acca2c 100755 --- a/metadata.php +++ b/metadata.php @@ -4,12 +4,18 @@ use D3\GoogleAnalytics4\Modules\Application\Component\d3GtmBasketComponentExtens use D3\GoogleAnalytics4\Modules\Application\Controller\ArticleDetailsController; use D3\GoogleAnalytics4\Modules\Application\Controller\ArticleListController_AddToCartHelpMethods; use D3\GoogleAnalytics4\Modules\Application\Controller\BasketController; +use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountNoticeListController; +use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountRecommlistController; +use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountWishlistController; 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\Application\Model\Manufacturer as Manufacturer; use D3\GoogleAnalytics4\Modules\Core\ViewConfig; use OxidEsales\Eshop\Application\Component\BasketComponent as OEBasketComponent; +use OxidEsales\Eshop\Application\Controller\AccountNoticeListController as OEAccountNoticeListController; +use OxidEsales\Eshop\Application\Controller\AccountRecommlistController as OEAccountRecommlistController; +use OxidEsales\Eshop\Application\Controller\AccountWishlistController as OEAccountWishlistController; use OxidEsales\Eshop\Application\Controller\ArticleDetailsController as OEArticleDetailsController; use OxidEsales\Eshop\Application\Controller\ArticleListController as OEArticleListController; use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController; @@ -39,18 +45,28 @@ $aModule = [ 'email' => 'support@shopmodule.com', 'url' => 'https://www.oxidmodule.com/', 'extend' => [ - OEViewConfig::class => ViewConfig::class, - OECategory::class => Category::class, - OEBasket::class => Basket::class, - OEBasketController::class => BasketController::class, - OEManufacturer::class => Manufacturer::class, - OEThankYouController::class => ThankYouController::class, - OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class, - OEBasketComponent::class => d3GtmBasketComponentExtension::class, - OEArticleDetailsController::class => ArticleDetailsController::class + OEViewConfig::class => ViewConfig::class, + OECategory::class => Category::class, + OEBasket::class => Basket::class, + OEBasketController::class => BasketController::class, + OEManufacturer::class => Manufacturer::class, + OEThankYouController::class => ThankYouController::class, + OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class, + OEBasketComponent::class => d3GtmBasketComponentExtension::class, + OEArticleDetailsController::class => ArticleDetailsController::class, + OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class, + OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class, + OEAccountWishlistController::class => d3GtmAccountWishlistController::class ], 'templates' => [ - 'addtocart.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_to_cart.tpl' + // own callable files + 'addtocart.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_to_cart.tpl', + + // complete overwritten file of OXID-Originals + // the path of the template-name is the original path to the file in OXID-context from tpl/-> + 'page/account/d3gtmnoticelist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmnoticelist.tpl', + 'page/account/d3gtmrecommendationlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmrecommendationlist.tpl', + 'page/account/d3gtmwishlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmwishlist.tpl', ], 'blocks' => [ // tag manager js