diff --git a/app/code/community/.DS_Store b/app/code/community/.DS_Store deleted file mode 100644 index e9807b5..0000000 Binary files a/app/code/community/.DS_Store and /dev/null differ diff --git a/app/code/community/Wigman/.DS_Store b/app/code/community/Wigman/.DS_Store deleted file mode 100644 index 93c3224..0000000 Binary files a/app/code/community/Wigman/.DS_Store and /dev/null differ diff --git a/app/code/community/Wigman/AjaxSwatches/.DS_Store b/app/code/community/Wigman/AjaxSwatches/.DS_Store deleted file mode 100644 index e412cbf..0000000 Binary files a/app/code/community/Wigman/AjaxSwatches/.DS_Store and /dev/null differ diff --git a/app/code/local/Wigman/AjaxSwatches/Block/Catalog/Media/Js/List.php b/app/code/local/Wigman/AjaxSwatches/Block/Catalog/Media/Js/List.php deleted file mode 100644 index 8c673d4..0000000 --- a/app/code/local/Wigman/AjaxSwatches/Block/Catalog/Media/Js/List.php +++ /dev/null @@ -1,96 +0,0 @@ -getProductImageFallbacks(); - } - -*/ - protected function _isCacheActive() - { - if (!Mage::getStoreConfig('catalog/frontend/cache_list')) { - return false; - } - - /* if there are any messages dont read from cache to show them */ - if (Mage::getSingleton('core/session')->getMessages(true)->count() > 0) { - return false; - } - return true; - - } - - public function getCacheLifetime() - { - if ($this->_isCacheActive()) { - return false; - } - } - - public function getCacheKey() - { - if (!$this->_isCacheActive()) { - parent::getCacheKey(); - } - //Mage::log($this->getPid()); - $cacheKey = 'MediaJsList_'. - /* Create different caches for different categories */ - $this->getPid().'_'. - /* ... stores */ - Mage::App()->getStore()->getCode().'_'. - ''; - -/* - foreach (Mage::app()->getRequest()->getParams() as $key=>$value) { - $cacheKey .= $key.'-'.$value.'_'; - } -*/ - return $cacheKey; - } - - - public function getCacheTags() - { - if (!$this->_isCacheActive()) { - return parent::getCacheTags(); - } - $cacheTags = array( - Mage_Catalog_Model_Product::CACHE_TAG, - Mage_Catalog_Model_Product::CACHE_TAG."_".$this->getPid() - ); - - return $cacheTags; - - } - -} diff --git a/app/code/local/Wigman/AjaxSwatches/Block/Swatchlist.php b/app/code/local/Wigman/AjaxSwatches/Block/Swatchlist.php deleted file mode 100644 index e98aa66..0000000 --- a/app/code/local/Wigman/AjaxSwatches/Block/Swatchlist.php +++ /dev/null @@ -1,123 +0,0 @@ -getPid(); - - Mage::log('pid is: ' . $pid); - - $collection = Mage::getModel('catalog/product')->getCollection() - ->addAttributeToSelect('*') - ->addAttributeToFilter('entity_id', $pid) - ->load(); - - /* @var $helper Mage_ConfigurableSwatches_Helper_Mediafallback */ - $helper = Mage::helper('configurableswatches/mediafallback'); - - /* @var $collection Mage_Catalog_Model_Resource_Product_Collection */ - //$collection = $observer->getCollection(); - - if ($collection - instanceof Mage_ConfigurableSwatches_Model_Resource_Catalog_Product_Type_Configurable_Product_Collection) { - // avoid recursion - return; - } - - $products = $collection->getItems(); - - $helper->attachChildrenProducts($products, $collection->getStoreId()); - - $helper->attachConfigurableProductChildrenAttributeMapping($products, $collection->getStoreId()); - - $helper->attachGallerySetToCollection($products, $collection->getStoreId()); - - /* @var $product Mage_Catalog_Model_Product */ - foreach ($products as $product) { //only runs once - $helper->groupMediaGalleryImages($product); - Mage::helper('configurableswatches/productimg') - ->indexProductImages($product, $product->getListSwatchAttrValues()); - - $this->product = $product; - } - - $this->products = $products; - - return parent::_toHtml(); - } - - public function getCollection() - { -// Mage::register('products_collection',$products); - return $this->products; - } - - public function getProduct() - { - return $this->product; - } - - protected function _isCacheActive() - { - if (!Mage::getStoreConfig('catalog/frontend/cache_list')) { - return false; - } - - /* if there are any messages dont read from cache to show them */ - if (Mage::getSingleton('core/session')->getMessages(true)->count() > 0) { - return false; - } - return true; - - } - - public function getCacheLifetime() - { - if ($this->_isCacheActive()) { - return false; - } - } - - public function getCacheKey() - { - if (!$this->_isCacheActive()) { - parent::getCacheKey(); - } - Mage::log($this->getPid()); - $cacheKey = 'SwatchList_'. - /* Create different caches for different categories */ - $this->getPid().'_'. - /* ... stores */ - Mage::App()->getStore()->getCode().'_'. - ''; - - /* -foreach (Mage::app()->getRequest()->getParams() as $key=>$value) { - $cacheKey .= $key.'-'.$value.'_'; - } -*/ - return $cacheKey; - } - - - public function getCacheTags() - { - if (!$this->_isCacheActive()) { - return parent::getCacheTags(); - } - $cacheTags = array( - Mage_Catalog_Model_Product::CACHE_TAG, - Mage_Catalog_Model_Product::CACHE_TAG.'_'.$this->getPid() - ); - - return $cacheTags; - - } - -} \ No newline at end of file diff --git a/app/code/local/Wigman/AjaxSwatches/Model/Observer.php b/app/code/local/Wigman/AjaxSwatches/Model/Observer.php deleted file mode 100644 index c917d6d..0000000 --- a/app/code/local/Wigman/AjaxSwatches/Model/Observer.php +++ /dev/null @@ -1,42 +0,0 @@ -load($pid); - //get Product - - - $mediaImages= $_product->getMediaGalleryImages(); - - $images = array(); - $i=1; - foreach ($mediaImages as $_image){ - - if(!$_image['disabled_default']){ - - $newImage = array( - 'thumb' => (string) Mage::helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(75), - 'image' => (string) Mage::helper('catalog/image')->init($_product, 'image', $_image->getFile()) - ); - - - $images[$i] = $newImage; - $i++; - } else { - //echo 'image disabled'; - } - - } - - - $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true); - $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($images)); - return; - - - } - - public function getlistdataAction(){ - - if(!isset($_REQUEST['pids'])) { exit; } - - if (!Mage::helper('configurableswatches')->isEnabled()) { // check if functionality disabled - exit; // exit without loading swatch functionality - } - - $pids = explode(',',$_REQUEST['pids']); - - $response = $swatches = $jsons = array(); - $this->loadLayout(); - - - foreach($pids as $pid){ - $swatches[] = array('id' => $pid, 'value' => $this->getLayout() - ->createBlock('Wigman_AjaxSwatches/swatchlist','swatchlist-'.$pid) - ->setPid($pid) - ->setTemplate('configurableswatches/catalog/product/list/swatches.phtml') - ->toHtml()); - - $productsCollection = $this->getLayout()->getBlock('swatchlist-'.$pid)->getCollection(); - - Mage::log($productsCollection); - - $jsons[$pid] = $this->getLayout() - ->createBlock('Wigman_AjaxSwatches/catalog_media_js_list','mediajslist-'.$pid) - ->setPid($pid) - ->setProductCollection($productsCollection) - ->setTemplate('wigman/ajaxswatches/media/js.phtml') - ->toHtml(); - - } - - $response['swatches'] = $swatches; - - $response['jsons'] = $jsons; - - $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true); - $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response)); - return; - } -} diff --git a/app/code/local/Wigman/AjaxSwatches/etc/config.xml b/app/code/local/Wigman/AjaxSwatches/etc/config.xml deleted file mode 100644 index 08eff46..0000000 --- a/app/code/local/Wigman/AjaxSwatches/etc/config.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - 0.2.0 - - - - - - Wigman_AjaxSwatches_Block - - - - - Wigman_AjaxSwatches_Model - - - - Wigman_AjaxSwatches_Model_Observer - - - - - - - - standard - - Wigman_AjaxSwatches - ajaxswatches - - - - - - - wigman_ajaxswatches.xml - - - - - \ No newline at end of file diff --git a/app/design/frontend/rwd/default/layout/wigman_ajaxswatches.xml b/app/design/frontend/rwd/default/layout/wigman_ajaxswatches.xml deleted file mode 100644 index 6f1b6c3..0000000 --- a/app/design/frontend/rwd/default/layout/wigman_ajaxswatches.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - skin_jswigman/ajaxswatches/js/swatches-extend.js - - - - - - - - - - skin_jswigman/ajaxswatches/js/swatches-extend.js - - - - - - - diff --git a/app/design/frontend/rwd/default/template/wigman/ajaxswatches/baseurl.phtml b/app/design/frontend/rwd/default/template/wigman/ajaxswatches/baseurl.phtml deleted file mode 100644 index 6c3dfd0..0000000 --- a/app/design/frontend/rwd/default/template/wigman/ajaxswatches/baseurl.phtml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - diff --git a/app/design/frontend/rwd/default/template/wigman/ajaxswatches/media/js.phtml b/app/design/frontend/rwd/default/template/wigman/ajaxswatches/media/js.phtml deleted file mode 100644 index a972196..0000000 --- a/app/design/frontend/rwd/default/template/wigman/ajaxswatches/media/js.phtml +++ /dev/null @@ -1,32 +0,0 @@ - - -getProductImageFallbacks() as $imageFallback): ?> - - diff --git a/skin/frontend/base/.DS_Store b/skin/frontend/base/.DS_Store deleted file mode 100644 index 0f32880..0000000 Binary files a/skin/frontend/base/.DS_Store and /dev/null differ diff --git a/skin/frontend/base/default/.DS_Store b/skin/frontend/base/default/.DS_Store deleted file mode 100644 index ab8a28d..0000000 Binary files a/skin/frontend/base/default/.DS_Store and /dev/null differ diff --git a/skin/frontend/base/default/wigman/.DS_Store b/skin/frontend/base/default/wigman/.DS_Store deleted file mode 100644 index fbd3d8a..0000000 Binary files a/skin/frontend/base/default/wigman/.DS_Store and /dev/null differ diff --git a/skin/frontend/base/default/wigman/ajaxswatches/.DS_Store b/skin/frontend/base/default/wigman/ajaxswatches/.DS_Store deleted file mode 100644 index ba3b77f..0000000 Binary files a/skin/frontend/base/default/wigman/ajaxswatches/.DS_Store and /dev/null differ diff --git a/skin/frontend/rwd/default/wigman/ajaxswatches/js/swatches-extend.js b/skin/frontend/rwd/default/wigman/ajaxswatches/js/swatches-extend.js deleted file mode 100644 index f162f34..0000000 --- a/skin/frontend/rwd/default/wigman/ajaxswatches/js/swatches-extend.js +++ /dev/null @@ -1,124 +0,0 @@ -$j(document).ready(function() { - - (function(updateImage) { - ConfigurableMediaImages.updateImage = function (el) { - - updateImage.call(el); - - var select = $j(el); - var label = select.find('option:selected').attr('data-label'); - var productId = optionsPrice.productId; - - var pid = ConfigurableMediaImages.productImages[productId].option_labels[label].products[0]; - - $j.ajax({ - url: posturl + 'ajaxswatches/ajax/update', - dataType: 'json', - type : 'post', - data: 'pid='+pid, - success: function(data){ - - if(data){ - ConfigurableMediaImages.setMoreImages(data); - } else { - return true; - } - } - }); - - - }; - }(ConfigurableMediaImages.updateImage)); - -}); - -$j(document).on('product-media-loaded', function() { - - if(typeof(ConfigurableSwatchesList) != 'undefined'){ - - var items = $j('.products-grid li.item,.products-list li.item'); - var i = 0; - var activeSwatch = $j('.swatch-current .value img'); - - var pids = []; - - items.find('.product-image img').each(function(){ - - var target = $j(this); - pids.push(target.attr('id').split('-').pop()); - - }); - - $j.ajax({ - url: posturl + 'ajaxswatches/ajax/getlistdata', - dataType: 'json', - type : 'post', - data: 'pids='+pids.join(','), - success: function(data){ - if(data){ - - if(data.swatches){ - - $j(data.swatches).each(function(key, swatchObj){ - i++; - var parentLi = $j('#product-collection-image-'+swatchObj['id']).parent().parent(); - - $j(swatchObj['value']).insertAfter(parentLi.find('.product-name')); - - if(i == items.length){ - if(activeSwatch.length){ - - items.find(".configurable-swatch-list li[data-option-label='"+activeSwatch.attr('title') - .toLowerCase()+"']") - .addClass('filter-match'); - - } - ConfigurableMediaImages.ajaxInit(data.jsons); - } - }) - } - } else { - //return false; - } - } - }); - - } - -}); - -ConfigurableMediaImages.ajaxInit = function(jsons){ - - ConfigurableMediaImages.init('small_image'); - - for (var key in jsons) { - ConfigurableMediaImages.setImageFallback(key, $j.parseJSON(jsons[key])); - } - - $j(document).trigger('configurable-media-images-init', ConfigurableMediaImages); -} - - -ConfigurableMediaImages.setMoreImages = function(data){ - - var newImages = Array(); - var maxId = 0; - - var thumblist = $j('.product-image-thumbs'); - var gallery = $j('.product-image-gallery'); - - thumblist.find('li').each(function(){ //removing current thumbs and large images - $j('#image-'+$j(this).find('a').data('image-index')).remove(); - $j(this).remove(); - }); - - $j.each(data, function(key, value){ //adding new images - - maxId++; - - thumblist.append('
  • '); - gallery.append(''); - }); - ProductMediaManager.wireThumbnails(); - -} \ No newline at end of file