1

I use to have a message displaying if the customer is not over the free delivery amount just to see if they want to top their cart up to get free delivery.

This is the code i am using and i want it to pop out of the screen but instead it is just appear in the page, what am i doing wrong?

<script type="text/javascript">
        function showForm(id){
        win = new Window({ title: "form", zIndex:3000, destroyOnClose: true, recenterAuto:true, resizable: false, width:300, height:230, minimizable: false, maximizable: false, draggable: false});
        win.setContent(id, false, false);
        win.showCenter();
        }
</script>
<div style="display:none;" id="popup_form">
 <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('checkout')->toHtml()?>
</div>

 <button type="button" title="Proceed to Checkout" class="button btn-proceed-checkout btn-checkout" onclick="return showForm('popup_form')" ><span><span>Proceed to Checkout</span></span></button>

Any ideas of why it isnt poping out of the screen, I must have made a mistake in the javascript

Thanks

1

Most browsers block popups. Therefore even if this code was good then the popup would probably not show in most situations.

There are also UX reasons for not using popups.

You could do things 'the Magento way' and use the Magento notifications system:

http://inchoo.net/magento/magento-frontend/utilizing-magento-notification-system/

1

I didnt add the libraries in my local.xml file

<default>
    <reference name="head">
        <action method="addJs"><script>prototype/window.js</script></action>
        <action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
        <action method="addItem"><type>js_css</type><name>prototype/windows/themes/magento.css</name></action>
    </reference>
</default> 

All fixed now

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.