Skip to content

Commit

Permalink
Import Magento Release 1.2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeSaferite committed Feb 25, 2009
1 parent 7496292 commit 7e3cf77
Show file tree
Hide file tree
Showing 29 changed files with 941 additions and 598 deletions.
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ final class Mage {

public static function getVersion()
{
return '1.2.1';
return '1.2.1.1';
}

/**
Expand Down
3 changes: 3 additions & 0 deletions app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ public function addProduct($product, $qty=1)
$product->setSkipCheckRequiredOption(true);
$item = $this->getQuote()->addProduct($product, $qty);
$product->unsSkipCheckRequiredOption();
if (is_string($item)) {
Mage::throwException($item);
}
$item->checkData();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/**
* Order Statuses source model
*/
class Mage_Adminhtml_Model_System_Config_Source_Order_Status_Newprocessing extends Mage_Adminhtml_Model_System_Config_Source_Order_Status
{
protected $_stateStatuses = array(
Mage_Sales_Model_Order::STATE_NEW,
Mage_Sales_Model_Order::STATE_PROCESSING
);
}
1 change: 1 addition & 0 deletions app/code/core/Mage/Bundle/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<bundle translate="label" module="bundle">
<label>Bundle Product</label>
<model>bundle/product_type</model>
<composite>1</composite>
<allowed_selection_types>
<simple />
<virtual />
Expand Down
6 changes: 5 additions & 1 deletion app/code/core/Mage/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ protected function _beforeSave()
$hasOptions = false;
$hasRequiredOptions = false;

$this->canAffectOptions($this->_canAffectOptions || $this->getCanSaveCustomOptions());
/**
* $this->_canAffectOptions - set by type instance only
* $this->getCanSaveCustomOptions() - set either in controller when "Custom Options" ajax tab is loaded, or in type instance as well
*/
$this->canAffectOptions($this->_canAffectOptions && $this->getCanSaveCustomOptions());
if ($this->getCanSaveCustomOptions()) {
$options = $this->getProductOptions();
if (is_array($options)) {
Expand Down
21 changes: 21 additions & 0 deletions app/code/core/Mage/Catalog/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Mage_Catalog_Model_Product_Type
const DEFAULT_PRICE_MODEL = 'catalog/product_type_price';

static protected $_types;
static protected $_compositeTypes;
static protected $_priceModels;

/**
Expand All @@ -67,6 +68,7 @@ public static function factory($product)

$typeModel = Mage::getModel($typeModelName);
$typeModel->setProduct($product);
$typeModel->setConfig($types[$product->getTypeId()]);
return $typeModel;
}

Expand Down Expand Up @@ -150,4 +152,23 @@ static public function getTypes()

return self::$_types;
}

/**
* Return composite product type Ids
*
* @return array
*/
static public function getCompositeTypes()
{
if (is_null(self::$_compositeTypes)) {
self::$_compositeTypes = array();
$types = self::getTypes();
foreach ($types as $typeId=>$typeInfo) {
if (array_key_exists('composite', $typeInfo) && $typeInfo['composite']) {
self::$_compositeTypes[] = $typeId;
}
}
}
return self::$_compositeTypes;
}
}
14 changes: 14 additions & 0 deletions app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,20 @@ public function isComposite()
return $this->_isComposite;
}

/**
* Setting specified product type variables
*
* @param array $config
* @return Mage_Catalog_Model_Product_Type_Abstract
*/
public function setConfig($config)
{
if (isset($config['composite'])) {
$this->_isComposite = (bool) $config['composite'];
}
return $this;
}

/**
* Default action to get sku of product
*
Expand Down
Loading

0 comments on commit 7e3cf77

Please sign in to comment.