/** * Will hide our shopping world from the emotion module. * * @param \Enlight_Hook_HookArgs $args * @return mixed */ public function removeShopTemplateEmotionFromListing(\Enlight_Hook_HookArgs $args) { $builder = $args->getReturn(); $builder->leftJoin('emotions', 's_emotion_attributes', 'attribute', 'attribute.emotionID = emotions.id')->andWhere('attribute.swag_shop_template IS NULL or attribute.swag_shop_template != 1'); return $builder; }
public function onSendMailFilterVariablesFilter(Enlight_Hook_HookArgs $args) { $variables = $args->getReturn(); //return if not payone preprepayment if (!$this->Application()->PayoneMain()->getPaymentHelper()->isPayonePayInAdvance($variables['additional']['payment']['name'])) { return; } $session = Shopware()->Session(); if ($session->moptClearingData) { $variables['additional']['moptPayoneClearingData'] = $session->moptClearingData; $args->setReturn($variables); } }
public static function onsValidateStep3(Enlight_Hook_HookArgs $args) { self::registerNamespace(); $caller = $args->getSubject(); $ret = $args->getReturn(); if (is_array($ret) && $ret['paymentData']['id'] == self::getPaymentId()) { if (!array_key_exists('payonesubpay', $caller->sSYSTEM->_POST)) { $ret['checkPayment']['sErrorMessages'] = 'Bitte wählen Sie eine Option'; $ret['checkPayment']['sErrorFlag'] = array ('postbanksubpay'); $args->setReturn($ret); } else { self::setUserSettings($caller, $caller->sSYSTEM->_POST['payonesubpay']); } } }
/** * Hook on sGetArticleById to get product description * Parse description and set a tooltip around all matching terms * * @param $args Enlight_Hook_HookArgs * @return array|mixed */ public function onGetArticle(Enlight_Hook_HookArgs $args) { //Get return $article = $args->getReturn(); $config = Shopware()->Plugins()->Frontend()->SwagGlossar()->Config(); $description =& $article["description_long"]; $storeId = Shopware()->Shop()->getId(); // Read the glossar $getGlossar = Shopware()->Db()->fetchAll("SELECT keywords, glossar\n FROM s_plugin_glossar\n WHERE storeID = ?", array($storeId)); foreach ($getGlossar as $glossar) { $keywords = explode("|", $glossar['keywords']); foreach ($keywords as $keyword) { $description = $this->addGlossaryWords($description, $keyword, $glossar, $config); $newKeyword = htmlentities($keyword); //Needed to prevent double matching of words, which don't even contain a letter, that gets converted by htmlentites //"Car" would get replaced twice without the if if ($newKeyword != $keyword) { $description = $this->addGlossaryWords($description, $newKeyword, $glossar, $config); } } } return $article; }