0

I am creating a very simple custom module to display an inline popup in my store.

The problem is that the my additional JS doesn't seem to be added, and the phtml file is not loaded. Both are in newsletterpopup.xml.

What am I missing?

\app\etc\modules\Mav_NewsletterPopUp.xml

<?xml version="1.0" ?>
<config>
      <modules>
            <Mav_NewsletterPopUp>
                  <active>true</active>
                  <codePool>local</codePool>
            </Mav_NewsletterPopUp>
      </modules>
</config>

\app\code\local\Mav\NewsletterPopUp\etc\config.xml

<?xml version="1.0" ?>

<config>
      <modules>
            <Mav_NewsletterPopUp>
                  <version>0.0.1</version>
            </Mav_NewsletterPopUp>
      <modules>
      <frontend>
            <layout>
                  <updates>
                        <newsletterpopup>
                              <file>newsletterpopup.xml</file>
                        </newsletterpopup>
                  </updates>
            </layout>
      </frontend>
</config>

\app\design\frontend\MY_THEME_HERE\default\layout\newsletterpopup.xml

<?xml version="1.0" ?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addJs"><script>mav/cookie/jquery.cookie.js</script></action>
        </reference>
        <reference name="before_body_end">
            <block type="core/template" name="newsletter_popup" as="newsletter_popup" template="mav/newsletter-popup.phtml" />
        </reference>
    </default>
</layout>

\app\design\frontend\MY_THEME_HERE\default\template\mav\newsletter-popup.phtml

<!-- HTML for popup shall appear here -->

\js\mav\cookie\jquery.cookie.js

//taken from http://www.demacmedia.com/wp-content/uploads/2013/08/jquery-files-for-popup1.zip
  • please try to remove your cache – Keyul Shah Jan 9 '14 at 2:03
  • i have already cleared cache, caching is also disabled – Obay Jan 9 '14 at 2:13
  • you put your js files in js folder or in your skin folder ? – Keyul Shah Jan 9 '14 at 2:15
  • no, in /js folder. specifically: /js/mav/cookie/jquery.cookie.js – Obay Jan 9 '14 at 2:34
  • Then it will be working fine. Check permission and as well as copy that addjs code in page.xml and test will be aadded or not – Keyul Shah Jan 9 '14 at 2:46
1

I think there is problem with closing tag of </modules> can you update xml with added closing tag

<config>
      <modules>
            <Mav_NewsletterPopUp>
                  <version>0.0.1</version>
            </Mav_NewsletterPopUp>
      </modules>
      <frontend>
            <layout>
                  <updates>
                        <newsletterpopup>
                              <file>newsletterpopup.xml</file>
                        </newsletterpopup>
                  </updates>
            </layout>
      </frontend>
</config>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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