Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a module that uses the "before_body_end". On some pages a second module also uses before_body_end. Is there a way to dermine the order ?


<div class='mymodule'></div>
<div class='3rdpartymodule'></div>

to :

<div class='3rdpartymodule'></div>
<div class='mymodule'></div>
share|improve this question
up vote 3 down vote accepted

An addendum to @marius' answer, rather than place the core dependency in a core override you can state the dependency in your own module so that disabling it also disables the dependency:

<?xml version="1.0"?>
share|improve this answer

in the layout XML of your extension add the after attribute to the block declaration.

<reference name="before_body_end">
   <block type="your/module" name="your_module" after="-" template="your/module.phtml"/>

As long as the other extension doesn't do the same you should be good and your block should always be inserted last.

share|improve this answer

Make you module depend on the third party module. Add this in app/etc/modules/[Namespace]_[Module].xml

    <Thirdparty_Module />
share|improve this answer
Looks a bit like a hack. It would also mean that the third party module can't be disabled. – Fran Mar 12 '14 at 15:53
Not a hack. A workaround. See my answer for an addendum to this method, @Fran – philwinkle Mar 12 '14 at 17:15
This is not actually a hack. It's a feature :). If you don't like this approach you can try what @SanderMangel posted. I don't know how I didn't thing of that. It's kind of obvious. – Marius Mar 13 '14 at 8:26
Sorry but this is a dirty solution. @Sander provided the right answer there. Your solution would imply the first module DEPENDS on the other one, which is absolutely not true. Not saying it's not going to work, it's just not a very clean way to achieve it. – Fran Mar 13 '14 at 17:18
@Fran I totally agree with you on this. – Marius Mar 13 '14 at 17:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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