本文整理汇总了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();
}
示例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();
}