Hidden Secrets of Magento Price Rules
Upcoming SlideShare
Loading in...5

Hidden Secrets of Magento Price Rules



Meet Magento Poland Presenetation

Meet Magento Poland Presenetation



Total Views
Views on SlideShare
Embed Views



4 Embeds 40

http://www.linkedin.com 19
https://twitter.com 17
http://www.slashdocs.com 3
https://www.linkedin.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Hidden Secrets of Magento Price Rules Hidden Secrets of Magento Price Rules Presentation Transcript

    • Ivan ChepurnyiHidden Secrets of Magento Promotion Rules
    • About Me• Devoted to Magento Platform since 2007• Ex Magento Core Team member• 5+ Years of Magento Development Experience• Co-Founder & Technical Director at EcomDev• Providing Training Courses for Magento Developers
    • Short Overview• Price Calculation Basics• Catalog Rule vs Shopping Cart Rule• The Base of Promo Rules• How To Customize
    • General Magento Price TypesFinal Price Minimal Price• Based on Qty & • Based on Customer Customer Group Group• Calculated • Calculated by Dynamically Indexer• Used in: • Used in: – Shopping Cart – Product List – Product View
    • Minimal PriceIt is just minimal variation of final price
    • Final Price Option Price 1Minimal Option Price 2Base Price … Option Price N
    • Minimal Base Price• Product Price Magento takes• Tier Price minimal value• Group Price (CE1.7) from the following• Special Price calculated price• Catalog Rule Price variations.
    • Option Price• Configurable Product Options (If Product is Configurable)• Custom Options
    • And finallyPRICE RULES
    • Price Rules• Easy way to set up discounts for a group of products• Conditional Discounts Based on – Product Attributes – Customer Group – Shopping Cart Content
    • Price Rule TypesCatalog Price Rules Shopping Cart Price Rules• Pre-applied • Applied on the fly• Affect Final Product • Affect Shopping Cart Price Totals• Conditions only for • Various Set of Product Attributes Conditions – Product Sub-select – Address Match – Advanced Customer Targeting
    • Use CasesCatalog Price Rules Shopping Cart Price Rule• Season Sale • Buy X Get Y Free Discount Discount• Customer Group • Free Shipping on Discount Particular Items• Discount on Product • Special Discount for Attribute Match Loyal Customers (in conjunction with Customer Segment)
    • And finally some codeMAGE_RULE MODULE
    • Mage_Rule Module Condition Mage_Rule_Model_Condition_AbstractRule ModelMage_Rule_Model_Rule Action Mage_Rule_Model_Action_Abstract
    • Rule ModelContains such information• Conditions set• Actions set• Takes care about matched object
    • Condition Model• Conditions can be complex or simple• Matched against some Varien_Object (Product, Address, Customer, etc)• All condition models extended from Mage_Rule_Model_Condition_Abstract
    • Action Model• Supposed to be flexible list of actions that should be performed• Currently is not used in the system
    • Specific ImplementationsMagento Community Edition• Mage_CatalogRule• Mage_SalesRuleMagento Enterprise Edition• Enterprise_TargetRule• Enterprise_CustomerSegment
    • Doing SimpleCUSTOMIZATION
    • Create Custom Condition1. Extend from this class in gist: https://gist.github.com/41363392. Implement _getLabel() method3. Implement _initProperties() method4. Add your condition to combine condition model for existing rule
    • Properties Initializationprotected function _initProperties(){ $this->_properties = array( ‘attribute_ => array( label => ‘Some Field Name’, type => select, data_path => ’data/path’, options => array() ) );}
    • Property TypesTypes:• string• numeric• date• select• multiselect
    • Adding To Combine CondFor Sales Rules• Add observer to salesrule_rule_condition_combine• Add an array item to additional event property: $observer->getEvent()->setAdditional( Mage::getModel(‘yourcondition/model’)->getNewChildSelectOptions() );
    • Thank You!
    • Test Driven DevelopmentTraining Course inBerlin, 09-10 Janhttp://bit.ly/QeOmia
    • Questions?Twitter:@IvanChepurnyiEmail:ivan@ecomdev.orgBlog:ecomdev.org