2

I'm working developing a Magento 1.9 extension and I'm having a hard time trying to load/include a Javascript file in a specific checkout step.

I'm able to include the javascript file in the footer, but I need it to be included when the user reach the "Payment Information step", more precisely, when the payment methods are loaded, as shown in the below print screen.

enter image description here

I added this code in my extension hoping it would show an alert message when I reach the "Payment Information", but nothing happens...

<checkout_onepage_paymentmethod>
    <reference name="head">
        <action method="setText">
            <text><![CDATA[<script type="text/javascript">alert('hello')</script>]]></text>
        </action>
    </reference>
</checkout_onepage_paymentmethod>

Thanks for any help

  • why do you need it to be loaded at a specific step? it should load on the checkout page and your script should target the event of the payment information step – Haim Nov 29 '17 at 19:23
  • I did it this way, @Haim. I'll update my question – felipe_bool Nov 30 '17 at 12:19

Your Answer

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

Browse other questions tagged or ask your own question.