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
DEL "zc:d:www.liveoutthere.com/" |
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
case 'redis': | |
try { | |
require_once('lib/Credis/Client.php'); | |
require_once('lib/Zend/Cache/Backend.php'); | |
require_once('lib/Zend/Cache/Backend/Interface.php'); | |
require_once('lib/Zend/Cache/Backend/ExtendedInterface.php'); | |
require_once('app/code/core/Zend/Cache/Backend/Redis.php'); | |
self::$cacheEngine = 'redis'; | |
$options = array(); | |
foreach($child2->backend_options as $el){ |
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
case 'redis': | |
return unserialize(self::$cacheData['server']->load($key)); | |
break; |
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
<?php | |
class TinyBrick_LightSpeed_Model_Server_Redis { | |
protected $_server; | |
protected $_enabled = false; | |
public function getServer() { | |
if (!$this->_server) { | |
require_once($_SERVER['DOCUMENT_ROOT'] . '/lib/Credis/Client.php'); | |
require_once($_SERVER['DOCUMENT_ROOT'] . '/lib/Zend/Cache/Backend.php'); | |
require_once($_SERVER['DOCUMENT_ROOT'] . '/lib/Zend/Cache/Backend/Interface.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
public function getServer() | |
{ | |
if(!$this->_server){ | |
$type = strtolower(Mage::getConfig()->getNode('lightspeed/cache/type')); | |
if ($type == "memcached"){ | |
$this->_server = Mage::getModel("lightspeed/server_memcache"); | |
}elseif ($type == "redis"){ | |
$this->_server = Mage::getModel("lightspeed/server_redis"); | |
}else{ | |
$this->_server = Mage::getModel("lightspeed/server_files"); |
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
<lightspeed> | |
<global> | |
REDACTED | |
</global> | |
<session> | |
REDACTED | |
</session> |
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
public function indexAction() { | |
$coupon_code = $this->getRequest()->getParam('coupon_code'); | |
if ($coupon_code != '') { | |
Mage::getSingleton("checkout/session")->setData("coupon_code",$coupon_code); | |
Mage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save(); | |
Mage::getSingleton('core/session')->addSuccess($this->__('Coupon was automatically applied')); | |
} | |
else { | |
Mage::getSingleton("checkout/session")->setData("coupon_code",""); |
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
public function applyCouponEvent($observer){ | |
$coupon_code = trim(Mage::getSingleton("checkout/session")->getData("coupon_code")); | |
if ($coupon_code != ''){ | |
Mage::getSingleton('checkout/cart')->getQuote()->setCouponCode($coupon_code)->save(); | |
} | |
} |
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
<frontend> | |
<events> | |
<checkout_cart_product_add_after> | |
<observers> | |
<ApplyCoupon_apply> | |
<type>singleton</type> | |
<class>ApplyCoupon/Observer</class> | |
<method>applyCouponEvent</method> | |
</ApplyCoupon_apply> | |
</observers> |
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
$productPrice = $_product->getPrice(); | |
$coupon_code = trim(Mage::getSingleton("checkout/session")->getData("coupon_code")); | |
if ($coupon_code != '') { | |
/*** Warning - if you choose to use this code, you should probably not | |
* use the direct SQL query below, and instead use the SalesRule/Rule | |
* resource collection, which you can access by calling | |
* Mage::getModel('salesrule/rule')->getResourceCollection() | |
* | |
* This example was written a long time ago and the direct SQL query was |
OlderNewer