-
-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New feature: ConfigurableSwatches now allows for auto-generation of t…
…he swatch image file based on color selection (#3686) Co-authored-by: Fabrizio Balliano <[email protected]>
- Loading branch information
1 parent
6ea8cf0
commit ad57659
Showing
13 changed files
with
527 additions
and
256 deletions.
There are no files selected for viewing
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
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
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
30 changes: 30 additions & 0 deletions
30
app/code/core/Mage/Eav/Model/Entity/Attribute/Option/Swatch.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* OpenMage | ||
* | ||
* 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 at https://opensource.org/license/osl-3-0-php | ||
* | ||
* @category Mage | ||
* @package Mage_Eav | ||
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org) | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Entity attribute swatch model | ||
* | ||
* @category Mage | ||
* @package Mage_Eav | ||
* | ||
* @method Mage_Eav_Model_Resource_Entity_Attribute_Option_Swatch _getResource() | ||
* @method Mage_Eav_Model_Resource_Entity_Attribute_Option_Swatch getResource() | ||
*/ | ||
class Mage_Eav_Model_Entity_Attribute_Option_Swatch extends Mage_Core_Model_Abstract | ||
{ | ||
public function _construct() | ||
{ | ||
$this->_init('eav/entity_attribute_option_swatch'); | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Swatch.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* OpenMage | ||
* | ||
* 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 at https://opensource.org/license/osl-3-0-php | ||
* | ||
* @category Mage | ||
* @package Mage_Eav | ||
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org) | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* Entity attribute swatch resource model | ||
* | ||
* @category Mage | ||
* @package Mage_Eav | ||
*/ | ||
class Mage_Eav_Model_Resource_Entity_Attribute_Option_Swatch extends Mage_Core_Model_Resource_Db_Abstract | ||
{ | ||
protected function _construct() | ||
{ | ||
$this->_init('eav/attribute_option_swatch', 'option_id'); | ||
} | ||
} |
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
57 changes: 57 additions & 0 deletions
57
app/code/core/Mage/Eav/sql/eav_setup/upgrade-1.6.0.1-1.6.0.2.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* OpenMage | ||
* | ||
* 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 at https://opensource.org/license/osl-3-0-php | ||
* | ||
* @category Mage | ||
* @package Mage_Eav | ||
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org) | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** @var Mage_Eav_Model_Entity_Setup $installer */ | ||
$installer = $this; | ||
$installer->startSetup(); | ||
|
||
/** | ||
* Create table 'eav/attribute_option_swatch' | ||
*/ | ||
$table = $installer->getConnection() | ||
->newTable($installer->getTable('eav/attribute_option_swatch')) | ||
->addColumn('value_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, [ | ||
'identity' => true, | ||
'unsigned' => true, | ||
'nullable' => false, | ||
'primary' => true, | ||
], 'Value Id') | ||
->addColumn('option_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, [ | ||
'unsigned' => true, | ||
'nullable' => false, | ||
'default' => '0', | ||
], 'Option Id') | ||
->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, 255, [ | ||
'nullable' => true, | ||
'default' => null, | ||
], 'Value') | ||
->addColumn('filename', Varien_Db_Ddl_Table::TYPE_TEXT, 255, [ | ||
'nullable' => true, | ||
'default' => null, | ||
], 'Filename') | ||
->addIndex( | ||
$installer->getIdxName('eav/attribute_option_value', ['option_id']), | ||
['option_id'], | ||
['type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE] | ||
) | ||
->addForeignKey( | ||
$installer->getFkName('eav/attribute_option_swatch', 'option_id', 'eav/attribute_option', 'option_id'), | ||
'option_id', | ||
$installer->getTable('eav/attribute_option'), | ||
'option_id', | ||
Varien_Db_Ddl_Table::ACTION_CASCADE, | ||
Varien_Db_Ddl_Table::ACTION_CASCADE | ||
) | ||
->setComment('Eav Attribute Option Swatch'); | ||
$installer->getConnection()->createTable($table); |
Oops, something went wrong.