├── LICENSE.txt ├── README.md ├── app ├── code │ └── community │ │ └── Czettner │ │ └── Ajax │ │ ├── Block │ │ └── Product.php │ │ ├── controllers │ │ └── ProductController.php │ │ └── etc │ │ └── config.xml ├── design │ └── frontend │ │ ├── base │ │ └── default │ │ │ └── template │ │ │ └── czettner_ajax │ │ │ └── product.phtml │ │ └── default │ │ └── default │ │ ├── layout │ │ └── czettner_ajax.xml │ │ └── template │ │ └── czettner_ajax │ │ └── list.phtml └── etc │ └── modules │ └── Czettner_Ajax.xml └── skin └── frontend └── default └── default ├── css └── czettner_ajax.css ├── images ├── ajax_loader.gif └── close.gif └── js └── productInfo.js /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License (MIT) 2 | 3 | Copyright (c) 2014 Czettner Sándor 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Magento Quick View Ajax Loader 2 | ============================== 3 | 4 | "Quick View Ajax Loader" is an extension for the product list page in your Magento online store. Let your customers see the details of the products in your store without leaving the category page. 5 | 6 | Compatible with Magento 1.4, 1.4.1.1, 1.5, 1.6, 1.7, 1.8, 1.9 7 | 8 | 9 | 10 | 11 | Installation instructions 12 | ========================= 13 | 14 | * Copy the content of the repo to the Magento installation folder 15 | * Modify your list.phtml image section or use czettner_ajax/list.phtml (already configured, see czettner_ajax.xml) 16 | * Hide the button from your CSS (thanks lawrencetaur): 17 | .product-image .ajax{ display:none;} 18 | .product-image .ajax:hover{ display:block;} 19 | -------------------------------------------------------------------------------- /app/code/community/Czettner/Ajax/Block/Product.php: -------------------------------------------------------------------------------- 1 | setTemplate('czettner_ajax/product.phtml'); 12 | } 13 | 14 | protected function _toHtml() { 15 | return parent::_toHtml(); 16 | } 17 | 18 | public function setProduct($product) { 19 | $this->product = $product; 20 | return $this; 21 | } 22 | 23 | public function getProduct() { 24 | return $this->product; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/code/community/Czettner/Ajax/controllers/ProductController.php: -------------------------------------------------------------------------------- 1 | getRequest()->isXmlHttpRequest()) { 9 | $this->_redirect('/'); 10 | } 11 | 12 | if ($product = $this->_initProduct()) { 13 | $this->getResponse() 14 | ->setBody($this->getLayout() 15 | ->createBlock('ajax/product') 16 | ->setProduct($product) 17 | ->toHtml()); 18 | } else { 19 | echo Mage::helper('catalog')->__('Product not found'); 20 | } 21 | } 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /app/code/community/Czettner/Ajax/etc/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | Czettner_Ajax_Block 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | standard 21 | 22 | Czettner_Ajax 23 | ajax 24 | 25 | 26 | 27 | 28 | 29 | 30 | czettner_ajax.xml 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/design/frontend/base/default/template/czettner_ajax/product.phtml: -------------------------------------------------------------------------------- 1 | getProduct(); 3 | ?> 4 | 5 |
6 |
7 | 8 | 9 | 10 |
11 | 12 |
13 |

getName(); ?>

14 | 15 |

__('Quick Overview') ?>

16 |
getShortDescription(); ?>
17 | 18 |
19 | 20 |
21 |
22 | getPriceHtml($_product); ?> 23 |
24 |
25 | isSaleable()): ?> 26 | 27 | 28 |
29 |
30 |
31 |
32 |
-------------------------------------------------------------------------------- /app/design/frontend/default/default/layout/czettner_ajax.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | skin_jsjs/productInfo.js 15 | css/czettner_ajax.css 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | skin_jsjs/productInfo.js 29 | css/czettner_ajax.css 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/design/frontend/default/default/template/czettner_ajax/list.phtml: -------------------------------------------------------------------------------- 1 | 6 | Quick View 7 | 8 | <?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?> 9 | 10 |

11 | */ 12 | ?> 13 | 20 | getLoadedProductCollection(); 22 | $_helper = $this->helper('catalog/output'); 23 | ?> 24 | count()): ?> 25 |

__('There are no products matching the selection.') ?>

26 | 27 |
28 | getToolbarHtml() ?> 29 | 30 | getMode()!='grid'): ?> 31 | 32 |
    33 | 34 |
  1. 35 | 36 |

    37 | Quick View 38 | 39 | <?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?> 40 | 41 |

    42 | 43 |
    44 |
    45 | stripTags($_product->getName(), null, true); ?> 46 |

    productAttribute($_product, $_product->getName() , 'name'); ?>

    47 | getRatingSummary()): ?> 48 | getReviewsSummaryHtml($_product) ?> 49 | 50 | getPriceHtml($_product, true) ?> 51 | isSaleable()): ?> 52 |

    53 | 54 |

    __('Out of stock') ?>

    55 | 56 |
    57 | productAttribute($_product, $_product->getShortDescription(), 'short_description') ?> 58 | __('Learn More') ?> 59 |
    60 | 68 |
    69 |
    70 |
  2. 71 | 72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | count() ?> 80 | getColumnCount(); ?> 81 | 82 | 83 | 115 | 116 | 117 | 118 | 119 | 120 |
121 | getToolbarHtml() ?> 122 |
123 |
124 | 125 | -------------------------------------------------------------------------------- /app/etc/modules/Czettner_Ajax.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | community 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /skin/frontend/default/default/css/czettner_ajax.css: -------------------------------------------------------------------------------- 1 | #quick-window{ 2 | position:absolute; 3 | z-index:500; 4 | background-color:#fff; 5 | width:650px; 6 | border:1px solid #aaa; 7 | display:none; 8 | -webkit-box-shadow: 0px 0px 30px 0px #000; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */ 9 | box-shadow: 0px 0px 30px 0px #000; /* Opera 10.5, IE9, FF4+, Chrome 6+, iOS 5 */ 10 | } 11 | #quick-window .product-img-box{width:230px; float:left} 12 | #quickview-close{ 13 | background:url(../images/close.gif) no-repeat center center; 14 | float:right; 15 | width:10px; 16 | height:10px; 17 | margin:7px; 18 | text-indent: -10000px; 19 | overflow: hidden; 20 | } 21 | #quickview-header{background-color:#888; height:26px; width:650px;} 22 | 23 | #ajax-preloader{ 24 | opacity:0.8; 25 | filter:alpha(opacity="80"); 26 | text-align:center; 27 | z-index:500; 28 | background: url(../images/ajax_loader.gif) center top no-repeat; 29 | } 30 | #ajax-preloader .loading{border:2px solid #777; color:#000; background:#eee; text-align:center; width:120px; padding:15px; font-weight:bold;} 31 | #quick-window .product-shop{float:right; text-align:left; width:385px;} 32 | #quick-window .product-essential{padding:25px 10px 25px 10px;} 33 | .catalog-listing .product-image{position:relative;} 34 | .catalog-listing .product-image .ajax{position:absolute; display:none; z-index:20;} 35 | 36 | a.ajax{ 37 | text-decoration:none; 38 | border:1px solid #888; 39 | background:#bbb; color:#fff; 40 | font-weight:bold; 41 | padding:0px 10px; 42 | position: absolute; 43 | } 44 | a.ajax:hover{text-decoration:none;} -------------------------------------------------------------------------------- /skin/frontend/default/default/images/ajax_loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czettnersandor/magento-quick-view-ajax/f8e19a7494fb80fee76473856070f6b9355e42be/skin/frontend/default/default/images/ajax_loader.gif -------------------------------------------------------------------------------- /skin/frontend/default/default/images/close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/czettnersandor/magento-quick-view-ajax/f8e19a7494fb80fee76473856070f6b9355e42be/skin/frontend/default/default/images/close.gif -------------------------------------------------------------------------------- /skin/frontend/default/default/js/productInfo.js: -------------------------------------------------------------------------------- 1 | var ProductInfo = Class.create(); 2 | ProductInfo.prototype = { 3 | settings: { 4 | 'loadingMessage': 'Please wait ...' 5 | }, 6 | 7 | initialize: function(selector, x_image, settings) 8 | { 9 | Object.extend(this.settings, settings); 10 | this.createWindow(); 11 | 12 | var that = this; 13 | $$(selector).each(function(el, index){ 14 | el.observe('click', that.loadInfo.bind(that)); 15 | }) 16 | $$(x_image).each(function(el, index){ 17 | el.observe('mouseover', that.showButton); 18 | el.observe('mouseout', that.hideButton); 19 | }) 20 | 21 | }, 22 | 23 | createLoader: function() 24 | { 25 | var loader = new Element('div', {id: 'ajax-preloader'}); 26 | loader.innerHTML = "

"+this.settings.loadingMessage+"

"; 27 | document.body.appendChild(loader); 28 | $('ajax-preloader').setStyle({ 29 | position: 'absolute', 30 | top: document.viewport.getScrollOffsets().top + 200 + 'px', 31 | left: document.body.clientWidth/2 - 75 + 'px' 32 | }); 33 | }, 34 | 35 | destroyLoader: function() 36 | { 37 | $('ajax-preloader').remove(); 38 | }, 39 | 40 | showButton: function(e) 41 | { 42 | el = this; 43 | while (el.tagName != 'P') { 44 | el = el.up(); 45 | } 46 | $(el).getElementsBySelector('.ajax')[0].setStyle({ 47 | display: 'block' 48 | }) 49 | }, 50 | 51 | hideButton: function(e) 52 | { 53 | el = this; 54 | while (el.tagName != 'P') { 55 | el = el.up(); 56 | } 57 | $(el).getElementsBySelector('.ajax')[0].setStyle({ 58 | display: 'none' 59 | }) 60 | }, 61 | 62 | createWindow: function() 63 | { 64 | var qWindow = new Element('div', {id: 'quick-window'}); 65 | qWindow.innerHTML = '
close
'; 66 | document.body.appendChild(qWindow); 67 | $('quickview-close').observe('click', this.hideWindow.bind(this)); 68 | }, 69 | 70 | showWindow: function() 71 | { 72 | $('quick-window').setStyle({ 73 | top: document.viewport.getScrollOffsets().top + 100 + 'px', 74 | left: document.body.clientWidth/2 - $('quick-window').getWidth()/2 + 'px', 75 | display: 'block' 76 | }); 77 | }, 78 | 79 | setContent: function(content) 80 | { 81 | $$('.quick-view-content')[0].insert(content); 82 | }, 83 | 84 | clearContent: function() 85 | { 86 | $$('.quick-view-content')[0].replace('
'); 87 | }, 88 | 89 | hideWindow: function() 90 | { 91 | this.clearContent(); 92 | $('quick-window').hide(); 93 | }, 94 | 95 | loadInfo: function(e) 96 | { 97 | e.stop(); 98 | var that = this; 99 | this.createLoader(); 100 | new Ajax.Request(e.element().href, { 101 | onSuccess: function(response) { 102 | that.clearContent(); 103 | that.setContent(response.responseText); 104 | that.destroyLoader(); 105 | that.showWindow(); 106 | } 107 | }); 108 | } 109 | } 110 | 111 | Event.observe(window, 'load', function() { 112 | new ProductInfo('.ajax', '.product-image', { 113 | }); 114 | }); --------------------------------------------------------------------------------