SlideShare a Scribd company logo
1 of 27
Ivan Chepurnyi

Hidden 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 Types
Final 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 Price


It is just minimal variation of
           final price
HOW IS CALCULATED FINAL
         PRICE?
Final Price

                Option Price 1

Minimal         Option Price 2
Base 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 finally
PRICE 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 Types
Catalog 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 Cases
Catalog 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 code
MAGE_RULE MODULE
Mage_Rule Module

                        Condition
                        Mage_Rule_Model_Condition_Abstract



Rule Model
Mage_Rule_Model_Rule



                       Action
                       Mage_Rule_Model_Action_Abstract
Rule Model
Contains 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 Implementations
Magento Community Edition
• Mage_CatalogRule
• Mage_SalesRule

Magento Enterprise Edition
• Enterprise_TargetRule
• Enterprise_CustomerSegment
Doing Simple

CUSTOMIZATION
Create Custom Condition
1. Extend from this class in gist:
   https://gist.github.com/4136339

2. Implement _getLabel() method

3. Implement _initProperties() method

4. Add your condition to combine condition model for
   existing rule
Properties Initialization
protected function _initProperties()
{
    $this->_properties = array(
          ‘attribute_' => array(
               'label' => ‘Some Field Name’,
               'type' => 'select',
               'data_path' => ’data/path’,
               'options' => array()
          )
     );
}
Property Types
Types:
• string
• numeric
• date
• select
• multiselect
Adding To Combine Cond
For 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 Development
Training Course in
Berlin, 09-10 Jan

http://bit.ly/QeOmia
Questions?
Twitter:
@IvanChepurnyi


Email:
ivan@ecomdev.org


Blog:
ecomdev.org

More Related Content

What's hot

Optimizing Magento by Preloading Data
Optimizing Magento by Preloading DataOptimizing Magento by Preloading Data
Optimizing Magento by Preloading DataIvan Chepurnyi
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
 
UI아트 작업자를 위한 언리얼엔진4 UMG #1
UI아트 작업자를 위한 언리얼엔진4 UMG #1UI아트 작업자를 위한 언리얼엔진4 UMG #1
UI아트 작업자를 위한 언리얼엔진4 UMG #1Hong-Gi Joe
 
Design patterns in Magento
Design patterns in MagentoDesign patterns in Magento
Design patterns in MagentoDivante
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
 
Ndc2010 김주복, v3. 마비노기2아키텍처리뷰
Ndc2010   김주복, v3. 마비노기2아키텍처리뷰Ndc2010   김주복, v3. 마비노기2아키텍처리뷰
Ndc2010 김주복, v3. 마비노기2아키텍처리뷰Jubok Kim
 
Introduction To Git For Version Control Architecture And Common Commands Comp...
Introduction To Git For Version Control Architecture And Common Commands Comp...Introduction To Git For Version Control Architecture And Common Commands Comp...
Introduction To Git For Version Control Architecture And Common Commands Comp...SlideTeam
 
UI드자이너의 짧은 언리얼 UMG 사용기
UI드자이너의 짧은 언리얼 UMG 사용기UI드자이너의 짧은 언리얼 UMG 사용기
UI드자이너의 짧은 언리얼 UMG 사용기Hong-Gi Joe
 
Angular 4 The new Http Client Module
Angular 4 The new Http Client ModuleAngular 4 The new Http Client Module
Angular 4 The new Http Client Modulearjun singh
 
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用Will Huang
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesWebStackAcademy
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - DirectivesWebStackAcademy
 
Django로 쇼핑몰 만들자
Django로 쇼핑몰 만들자Django로 쇼핑몰 만들자
Django로 쇼핑몰 만들자Kyoung Up Jung
 
Smart modeling of smart software
Smart modeling of smart softwareSmart modeling of smart software
Smart modeling of smart softwareJordi Cabot
 

What's hot (20)

Optimizing Magento by Preloading Data
Optimizing Magento by Preloading DataOptimizing Magento by Preloading Data
Optimizing Magento by Preloading Data
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 
UI아트 작업자를 위한 언리얼엔진4 UMG #1
UI아트 작업자를 위한 언리얼엔진4 UMG #1UI아트 작업자를 위한 언리얼엔진4 UMG #1
UI아트 작업자를 위한 언리얼엔진4 UMG #1
 
BDD & Cucumber
BDD & CucumberBDD & Cucumber
BDD & Cucumber
 
