From 5d493cca2b82f7ce3c3abc7221dd1870c5b2ebc3 Mon Sep 17 00:00:00 2001 From: DanielSeifert Date: Thu, 9 Mar 2017 09:05:51 +0000 Subject: [PATCH] add remarketing article list for start page --- .../d3_google_remarketing_articlelister.php | 36 +++++++++++++++++++ .../d3_google_trustedstore_articlelister.php | 36 +++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/copy_this/modules/d3/d3_googleanalytics/models/d3_google_remarketing_articlelister.php b/copy_this/modules/d3/d3_googleanalytics/models/d3_google_remarketing_articlelister.php index 74f87f9..4ed8243 100644 --- a/copy_this/modules/d3/d3_googleanalytics/models/d3_google_remarketing_articlelister.php +++ b/copy_this/modules/d3/d3_googleanalytics/models/d3_google_remarketing_articlelister.php @@ -20,6 +20,42 @@ class d3_google_remarketing_articlelister public $blD3GARemarketingUseBrutto = true; + public $aStartListMethodNames = array( + 'getArticleList', + 'getTopArticleList', + 'getNewestArticles', + 'getFirstArticle', + 'getCatOfferArticleList', + ); + + /** + * @param start $oView + * + * @return array + */ + public function getStartProdList($oView) + { + /** @var oxArticleList $oArticleList */ + $oArticleList = oxNew('oxarticlelist'); + + if (is_array($this->aStartListMethodNames) && count($this->aStartListMethodNames)) { + foreach ($this->aStartListMethodNames as $sListName) { + /** @var oxArticleList $oList */ + $mList = call_user_func(array($oView, $sListName)); + + if ($mList instanceof oxArticleList) { + if ($mList->count()) { + foreach ($mList->getArray() as $sID => $oArticle) { + $oArticleList->offsetSet($sID, $oArticle); + } + } + } + } + } + + return $this->_getProductList($oArticleList); + } + /** * @param details $oView * diff --git a/copy_this/modules/d3/d3_googleanalytics/models/d3_google_trustedstore_articlelister.php b/copy_this/modules/d3/d3_googleanalytics/models/d3_google_trustedstore_articlelister.php index 0097789..4b36e39 100644 --- a/copy_this/modules/d3/d3_googleanalytics/models/d3_google_trustedstore_articlelister.php +++ b/copy_this/modules/d3/d3_googleanalytics/models/d3_google_trustedstore_articlelister.php @@ -18,6 +18,42 @@ class d3_google_trustedstore_articlelister { private $_sModId = 'd3_googleanalytics'; + public $aStartListMethodNames = array( + 'getArticleList', + 'getTopArticleList', + 'getNewestArticles', + 'getFirstArticle', + 'getCatOfferArticleList', + ); + + /** + * @param start $oView + * + * @return array + */ + public function getStartProdList($oView) + { + /** @var oxArticleList $oArticleList */ + $oArticleList = oxNew('oxarticlelist'); + + if (is_array($this->aStartListMethodNames) && count($this->aStartListMethodNames)) { + foreach ($this->aStartListMethodNames as $sListName) { + /** @var oxArticleList $oList */ + $mList = call_user_func(array($oView, $sListName)); + + if ($mList instanceof oxArticleList) { + if ($mList->count()) { + foreach ($mList->getArray() as $sID => $oArticle) { + $oArticleList->offsetSet($sID, $oArticle); + } + } + } + } + } + + return $this->_getProductList($oArticleList); + } + /** * @param details $oView *