<?php /** * Product: Loyalty Program for Enterprise Edition * Package: Aitoc_Aitloyalty_10.0.10_574534 * Purchase ID: INzRIwyyaNoeOLERhAgt4U28qVKIeEa3dfPrgaAN3C * Generated: 2013-05-13 06:36:55 * File path: app/code/local/Aitoc/Aitloyalty/Block/Quote/Options.php * Copyright: (c) 2013 AITOC, Inc. */ if (Aitoc_Aitsys_Abstract_Service::initSource(__FILE__, 'Aitoc_Aitloyalty')) { PYrZaaPAlDPOXjfl('e900fe7e957c66aa9f41b44a5bb2de78'); /** * @copyright Copyright (c) 2009 AITOC, Inc. */ class Aitoc_Aitloyalty_Block_Quote_Options extends Mage_Adminhtml_Block_Widget_Form { public function getFormHtml() { $sHtml = parent::getFormHtml(); $sHtml .= '<script type="text/javascript">aitloyalty_ActionOnRuleDisplayChange();</script>'; return $sHtml; } protected function _prepareForm() { $model = Mage::registry('current_promo_quote_rule'); //$form = new Varien_Data_Form(array('id' => 'edit_form1', 'action' => $this->getData('action'), 'method' => 'post')); $form = new Varien_Data_Form(); $form->setHtmlIdPrefix('rule_'); $fieldset = $form->addFieldset('display_fieldset', array('legend' => Mage::helper('salesrule')->__('Using the form below you can enable, disable and configure display of the rule in customers\' account'))); $oDb = Mage::getModel('sales_entity/order')->getReadConnection();
<?php /** * Product: Loyalty Program for Enterprise Edition * Package: Aitoc_Aitloyalty_10.0.10_574534 * Purchase ID: INzRIwyyaNoeOLERhAgt4U28qVKIeEa3dfPrgaAN3C * Generated: 2013-05-13 06:36:55 * File path: app/code/local/Aitoc/Aitloyalty/Block/Rewrite/Front/SalesRule/Quote/Discount.php * Copyright: (c) 2013 AITOC, Inc. */ if (Aitoc_Aitsys_Abstract_Service::initSource(__FILE__, 'Aitoc_Aitloyalty')) { PYrZaaPAlDPOXjfl('5ced465144c9d12024671a9ac0b45d03'); /** * * @copyright Copyright (c) 2011 AITOC, Inc. * @package Aitoc_Aitloyalty * @author lyskovets */ class Aitoc_Aitloyalty_Model_Rewrite_Front_SalesRule_Quote_Discount extends Mage_SalesRule_Model_Quote_Discount { /** * Add discount/surcharge total information to address * * @param Mage_Sales_Model_Quote_Address $address * @return Mage_SalesRule_Model_Quote_Discount */ public function fetch(Mage_Sales_Model_Quote_Address $address) { $amount = $address->getDiscountAmount(); $part = Mage::helper('aitloyalty/discount')->getTitlePart($amount); if ($amount != 0) {
<?php /** * Product: Loyalty Program for Enterprise Edition * Package: Aitoc_Aitloyalty_10.0.10_574534 * Purchase ID: INzRIwyyaNoeOLERhAgt4U28qVKIeEa3dfPrgaAN3C * Generated: 2013-05-13 06:36:55 * File path: app/code/local/Aitoc/Aitloyalty/Model/Rewrite/FrontSalesRuleValidator.php * Copyright: (c) 2013 AITOC, Inc. */ if (Aitoc_Aitsys_Abstract_Service::initSource(__FILE__, 'Aitoc_Aitloyalty')) { PYrZaaPAlDPOXjfl('e5b813e8a1b34fc1606cfb433ff014de'); /** * @copyright Copyright (c) 2009 AITOC, Inc. */ class Aitoc_Aitloyalty_Model_Rewrite_FrontSalesRuleValidator extends Mage_SalesRule_Model_Validator { private static $_isUseCustomActions; protected function _canProcessRule($rule, $address) { if (!Mage::registry('aitFrontSalesRuleValidator')) { Mage::register('aitFrontSalesRuleValidator', $this); } return parent::_canProcessRule($rule, $address) && !(!self::_isUseCustomActions() && in_array($rule->getSimpleAction(), array('by_percent_surcharge', 'by_fixed_surcharge', 'cart_fixed_surcharge'))); } /** * Check if rule can be applied for custom actions * * @return bool */ protected static function _isUseCustomActions()
<?php /** * Product: Loyalty Program for Enterprise Edition * Package: Aitoc_Aitloyalty_10.0.10_574534 * Purchase ID: INzRIwyyaNoeOLERhAgt4U28qVKIeEa3dfPrgaAN3C * Generated: 2013-05-13 06:36:55 * File path: app/code/local/Aitoc/Aitloyalty/Block/Rewrite/Adminhtml/Sales/Totals.php * Copyright: (c) 2013 AITOC, Inc. */ if (Aitoc_Aitsys_Abstract_Service::initSource(__FILE__, 'Aitoc_Aitloyalty')) { PYrZaaPAlDPOXjfl('4ef9a9608312c792a8eb64feb452b084'); /** * * @copyright Copyright (c) 2011 AITOC, Inc. * @package Aitoc_Aitloyalty * @author lyskovets */ class Aitoc_Aitloyalty_Block_Rewrite_Adminhtml_Sales_Totals extends Mage_Adminhtml_Block_Sales_Totals { /** * Initialize order totals array * * @return Mage_Sales_Block_Order_Totals */ protected function _initTotals() { $this->_totals = array(); $this->_totals['subtotal'] = new Varien_Object(array('code' => 'subtotal', 'value' => $this->getSource()->getSubtotal(), 'base_value' => $this->getSource()->getBaseSubtotal(), 'label' => $this->helper('sales')->__('Subtotal'))); /** * Add shipping
<?php /** * Product: Loyalty Program for Enterprise Edition * Package: Aitoc_Aitloyalty_10.0.10_574534 * Purchase ID: INzRIwyyaNoeOLERhAgt4U28qVKIeEa3dfPrgaAN3C * Generated: 2013-05-13 06:36:55 * File path: app/code/local/Aitoc/Aitloyalty/Model/Observer/Paypal/Cart.php * Copyright: (c) 2013 AITOC, Inc. */ if (Aitoc_Aitsys_Abstract_Service::initSource(__FILE__, 'Aitoc_Aitloyalty')) { PYrZaaPAlDPOXjfl('2cb4d9eb329a454cea2a279bdcbe17ab'); /** * * @copyright Copyright (c) 2011 AITOC, Inc. * @package Aitoc_Aitloyalty * @author lyskovets */ class Aitoc_Aitloyalty_Model_Observer_Paypal_Cart extends Aitoc_Aitloyalty_Model_Observer_Abstract { private function _init($event) { $cart = $event->getPaypalCart(); $this->setCart($cart); } public function process(Varien_Event_Observer $event) { $this->_init($event); $discount = $this->_getDiscount(); if ($discount > 0) { $this->_setSurcharge($discount);