0

I'm implementing double customer group functionality for a B2B website in Magento 1. Essentially, a customer can have two customer groups, and the lowest price should be shown.

I've got it to work perfectly, both in the frontend & admin: I'm listening to the catalog_product_get_final_price (and prepare_catalog_product_price_index_table) event.

There is one issue:

The event gets fired after the catalogrule module which means that catalogrules don't apply properly.

Example product:

Base price:    $12
Group 1 price: $10
Group 2 price: $8

If a customer is part of both group 1 & 2, its price should be $8, and the catalogrule should be applied on that $8, not the $10 which is happening at the moment.

I can't make Mage_CatalogRule depend on my module to change the order of loading because modules that start with Mage_ are always loaded first.

Can anyone point me in the right direction?

1 Answer 1

0

I can't make Mage_CatalogRule depend on my module to change the order of loading because modules that start with Mage_ are always loaded first.

But you can.... Let's say your module name is Namespace_Module.
Add this in the file app/etc/modules/Namespace_Module.xml inside the <modules> tag

<Mage_CatalogRule>
    <depends>
         <Namespace_Module />
    </depends>
</Mage_CatalogRule>
1
  • Ahh awesome - I guess Mage_ is always loaded first, but when the dependency resolution system kicks in, it will still put your module higher than the Mage one. Will check if it works
    – Erfan
    May 19, 2016 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.