How to create custom price in Magento?
来源:互联网 发布:wish for mac 编辑:程序博客网 时间:2024/05/17 04:10
I recently needed a very specific shopping cart pricerule that I could not create with the existing logic inthe shopping cart price rules form. Programming to therescue.
What I needed to create was a rule that would allow each itembought after a certain qty to be half price.
Here’s how I managed to do it for my needs, but you can use thisprocedure to create any type of rule you that you can’t via thedefault logic rules.
There are two spots that normally handlethis job. One for creating the rules in admin and the other forvalidating the shopping cart rules when looking at your cart orchecking out.
- app/code/core/Mage/SalesRule/Model/Validator.php
- app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions
The good thing is each of these processes has an event we canobserve to handle our custom code.
The two events we want to observe are:
- adminhtml_block_salesrule_actions_prepareform
- salesrule_validator_process
Starting with your custom module we’ll need a minimum of twofiles to handle this operation.
- app/code/local/Namespace/Module/etc/config.xml
- app/code/local/Namespace/Module/Model/Observer.php
<config>
</config>
classNameSpace_Module_Model_Observer
{
}
- How to create custom price in Magento?
- How to create readonly columns in MOSS 2007 custom list
- How to create custom shortcut in visual studio
- How to Create Custom Window Title in Android
- How to create custom snippet in Visual studio
- Create A Custom Theme in Magento
- create a custom shipping method in magento
- How to add custom fields to Customer Registration and Account page in magento
- How to change the price range in layered navigation in Magento? - See more at: http://www.expertweba
- How to: Create a Custom List Definition
- How to Programmatically Add/Delete Custom Options in Magento? - See more at: http://apptha.com/blog/
- create magento custom api
- How to create Magento invoice from order
- How to create your own custom 404 error page and handle redirect in SharePoint 2007 (MOSS)?
- How to create your own custom 404 error page and handle redirect in SharePoint
- How to create coupon codes in Magento – Beginner’s Tutorial
- How to: Create a Custom Action Specific to a List
- Magento How To Display Product Custom Option On list.phtml
- Magento: Get category name
- Retrieving product information in Magento
- How to overload controller in Magento?
- [Magento] Overriding Core files
- Know more about your customer…
- How to create custom price in Magento?
- How to import products into Magento?
- C++面试题解答 (一)
- Automatic import using Magento cron job
- [Magento] How export and import are implemented?
- Zend Front Controller Plugin
- Zend Front Controller
- Zend Application
- jQuery Object and DOM Element