-
-
Save kstasik/5f04033cf5929c88138b848ee25f452e 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 | |
class Module_Sales_Model_Resource_Quote_Item_Collection extends | |
Mage_Sales_Model_Resource_Quote_Item_Collection{ | |
/** | |
* Add products to items and item options | |
* | |
* @return Mage_Sales_Model_Resource_Quote_Item_Collection | |
*/ | |
protected function _assignProducts() | |
{ | |
parent::_assignProducts(); | |
foreach($this->getItemsByColumnValue('product_type', 'configurable') as $item){ | |
if(!$this->getItemByColumnValue('parent_item_id', $item->getId())){ | |
if($option = $item->getOptionByCode('info_buyRequest')){ | |
$buyRequest = new Varien_Object(unserialize($option->getValue())); | |
$buyRequest->unsetData('reset_count'); | |
try{ | |
$this->_quote->updateItem((int)$item->getId(), $buyRequest); | |
} | |
catch(Exception $e){ | |
// product out of stock | |
} | |
} | |
} | |
} | |
return $this; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment