We operate both a wholesale and retail business from the same web site. Currently Magento supports a percentage discount on the retail price using catalog price rules: this is very easy to set up (thanks!)
We have created hidden categories “Retail minus 10%”, “retail minus 20%”, ‘Retail minus 30%” etc with appropriate price rules, and then added products to each category based on our margins.
But some wholesale customers are special: we give them “Cost plus 20%” (or whatever) across a range of products. It would be very handy to have this as an option on the catalog price rules.
I rummaged in the source code for an hour or so but it looks like there is no simple way to extend the pricing rules with our own custom ones. Either creating an event, or making little subclasses for by_percent, to_percent etc with the option to dynamically load others would allow us to create any price rule we liked…
no… the code is written with a lot of switch/case statements in a not-very-extensible way.
the only way to create this functionality would be to edit the core code, which I’m reluctant to do because magento is still under rapid development. I have put in a feature request with a suggestion that they refactor it using dynamically loadable methods to make it extensible
I saw this post from you from a long time ago which may solve an issue I have.
I’m building a website with a wholesale and retail business from the same web site.
- For Retail customers I use the ‘price’ variable, default in Magento.
- For wholesale customers I want to use cost plus.
It’s important to be able to do this at the same time, because the retail price has a relation to ‘what the market bears’, whilst wholesale has a relation to cost.
I tried making a custom category called ‘listprice’, from which I wanted to give a discount for all wholesale customers, depending on customer group. This way I can still build the relationship to cost, by making the listprice three times the cost, and then giving % discounts off listprice. But even that doesn’t seem possible in Magento.
Your post below makes me think that you have managed to crack this second approach, and still leave the default Magento retail pricing mechanism intact. I guess it comes down to a simple mechanism whereby depending on customer group the discount is either applied on ‘price’ or on ‘listprice’.
Do you know how to do this?
I bet you can make a small fortune if you build this simple mechanism into an extension. But for now, please help me, lol.
amartinez - 11 March 2011 12:35 AM
this method may be right:
1/ from your ERP-CRM-ACCOUNT SYSTEM export your customers and his special price rules
2/ them, export your products & base prices
3/ Import customers and products to your website
4/ in your website again, create an additional custom price table, use some SQL file like:
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; USE magento_store_database; DROP TABLE IF EXISTS amartinez_custom_prices; CREATE TABLE amartinez_custom_prices ( customer varchar(15), product_id varchar(15), minimal_qty varchar(15), price varchar(15), discount_1 varchar(15), discount_2 varchar(15), discount_3 varchar(15), some_other_price varchar(15), KEY customer (customer, product_id) ) ENGINE=MyIsam DEFAULT CHARSET=utf8; insert into amartinez_custom_prices values("-1","0003.0119","15","1.5649999999999999","10","0","0","1.41"); insert into amartinez_custom_prices values("-1","0003.0120","15","2.0529999999999999","10","0","0","1.84"); insert into amartinez_custom_prices values("-1","0003.0121","15","2.5099999999999998","10","0","0","2.26"); ...
5/ extend magento price model by creating and editing app/code/local/Mage/Catalog/Model/Product/Type/Price.php. I suggest to edit these functions: getPrice, getFinalPrice and getTierPrice