Design patterns in Magento
Design patterns in MagentoDesign patterns in Magento
Design patterns in Magento
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
Ndc2010 김주복, v3. 마비노기2아키텍처리뷰
Ndc2010   김주복, v3. 마비노기2아키텍처리뷰Ndc2010   김주복, v3. 마비노기2아키텍처리뷰
Ndc2010 김주복, v3. 마비노기2아키텍처리뷰
 
Introduction To Git For Version Control Architecture And Common Commands Comp...
Introduction To Git For Version Control Architecture And Common Commands Comp...Introduction To Git For Version Control Architecture And Common Commands Comp...
Introduction To Git For Version Control Architecture And Common Commands Comp...
 
UI드자이너의 짧은 언리얼 UMG 사용기
UI드자이너의 짧은 언리얼 UMG 사용기UI드자이너의 짧은 언리얼 UMG 사용기
UI드자이너의 짧은 언리얼 UMG 사용기
 
Angular 4 The new Http Client Module
Angular 4 The new Http Client ModuleAngular 4 The new Http Client Module
Angular 4 The new Http Client Module
 
Java Server Faces 2
Java Server Faces 2Java Server Faces 2
Java Server Faces 2
 
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Introduction to BDD
Introduction to BDD Introduction to BDD
Introduction to BDD
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Django로 쇼핑몰 만들자
Django로 쇼핑몰 만들자Django로 쇼핑몰 만들자
Django로 쇼핑몰 만들자
 
Smart modeling of smart software
Smart modeling of smart softwareSmart modeling of smart software
Smart modeling of smart software
 
Behave
BehaveBehave
Behave
 
Git training v10
Git training v10Git training v10
Git training v10
 

Similar to Hidden Secrets of Magento Price Rules

Merchandising & Miva Merchant 9 - Unlocking The Power Of Price Groups
Merchandising & Miva Merchant 9 - Unlocking The Power Of Price GroupsMerchandising & Miva Merchant 9 - Unlocking The Power Of Price Groups
Merchandising & Miva Merchant 9 - Unlocking The Power Of Price GroupsMiva
 
MivaCon Seattle - Merchandising & Miva Merchant 9: Unlocking the Power of Pri...
MivaCon Seattle - Merchandising & Miva Merchant 9: Unlocking the Power of Pri...MivaCon Seattle - Merchandising & Miva Merchant 9: Unlocking the Power of Pri...
MivaCon Seattle - Merchandising & Miva Merchant 9: Unlocking the Power of Pri...Miva
 
Merchandising & miva merchant 9 – unlocking the power of price groups
Merchandising & miva merchant 9 – unlocking the power of price groupsMerchandising & miva merchant 9 – unlocking the power of price groups
Merchandising & miva merchant 9 – unlocking the power of price groupsMiva
 
Merchandising & Miva Merchant 9 - Price Groups
Merchandising & Miva Merchant 9 - Price GroupsMerchandising & Miva Merchant 9 - Price Groups
Merchandising & Miva Merchant 9 - Price GroupsMiva
 
PromoTale - a sale story
PromoTale - a sale storyPromoTale - a sale story
PromoTale - a sale storyAdina Nichitean
 
eCommerce with Magento
eCommerce with MagentoeCommerce with Magento
eCommerce with MagentoTLLMN
 
Magento Product Recommendations powered by Adobe Sensei (AI)
Magento Product Recommendations powered by Adobe Sensei (AI)Magento Product Recommendations powered by Adobe Sensei (AI)
Magento Product Recommendations powered by Adobe Sensei (AI)Deepika Janiyani
 
NANO MBA3 Category Management by kongkiat phanawadee
NANO MBA3 Category Management by kongkiat phanawadee NANO MBA3 Category Management by kongkiat phanawadee
NANO MBA3 Category Management by kongkiat phanawadee Utai Sukviwatsirikul
 
Beyond Accuracy: Goal-Driven Recommender Systems Design
Beyond Accuracy: Goal-Driven Recommender Systems DesignBeyond Accuracy: Goal-Driven Recommender Systems Design
Beyond Accuracy: Goal-Driven Recommender Systems DesignData Science London
 
Common design patterns in php
Common design patterns in phpCommon design patterns in php
Common design patterns in phpDavid Stockton
 
Drupal Commerce Drupalhagen 2012
Drupal Commerce Drupalhagen 2012Drupal Commerce Drupalhagen 2012
Drupal Commerce Drupalhagen 2012Jakob Torp
 
