Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Product price depending on attribute value
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 

Hello,

i’m using simple products ,with custom attribute set that has a special optional attribute (call it price_category)

i want the getPrice() method of my product to return a fixed value depending on price_category attribute value.
i don’t want to define 80+ catalog price rules since it’s just a price mapping that i want to achieve and mapping may vary over time.
so , i want to be able to have that map loaded somehow in the system (surely via a specific table)

example:
price_category A , price = 10€
price_category B , price = 8€
price_category C , price = 6.5€
price_category D , price = 13€
aso…

i would like to know the best (non intrusive if possible) way to achieve that:

- redefine a sub class of SimpleProduct that has its own PriceFactory seems ok for me

but in that case , how to redefine this using a custom module ? (i try to put all my specific modification in a custom module , this enable me to inherit from Mage classes instead of redefining/patching them)

If you’ve got hints on that (or even sample code,that would even be better)

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 

really nobody can help me on this one ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nasha
Sr. Member
 
Avatar
Total Posts:  138
Joined:  2009-04-15
 

Did you find any solution ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nasha
Sr. Member
 
Avatar
Total Posts:  138
Joined:  2009-04-15
 

Create configurable product and use extension “Simple Configurable Products” extension.Hope it will help

 
Magento Community Magento Community
Magento Community
Magento Community
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 

Yes i found a solution.

I defined my own product type and patched the afterLoad method in order to fill price depending on attribute_value , mapping being held into my custom module own DB table.

 
Magento Community Magento Community
Magento Community
Magento Community
 
xmivite
Guru
 
Total Posts:  355
Joined:  2009-10-16
 

can you post the patched method here?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top