Status: WIP
(Product Attribute, Customer Attributes)
-
Add required repositories to project
composer.json
:"repositories": [ { "type": "vcs", "url": "https://github.com/magento-hackathon/DerivedAttributes.git" }, { "type": "vcs", "url": "https://github.com/integer-net/IntegerNet_GridMassActionPager" } ]
-
Install via composer:
composer require magento-hackathon/derived-attributes
- Download hackathon-derivedattributes.tar.gz or hackathon-derivedattributes.zip from the Releases page
- Extract contained directory into your Magento installation. It contains all dependencies, no additional downloads necessary.
Custom conditions and generators must implement the interfaces listed below.
To add them, create an observer for the derivedattribute_new_rulemanager
event:
<events>
<derivedattribute_new_rulemanager>
<observers>
<your_module>
<type>singleton</type>
<class>Your_Module_Model_Observer</class>
<method>addDerivedAttributesPlugin</method>
</your_module>
</observers>
</derivedattribute_new_rulemanager>
</events>
In this observer:
class Your_Module_Model_Observer
{
public function addDerivedAttributesPlugin(Varien_Event_Observer $observer)
{
/** @var \Hackathon\DerivedAttributes\Service\Manager $ruleManager */
$ruleManager = $observer->getRuleManager();
$ruleManager->addConditionType('your_unique_condition_identifier', Mage::getModel('your_module/your_condition_class'));
$ruleManager->addGeneratorType('your_unique_generator_identifier', Mage::getModel('your_module/your_generator_class'));
}
}
GeneratorInterface configure(string $data)
string getData()
mixed generateAttributeValue(EntityInterface $entity)
string getTitle()
string getDescription()
ConditionInterface configure(string $data)
string getData()
boolean match(EntityInterface $entity)
string getTitle()
string getDescription()
There is NO magic for "derived of derivedAttributes". Just rule priority.