Pricing and the ceo may 2018 for xpeg
Pricing and the ceo may 2018 for xpegPricing and the ceo may 2018 for xpeg
Pricing and the ceo may 2018 for xpegSteven Forth
 
Salesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajSalesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajYuvaraj P
 
Bmgt 411 chapter_12
Bmgt 411 chapter_12Bmgt 411 chapter_12
Bmgt 411 chapter_12Chris Lovett
 
Webinar: Successful B2B Pricing Strategies with Magento
Webinar: Successful B2B Pricing Strategies with MagentoWebinar: Successful B2B Pricing Strategies with Magento
Webinar: Successful B2B Pricing Strategies with MagentoAPPSeCONNECT
 
Webinar discover acquisio campaign automation algorithms
Webinar discover acquisio campaign automation algorithmsWebinar discover acquisio campaign automation algorithms
Webinar discover acquisio campaign automation algorithmsAcquisio
 
Ebay的自动化
Ebay的自动化Ebay的自动化
Ebay的自动化yiditushe
 
Pricing for product managers vancouver nov 2017
Pricing for product managers vancouver nov 2017Pricing for product managers vancouver nov 2017
Pricing for product managers vancouver nov 2017Steven Forth
 

Similar to Hidden Secrets of Magento Price Rules (20)

Merchandising & Miva Merchant 9 - Unlocking The Power Of Price Groups
Merchandising & Miva Merchant 9 - Unlocking The Power Of Price GroupsMerchandising & Miva Merchant 9 - Unlocking The Power Of Price Groups
Merchandising & Miva Merchant 9 - Unlocking The Power Of Price Groups
 
MivaCon Seattle - Merchandising & Miva Merchant 9: Unlocking the Power of Pri...
MivaCon Seattle - Merchandising & Miva Merchant 9: Unlocking the Power of Pri...MivaCon Seattle - Merchandising & Miva Merchant 9: Unlocking the Power of Pri...
MivaCon Seattle - Merchandising & Miva Merchant 9: Unlocking the Power of Pri...
 
Merchandising & miva merchant 9 – unlocking the power of price groups
Merchandising & miva merchant 9 – unlocking the power of price groupsMerchandising & miva merchant 9 – unlocking the power of price groups
Merchandising & miva merchant 9 – unlocking the power of price groups
 
Merchandising & Miva Merchant 9 - Price Groups
Merchandising & Miva Merchant 9 - Price GroupsMerchandising & Miva Merchant 9 - Price Groups
Merchandising & Miva Merchant 9 - Price Groups
 
PromoTale - a sale story
PromoTale - a sale storyPromoTale - a sale story
PromoTale - a sale story
 
eCommerce with Magento
eCommerce with MagentoeCommerce with Magento
eCommerce with Magento
 
Magento Product Recommendations powered by Adobe Sensei (AI)
Magento Product Recommendations powered by Adobe Sensei (AI)Magento Product Recommendations powered by Adobe Sensei (AI)
Magento Product Recommendations powered by Adobe Sensei (AI)
 
Pricing
PricingPricing
Pricing
 
NANO MBA3 Category Management by kongkiat phanawadee
NANO MBA3 Category Management by kongkiat phanawadee NANO MBA3 Category Management by kongkiat phanawadee
NANO MBA3 Category Management by kongkiat phanawadee
 
Beyond Accuracy: Goal-Driven Recommender Systems Design
Beyond Accuracy: Goal-Driven Recommender Systems DesignBeyond Accuracy: Goal-Driven Recommender Systems Design
Beyond Accuracy: Goal-Driven Recommender Systems Design
 
Common design patterns in php
Common design patterns in phpCommon design patterns in php
Common design patterns in php
 
Drupal Commerce Drupalhagen 2012
Drupal Commerce Drupalhagen 2012Drupal Commerce Drupalhagen 2012
Drupal Commerce Drupalhagen 2012
 
Recommender systems
Recommender systems Recommender systems
Recommender systems
 
Pricing and the ceo may 2018 for xpeg
Pricing and the ceo may 2018 for xpegPricing and the ceo may 2018 for xpeg
Pricing and the ceo may 2018 for xpeg
 
Salesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajSalesforce CPQ by yuvaraj
Salesforce CPQ by yuvaraj
 
Bmgt 411 chapter_12
Bmgt 411 chapter_12Bmgt 411 chapter_12
Bmgt 411 chapter_12
 
