├── 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 |
__('There are no products matching the selection.') ?>
26 | 27 |
37 | Quick View
38 |
39 |
40 |
41 |
__('Out of stock') ?>
55 | 56 |
87 | Quick View
88 |
89 |
90 |
91 |
__('Out of stock') ?>
102 | 103 |"+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 = ''; 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 | }); --------------------------------------------------------------------------------