Last active
August 29, 2015 14:02
-
-
Save zandzpider/8b13c5fe693138ee5c10 to your computer and use it in GitHub Desktop.
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 | |
public function isSalable() | |
{ | |
//function modified to store answers in the magento registry | |
if (is_null(Mage::registry('isSaleable' . $this->getId()))) | |
{ | |
Mage::dispatchEvent('catalog_product_is_salable_before', array( | |
'product' => $this | |
)); | |
$salable = $this->isAvailable(); | |
$object = new Varien_Object(array( | |
'product' => $this, | |
'is_salable' => $salable | |
)); | |
Mage::dispatchEvent('catalog_product_is_salable_after', array( | |
'product' => $this, | |
'salable' => $object | |
)); | |
Mage::register('isSaleable' . $this->getId(), $object->getIsSalable(), true); | |
} | |
return Mage::registry('isSaleable' . $this->getId()); | |
} |
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 | |
public function isSalable() | |
{ | |
Mage::dispatchEvent('catalog_product_is_salable_before', array( | |
'product' => $this | |
)); | |
$salable = $this->isAvailable(); | |
$object = new Varien_Object(array( | |
'product' => $this, | |
'is_salable' => $salable | |
)); | |
Mage::dispatchEvent('catalog_product_is_salable_after', array( | |
'product' => $this, | |
'salable' => $object | |
)); | |
return $object->getIsSalable(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment