-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
app/code/community/Hackathon/DiscountForATweet/Model/Observer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
/** | ||
* License: GNU General Public License | ||
* | ||
* Copyright (c) 2012 Magento Hackathon. All rights reserved. | ||
* Note: Original work copyright to respective authors | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @category Hackathon | ||
* @package Hackathon_DiscountForATweet | ||
* @subpackage Model | ||
* @copyright Copyright (c) 2012 Magento Hackathon | ||
* @license http://www.gnu.org/licenses/gpl.html GPL, version 3 | ||
* @version 0.1.0 | ||
* @link http://magento-hackathon.de | ||
* @since File available since Release 0.1.0 | ||
* @author Hackathon Core Team <core@hackathon> | ||
*/ | ||
|
||
/** | ||
* Implements observer functionality for module. | ||
* | ||
* @category Hackathon | ||
* @package Hackathon_DiscountForATweet | ||
* @subpackage Model | ||
* @copyright Copyright (c) 2012 Magento Hackathon | ||
* @license http://www.gnu.org/licenses/gpl.html GPL, version 3 | ||
* @version Release: 0.1.0 | ||
* @since Class available since Release 0.1.0 | ||
* @author Hackathon Core Team <core@hackathon> | ||
*/ | ||
|
||
class Hackathon_DiscountForATweet_Model_Observer | ||
{ | ||
/** | ||
* Event: salesrule_rule_condition_combine | ||
* | ||
*/ | ||
function addConditionToSalesRule($observer) | ||
{ | ||
$additional = $observer->getAdditional(); | ||
$conditions = (array) $additional->getConditions(); | ||
$conditions = array_merge_recursive($conditions, array( | ||
array('label'=>Mage::helper('hackathon_discountforatweet')->__('Tweeted about'), 'value'=>'hackathon_discountforatweet/condition_tweet'), | ||
)); | ||
$additional->setConditions($conditions); | ||
$observer->setAdditional($additional); | ||
return $observer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters