Magento – Show popup with item info on clicking add to cart

magento-1.7

I need to display a popup with item name and its other attributes like color, manufacturer, etc when we add this product in cart.
I need to display the popup on clicking add to cart button on product page.
Please guide me, I have tried few things like getting product info after "product_add_to_cart_complete" event but didn't get appropriate result.
I want to show all the product info as it is coming in cart page, like if we have a configurable product, then product is appearing with its option on cart page, same is wanted on popup also.

Best Answer

Follow below steps for creating popup window, you will need to create your block for displaying the attributes.

add include below files using layout xml

<action method="addItem"><type>js</type><name>prototype/window.js</name></action>
<action method="addItem"><type>js_css</type><name>prototype/windows/themes/default.css</name></action>
<action method="addCss"><name>lib/prototype/windows/themes/magento.css</name></action>

below is the prototype function which will invoke the widowbox

function showPopup(sUrl) {
    oPopup = new Window({
    id:'popup_window',
    className: 'magento',
    url: sUrl,
    width: 820,
    height: 600,
    minimizable: false,
    maximizable: false,
    showEffectOptions: {
        duration: 0.4
    },
    hideEffectOptions:{
        duration: 0.4
    },
    destroyOnClose: true
    });
    oPopup.setZIndex(100);
    oPopup.showCenter(true);
}

function closePopup() {
    Windows.close('popup_window');
}

invoke function using below code

$('test_me').observe('click', function(event) {
    showPopup('<?php echo Mage::getUrl("here_url_of_block_which_will_have_those_attributes") ?>');
    //Event.stop(oEvent);
});