Webinar: Successful B2B Pricing Strategies with Magento
Webinar: Successful B2B Pricing Strategies with MagentoWebinar: Successful B2B Pricing Strategies with Magento
Webinar: Successful B2B Pricing Strategies with Magento
 
Webinar discover acquisio campaign automation algorithms
Webinar discover acquisio campaign automation algorithmsWebinar discover acquisio campaign automation algorithms
Webinar discover acquisio campaign automation algorithms
 
Ebay的自动化
Ebay的自动化Ebay的自动化
Ebay的自动化
 
Pricing for product managers vancouver nov 2017
Pricing for product managers vancouver nov 2017Pricing for product managers vancouver nov 2017
Pricing for product managers vancouver nov 2017
 

More from Ivan Chepurnyi

How to import 1 million SKUs in under 10 minutes
How to import 1 million SKUs in under 10 minutesHow to import 1 million SKUs in under 10 minutes
How to import 1 million SKUs in under 10 minutesIvan Chepurnyi
 
Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceMeet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceIvan Chepurnyi
 
Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Ivan Chepurnyi
 
Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)Ivan Chepurnyi
 
Magento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module developmentMagento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module developmentIvan Chepurnyi
 
Using of TDD practices for Magento
Using of TDD practices for MagentoUsing of TDD practices for Magento
Using of TDD practices for MagentoIvan Chepurnyi
 

More from Ivan Chepurnyi (6)

How to import 1 million SKUs in under 10 minutes
How to import 1 million SKUs in under 10 minutesHow to import 1 million SKUs in under 10 minutes
How to import 1 million SKUs in under 10 minutes
 
Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceMeet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
 
Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!Varnish Cache and its usage in the real world!
Varnish Cache and its usage in the real world!
 
Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)Making Magento flying like a rocket! (A set of valuable tips for developers)
Making Magento flying like a rocket! (A set of valuable tips for developers)
 
Magento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module developmentMagento 2.0: Prepare yourself for a new way of module development
Magento 2.0: Prepare yourself for a new way of module development
 
Using of TDD practices for Magento
Using of TDD practices for MagentoUsing of TDD practices for Magento
Using of TDD practices for Magento
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Hidden Secrets of Magento Price Rules

  • 1. Ivan Chepurnyi Hidden Secrets of Magento Promotion Rules
  • 2. 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
  • 3. Short Overview • Price Calculation Basics • Catalog Rule vs Shopping Cart Rule • The Base of Promo Rules • How To Customize
  • 4. General Magento Price Types Final 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
  • 5. Minimal Price It is just minimal variation of final price
  • 6. HOW IS CALCULATED FINAL PRICE?
  • 7. Final Price Option Price 1 Minimal Option Price 2 Base Price … Option Price N
  • 8. 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.
  • 9. Option Price • Configurable Product Options (If Product is Configurable) • Custom Options
  • 11. Price Rules • Easy way to set up discounts for a group of products • Conditional Discounts Based on – Product Attributes – Customer Group – Shopping Cart Content
  • 12. Price Rule Types Catalog 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
  • 13. Use Cases Catalog 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)
  • 14. And finally some code MAGE_RULE MODULE
  • 15. Mage_Rule Module Condition Mage_Rule_Model_Condition_Abstract Rule Model Mage_Rule_Model_Rule Action Mage_Rule_Model_Action_Abstract
  • 16. Rule Model Contains such information • Conditions set • Actions set • Takes care about matched object
  • 17. 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
  • 18. Action Model • Supposed to be flexible list of actions that should be performed • Currently is not used in the system
  • 19. Specific Implementations Magento Community Edition • Mage_CatalogRule • Mage_SalesRule Magento Enterprise Edition • Enterprise_TargetRule • Enterprise_CustomerSegment
  • 21. Create Custom Condition 1. Extend from this class in gist: https://gist.github.com/4136339 2. Implement _getLabel() method 3. Implement _initProperties() method 4. Add your condition to combine condition model for existing rule
  • 22. Properties Initialization protected function _initProperties() { $this->_properties = array( ‘attribute_' => array( 'label' => ‘Some Field Name’, 'type' => 'select', 'data_path' => ’data/path’, 'options' => array() ) ); }
  • 23. Property Types Types: • string • numeric • date • select • multiselect
  • 24. Adding To Combine Cond For 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() );
  • 26. Test Driven Development Training Course in Berlin, 09-10 Jan http://bit.ly/QeOmia