Magento Module: Quick Viewer

A responsive product quick-view integration with full PDP capabilities.

Details

This module was developed to add popular quick-view functionality to product listing pages. The requirements for this module were unique, in that it had to support both a B2C and B2B user experience.

The result was a full-featured product view that accelerated catalog navigation and conversions.

Screenshots

Quickview button on product listing pages

Quickview modal on B2C

Quickview modal on B2B

Technical Features

Code Sample

public function processQuickviewCartUpdate(Varien_Event_Observer $observer)
{
    $canProcess = false;
    $response   = null;
    $request    = null;
    $data       = array(
        'status'    => true,
        'message'   => '',
        'error'     => '',
        'blocks'    => array(),
        // @todo build into system config
        'scripts'   => "AA.MiniCart.init(new AA.MouseToucher());",
    );

    try {
        $request    = $observer->getEvent()->getRequest();
        $response   = $observer->getEvent()->getResponse();
        $product    = $observer->getEvent()->getProduct();

        if (!$request) {
            $request = Mage::app()->getRequest();
        }

        if (!$request->getParam(Groove_AAQuickView_Block_Product_View::REQUEST_PARAM_QUICKVIEW)) {
            return;
        }

        $canProcess = true;

        $data['blocks']     = $this->_loadCartBlocksHtml();
        $data['message']    = Mage::helper('quickview')->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
    } catch (Mage_Core_Exception $error) {
        $data['status'] = false;
        $data['error']  = $error->getMessage();
    } catch (Exception $error) {
        $data['status'] = false;
        $data['error']  = Mage::helper('quickview')->__('Unable to process cart request.');

        Mage::logException($error);
    }

    if (!$canProcess) {
        return;
    }

    if (!$response) {
        $response = Mage::app()->getResponse();
    }

    $response->setHeader('Content-type', 'application/json')
        ->setBody(Mage::helper('core')->jsonEncode($data))
        ->sendResponse();

    exit;
}

Static Analysis