当前位置: 首页>>代码示例>>PHP>>正文


PHP Enlight_Event_EventArgs::getArticle方法代码示例

本文整理汇总了PHP中Enlight_Event_EventArgs::getArticle方法的典型用法代码示例。如果您正苦于以下问题:PHP Enlight_Event_EventArgs::getArticle方法的具体用法?PHP Enlight_Event_EventArgs::getArticle怎么用?PHP Enlight_Event_EventArgs::getArticle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Enlight_Event_EventArgs的用法示例。


在下文中一共展示了Enlight_Event_EventArgs::getArticle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeSetLastArticle

 /**
  * Event listener function of the Shopware_Modules_Articles_SetLastArticle event.
  * This event is fired after a user visit an article detail page.
  * This listener function is used to increment the counter value of
  * the s_articles_similar_shown_ro table.
  *
  * @param Enlight_Event_EventArgs $arguments
  * @return mixed
  */
 public function beforeSetLastArticle(Enlight_Event_EventArgs $arguments)
 {
     if (Shopware()->Session()->Bot || !$this->isSimilarShownActivated()) {
         return $arguments->getReturn();
     }
     $articleId = $arguments->getArticle();
     $sql = "SELECT COUNT(id)\n                FROM s_emarketing_lastarticles\n                WHERE sessionID = :sessionId\n                AND   articleID = :articleId";
     $alreadyViewed = Shopware()->Db()->fetchOne($sql, array('sessionId' => Shopware()->SessionID(), 'articleId' => $articleId));
     if ($alreadyViewed > 0) {
         return $arguments->getReturn();
     }
     $sql = "\n            SELECT\n                articleID as articleId\n            FROM s_emarketing_lastarticles\n            WHERE sessionID = :sessionId\n            AND   articleID != :articleId\n        ";
     $articles = Shopware()->Db()->fetchCol($sql, array('sessionId' => Shopware()->SessionID(), 'articleId' => $articleId));
     foreach ($articles as $id) {
         $this->SimilarShown()->refreshSimilarShown($articleId, $id);
         $this->SimilarShown()->refreshSimilarShown($id, $articleId);
     }
     return $arguments->getReturn();
 }
开发者ID:ClaudioThomas,项目名称:shopware-4,代码行数:28,代码来源:Bootstrap.php

示例2: addToBasket

 /**
  * add "add to basket" tracking
  * @param Enlight_Event_EventArgs $arguments
  * @return boolean
  */
 public function addToBasket(Enlight_Event_EventArgs $arguments)
 {
     if ($this->Config()->get('boxalino_tracking_enabled')) {
         $article = $arguments->getArticle();
         $price = $arguments->getPrice();
         Shopware_Plugins_Frontend_Boxalino_EventReporter::reportAddToBasket($article['articledetailsID'], $arguments->getQuantity(), $price['price'], Shopware()->Shop()->getCurrency());
     }
     return $arguments->getReturn();
 }
开发者ID:boxalino,项目名称:plugin-shopware,代码行数:14,代码来源:FrontendInterceptor.php


注:本文中的Enlight_Event_EventArgs::getArticle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。