Safal_Catalogpreview - Version 1.0.1

Version Notes

Stable Release of Safal Catalog Preview.

Download this release

Release Info

Developer SafalWeb
Extension Safal_Catalogpreview
Version 1.0.1
Comparing to
See all releases


Version 1.0.1

Files changed (32) hide show
  1. app/code/community/Safal/Catalogpreview/Block/Adminhtml/Categories.php +255 -0
  2. app/code/community/Safal/Catalogpreview/Block/Adminhtml/System/Config/Form/Fieldset/Catalogpreview/Categories.php +40 -0
  3. app/code/community/Safal/Catalogpreview/Block/Catalogpreview.php +29 -0
  4. app/code/community/Safal/Catalogpreview/Helper/Data.php +65 -0
  5. app/code/community/Safal/Catalogpreview/Model/Adminhtml/System/Config/Source/Alignment.php +12 -0
  6. app/code/community/Safal/Catalogpreview/Model/Adminhtml/System/Config/Source/Imagescope.php +14 -0
  7. app/code/community/Safal/Catalogpreview/Model/Adminhtml/System/Config/Source/Position.php +11 -0
  8. app/code/community/Safal/Catalogpreview/controllers/Adminhtml/CatalogpreviewController.php +17 -0
  9. app/code/community/Safal/Catalogpreview/etc/adminhtml.xml +25 -0
  10. app/code/community/Safal/Catalogpreview/etc/config.xml +81 -0
  11. app/code/community/Safal/Catalogpreview/etc/system.xml +213 -0
  12. app/design/adminhtml/default/default/layout/catalogpreview.xml +20 -0
  13. app/design/frontend/default/default/layout/catalogpreview.xml +63 -0
  14. app/design/frontend/default/default/template/catalogpreview/catalog/product/list.phtml +128 -0
  15. app/design/frontend/default/default/template/catalogpreview/catalog/product/list/upsell.phtml +52 -0
  16. app/design/frontend/default/default/template/catalogpreview/checkout/cart/crosssell.phtml +59 -0
  17. app/design/frontend/default/default/template/catalogpreview/style.phtml +20 -0
  18. app/design/frontend/rwd/default/layout/catalogpreview.xml +63 -0
  19. app/design/frontend/rwd/default/template/catalogpreview/catalog/product/list.phtml +186 -0
  20. app/design/frontend/rwd/default/template/catalogpreview/catalog/product/list/upsell.phtml +59 -0
  21. app/design/frontend/rwd/default/template/catalogpreview/checkout/cart/crosssell.phtml +61 -0
  22. app/design/frontend/rwd/default/template/catalogpreview/style.phtml +20 -0
  23. app/etc/modules/Safal_Catalogpreview.xml +9 -0
  24. js/swcatalogpreview/preview.js +132 -0
  25. media/swcp/default/loader.gif +0 -0
  26. package.xml +35 -0
  27. skin/adminhtml/default/default/lib/prototype/windows/themes/safal.css +39 -0
  28. skin/adminhtml/default/default/lib/prototype/windows/themes/safal/btn_bg.gif +0 -0
  29. skin/adminhtml/default/default/lib/prototype/windows/themes/safal/content_bg.gif +0 -0
  30. skin/adminhtml/default/default/lib/prototype/windows/themes/safal/top_bg.gif +0 -0
  31. skin/adminhtml/default/default/lib/prototype/windows/themes/safal/window_close.png +0 -0
  32. skin/adminhtml/default/default/safalweb/all/images/ok.gif +0 -0
app/code/community/Safal/Catalogpreview/Block/Adminhtml/Categories.php ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Safal_Catalogpreview_Block_Adminhtml_Categories extends Mage_Adminhtml_Block_Catalog_Category_Tree
3
+ {
4
+ protected $_categoryIds;
5
+ protected $_selectedNodes = null;
6
+
7
+ /**
8
+ * Specify template to use
9
+ */
10
+ public function __construct()
11
+ {
12
+ parent::__construct();
13
+ $this->setTemplate('catalog/product/edit/categories.phtml');
14
+ }
15
+
16
+ /**
17
+ * Checks when this block is readonly
18
+ *
19
+ * @return boolean
20
+ */
21
+ public function isReadonly()
22
+ {
23
+ return false;
24
+ }
25
+
26
+ /**
27
+ * Return array with category IDs which the product is assigned to
28
+ *
29
+ * @return array
30
+ */
31
+ protected function getCategoryIds()
32
+ {
33
+ $ids = $this->getRequest()->getParam('category_ids');
34
+ if(count($ids)){
35
+ return array_unique(explode(',',$ids));
36
+ }
37
+ return array();
38
+ }
39
+
40
+ /**
41
+ * Forms string out of getCategoryIds()
42
+ *
43
+ * @return string
44
+ */
45
+ public function getIdsString()
46
+ {
47
+ return implode(',', $this->getCategoryIds());
48
+ }
49
+
50
+ /**
51
+ * Returns root node and sets 'checked' flag (if necessary)
52
+ *
53
+ * @return Varien_Data_Tree_Node
54
+ */
55
+ public function getRootNode()
56
+ {
57
+ $root = $this->getRoot();
58
+ if ($root && in_array($root->getId(), $this->getCategoryIds())) {
59
+ $root->setChecked(true);
60
+ }
61
+ return $root;
62
+ }
63
+
64
+ /**
65
+ * Returns root node
66
+ *
67
+ * @param Mage_Catalog_Model_Category|null $parentNodeCategory
68
+ * @param int $recursionLevel
69
+ * @return Varien_Data_Tree_Node
70
+ */
71
+ public function getRoot($parentNodeCategory = null, $recursionLevel = 3)
72
+ {
73
+ if (!is_null($parentNodeCategory) && $parentNodeCategory->getId()) {
74
+ return $this->getNode($parentNodeCategory, $recursionLevel);
75
+ }
76
+ $root = Mage::registry('root');
77
+ if (is_null($root)) {
78
+ $storeId = (int) $this->getRequest()->getParam('store');
79
+
80
+ if ($storeId) {
81
+ $store = Mage::app()->getStore($storeId);
82
+ $rootId = $store->getRootCategoryId();
83
+ }
84
+ else {
85
+ $rootId = Mage_Catalog_Model_Category::TREE_ROOT_ID;
86
+ }
87
+
88
+ $ids = $this->getSelectedCategoriesPathIds($rootId);
89
+ $tree = Mage::getResourceSingleton('catalog/category_tree')
90
+ ->loadByIds($ids, false, false);
91
+
92
+ if ($this->getCategory()) {
93
+ $tree->loadEnsuredNodes($this->getCategory(), $tree->getNodeById($rootId));
94
+ }
95
+
96
+ $tree->addCollectionData($this->getCategoryCollection());
97
+
98
+ $root = $tree->getNodeById($rootId);
99
+
100
+ if ($root && $rootId != Mage_Catalog_Model_Category::TREE_ROOT_ID) {
101
+ $root->setIsVisible(true);
102
+ if ($this->isReadonly()) {
103
+ $root->setDisabled(true);
104
+ }
105
+ }
106
+ elseif($root && $root->getId() == Mage_Catalog_Model_Category::TREE_ROOT_ID) {
107
+ $root->setName(Mage::helper('catalog')->__('Root'));
108
+ }
109
+
110
+ Mage::register('root', $root);
111
+ }
112
+
113
+ return $root;
114
+ }
115
+
116
+ /**
117
+ * Returns array with configuration of current node
118
+ *
119
+ * @param Varien_Data_Tree_Node $node
120
+ * @param int $level How deep is the node in the tree
121
+ * @return array
122
+ */
123
+ protected function _getNodeJson($node, $level = 1)
124
+ {
125
+ $item = parent::_getNodeJson($node, $level);
126
+
127
+ if ($this->_isParentSelectedCategory($node)) {
128
+ $item['expanded'] = true;
129
+ }
130
+
131
+ if (in_array($node->getId(), $this->getCategoryIds())) {
132
+ $item['checked'] = true;
133
+ }
134
+
135
+ if ($this->isReadonly()) {
136
+ $item['disabled'] = true;
137
+ }
138
+
139
+ return $item;
140
+ }
141
+
142
+ /**
143
+ * Returns whether $node is a parent (not exactly direct) of a selected node
144
+ *
145
+ * @param Varien_Data_Tree_Node $node
146
+ * @return bool
147
+ */
148
+ protected function _isParentSelectedCategory($node)
149
+ {
150
+ $result = false;
151
+ // Contains string with all category IDs of children (not exactly direct) of the node
152
+ $allChildren = $node->getAllChildren();
153
+ if ($allChildren) {
154
+ $selectedCategoryIds = $this->getCategoryIds();
155
+ $allChildrenArr = explode(',', $allChildren);
156
+ for ($i = 0, $cnt = count($selectedCategoryIds); $i < $cnt; $i++) {
157
+ $isSelf = $node->getId() == $selectedCategoryIds[$i];
158
+ if (!$isSelf && in_array($selectedCategoryIds[$i], $allChildrenArr)) {
159
+ $result = true;
160
+ break;
161
+ }
162
+ }
163
+ }
164
+
165
+ return $result;
166
+ }
167
+
168
+ /**
169
+ * Returns array with nodes those are selected (contain current product)
170
+ *
171
+ * @return array
172
+ */
173
+ protected function _getSelectedNodes()
174
+ {
175
+ if ($this->_selectedNodes === null) {
176
+ $this->_selectedNodes = array();
177
+ $root = $this->getRoot();
178
+ foreach ($this->getCategoryIds() as $categoryId) {
179
+ if ($root) {
180
+ $this->_selectedNodes[] = $root->getTree()->getNodeById($categoryId);
181
+ }
182
+ }
183
+ }
184
+
185
+ return $this->_selectedNodes;
186
+ }
187
+
188
+ /**
189
+ * Returns JSON-encoded array of category children
190
+ *
191
+ * @param int $categoryId
192
+ * @return string
193
+ */
194
+ public function getCategoryChildrenJson($categoryId)
195
+ {
196
+ $category = Mage::getModel('catalog/category')->load($categoryId);
197
+ $node = $this->getRoot($category, 1)->getTree()->getNodeById($categoryId);
198
+
199
+ if (!$node || !$node->hasChildren()) {
200
+ return '[]';
201
+ }
202
+
203
+ $children = array();
204
+ foreach ($node->getChildren() as $child) {
205
+ $children[] = $this->_getNodeJson($child);
206
+ }
207
+
208
+ return Mage::helper('core')->jsonEncode($children);
209
+ }
210
+
211
+ /**
212
+ * Returns URL for loading tree
213
+ *
214
+ * @param null $expanded
215
+ * @return string
216
+ */
217
+ public function getLoadTreeUrl($expanded = null)
218
+ {
219
+ return $this->getUrl('*/*/categoriesJson', array('_current' => true));
220
+ }
221
+
222
+ /**
223
+ * Return distinct path ids of selected categories
224
+ *
225
+ * @param mixed $rootId Root category Id for context
226
+ * @return array
227
+ */
228
+ public function getSelectedCategoriesPathIds($rootId = false)
229
+ {
230
+ $ids = array();
231
+ $categoryIds = $this->getCategoryIds();
232
+ if (empty($categoryIds)) {
233
+ return array();
234
+ }
235
+ $collection = Mage::getResourceModel('catalog/category_collection');
236
+
237
+ if ($rootId) {
238
+ $collection->addFieldToFilter('parent_id', $rootId);
239
+ } else {
240
+ $collection->addFieldToFilter('entity_id', array('in'=>$categoryIds));
241
+ }
242
+
243
+ foreach ($collection as $item) {
244
+ if ($rootId && !in_array($rootId, $item->getPathIds())) {
245
+ continue;
246
+ }
247
+ foreach ($item->getPathIds() as $id) {
248
+ if (!in_array($id, $ids)) {
249
+ $ids[] = $id;
250
+ }
251
+ }
252
+ }
253
+ return $ids;
254
+ }
255
+ }
app/code/community/Safal/Catalogpreview/Block/Adminhtml/System/Config/Form/Fieldset/Catalogpreview/Categories.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Safal_Catalogpreview_Block_Adminhtml_System_Config_Form_Fieldset_Catalogpreview_Categories extends Mage_Adminhtml_Block_System_Config_Form_Fieldset{
3
+ public function render(Varien_Data_Form_Element_Abstract $element)
4
+ {
5
+ $html = "";
6
+ $javaScript = "
7
+ <script type=\"text/javascript\">
8
+ var wn = null;
9
+ Event.observe('selectcategoriesbtn', 'click', function(event) {
10
+ var url = '".$this->getUrl('catalogpreview/adminhtml_catalogpreview/selectcategories',array('category_ids'=>$element->getValue(),"form_key"=>Mage::getSingleton('adminhtml/session')->getFormKey()))."';
11
+ wn = new Window('categoryWindow',{className:'magento',draggable:false,title:'Select Categories',minimizable:false,maximizable:false,destroyOnClose:true});
12
+ wn.setURL(url);
13
+ wn.setSize('500px','450px');
14
+ wn.showCenter();
15
+ wn.show();
16
+ wn.setCloseCallback(function(){
17
+ try{
18
+ var iframe= $('categoryWindow_content');
19
+ var idoc= iframe.contentDocument || iframe.contentWindow.document;
20
+ var iwin= iframe.contentWindow || iframe.contentDocument.defaultView;
21
+ iwin.Element.extend(idoc); // use the copy of Prototype in the iframe's window
22
+ $('".$element->getId()."').value = idoc.getElementById('product_categories').value;
23
+ return true;
24
+ }
25
+ catch(e){
26
+ alert(e);
27
+ return false;
28
+ }
29
+ });
30
+ Event.stop(event);
31
+ });
32
+ </script>";
33
+ $html .= '</script>';
34
+ $html .= "<label style='float: left; width: 210px;'>Select category</label><div class='form-list'><button id='selectcategoriesbtn' type='button'><span><span>Select Categories</span></span></button><p class='note' style='float: left; width: 100%; margin-left: 210px;'><span>Select categories to display popup on specific categories.</span></p><div>";
35
+ $html .= "<input type='hidden' name='".$element->getName()."' id='".$element->getId()."' value='".$element->getValue()."'/>";
36
+ $html .= "<style type='text/css'>.dialog {background: none repeat scroll 0 0 #FFFFFF;padding-bottom: 25px;border: 1px solid #555555;position: absolute;z-index: 10000 !important;}.magento_title {font: bold 12px/24px Arial,Helvetica,sans-serif;}.magento_nw {height: 8px;}.magento_n {height: 8px;}.magento_ne {height: 8px;}.table_window{width:100%;}</style>";
37
+ $html .= $javaScript;
38
+ return $html;
39
+ }
40
+ }
app/code/community/Safal/Catalogpreview/Block/Catalogpreview.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Safal_Catalogpreview_Block_Catalogpreview extends Mage_Core_Block_Template
3
+ {
4
+ public function canShowPreview()
5
+ {
6
+ if($this->getRequest()->getControllerName() == "category" && $this->getRequest()->getModuleName() == "catalog"){
7
+ $currentcategory = Mage::registry('current_category');
8
+ $categories = array_filter(array_unique(explode(",",$this->helper('catalogpreview')->getConfig('catalogpreview/general/selectcategory'))));
9
+ if(count($categories) == 1 && in_array(2,$categories)){
10
+ return true;
11
+ }
12
+ if(count($categories)){
13
+ if(in_array($currentcategory->getId(),$categories)){
14
+ return true;
15
+ }
16
+ }
17
+ else{
18
+ return true;
19
+ }
20
+ if(in_array($currentcategory->getId(),$categories)) return true;
21
+
22
+ return false;
23
+ }
24
+ else{
25
+ return true;
26
+ }
27
+ }
28
+ }
29
+ ?>
app/code/community/Safal/Catalogpreview/Helper/Data.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Safal_Catalogpreview_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ public function getConfig($path)
5
+ {
6
+ $store = Mage::app()->getStore()->getId();
7
+ if($path){
8
+ return Mage::getStoreConfig($path,$store);
9
+ }
10
+ return Mage::getStoreConfig("catalogpreview/",$store);
11
+ }
12
+ public function isEnable()
13
+ {
14
+ return $this->getConfig("catalogpreview/general/enabled");
15
+ }
16
+ public function getStyle()
17
+ {
18
+ $configs = $this->getConfig("catalogpreview/style");
19
+ $align = "";
20
+ if($configs['titlealign'] == 0)
21
+ $align = "left";
22
+
23
+ elseif($configs['titlealign'] == 1)
24
+ $align = "center";
25
+
26
+ else
27
+ $align = "right";
28
+
29
+ $css = "div#preview {
30
+ background-color: ".$configs['backgroundcolor'].";
31
+ border: ".$configs['borderwidth']."px solid ".$configs['bordercolor'].";
32
+ color: ".$configs['titlecolor'].";
33
+ display: none;
34
+ font-size: ".$configs['titlefontsize']."px;
35
+ font-weight: ".($configs['titlebold']? "bold" : "normal").";
36
+ padding: ".$configs['previewpadding']."px;
37
+ position: absolute;
38
+ text-align: ".$align.";
39
+ width: ".$configs['previewwidth']."px;
40
+ z-index: ".$configs['previewzindex'].";
41
+ }";
42
+ return $css;
43
+ }
44
+ public function getProductRel(Mage_Catalog_Model_Product $_product)
45
+ {
46
+ if(!$_product->getImage()){
47
+ $_product = Mage::getModel('catalog/product')->load($_product->getId());
48
+ }
49
+ if($_product && Mage::helper('catalogpreview')->isEnable()){
50
+ try{
51
+ $configs = $this->getConfig("catalogpreview/style");
52
+ return Mage::helper('catalog/image')->init($_product, $this->getConfig("catalogpreview/general/imagescope"))->resize($configs['previewwidth']);
53
+ }
54
+ catch(Exception $e){
55
+ Mage::log($e->getMessage());
56
+ return;
57
+ }
58
+ }
59
+ }
60
+ public function getConfigJson()
61
+ {
62
+ $configs = $this->getConfig("catalogpreview/style");
63
+ return json_encode(array("show"=>$configs['title'],"position"=>$configs['titleposition']));
64
+ }
65
+ }
app/code/community/Safal/Catalogpreview/Model/Adminhtml/System/Config/Source/Alignment.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Safal_Catalogpreview_Model_Adminhtml_System_Config_Source_Alignment
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value' => 0, 'label'=>Mage::helper('adminhtml')->__('Left')),
8
+ array('value' => 1, 'label'=>Mage::helper('adminhtml')->__('Center')),
9
+ array('value' => 2, 'label'=>Mage::helper('adminhtml')->__('Right')),
10
+ );
11
+ }
12
+ }
app/code/community/Safal/Catalogpreview/Model/Adminhtml/System/Config/Source/Imagescope.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Safal_Catalogpreview_Model_Adminhtml_System_Config_Source_Imagescope
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')
7
+ ->setFrontendInputTypeFilter('media_image');
8
+ $attrs = array();
9
+ foreach($attributeInfo->getData() as $attr){
10
+ $attrs[] = array('value' => $attr['attribute_code'], 'label'=>$attr['frontend_label']);
11
+ }
12
+ return $attrs;
13
+ }
14
+ }
app/code/community/Safal/Catalogpreview/Model/Adminhtml/System/Config/Source/Position.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Safal_Catalogpreview_Model_Adminhtml_System_Config_Source_Position
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value' => 1, 'label'=>Mage::helper('adminhtml')->__('Top')),
8
+ array('value' => 0, 'label'=>Mage::helper('adminhtml')->__('Bottom')),
9
+ );
10
+ }
11
+ }
app/code/community/Safal/Catalogpreview/controllers/Adminhtml/CatalogpreviewController.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Safal_Catalogpreview_Adminhtml_CatalogpreviewController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function selectcategoriesAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
8
+ $this->renderLayout();
9
+ }
10
+ public function categoriesJsonAction()
11
+ {
12
+ $this->getResponse()->setBody(
13
+ $this->getLayout()->createBlock('catalogpreview/adminhtml_categories')
14
+ ->getCategoryChildrenJson($this->getRequest()->getParam('category'))
15
+ );
16
+ }
17
+ }
app/code/community/Safal/Catalogpreview/etc/adminhtml.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <safal>
15
+ <title>Safal Web</title>
16
+ </safal>
17
+ </children>
18
+ </config>
19
+ </children>
20
+ </system>
21
+ </children>
22
+ </admin>
23
+ </resources>
24
+ </acl>
25
+ </config>
app/code/community/Safal/Catalogpreview/etc/config.xml ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Safal_Catalogpreview>
5
+ <version>1.0.1</version>
6
+ </Safal_Catalogpreview>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <catalogpreview>
11
+ <class>Safal_Catalogpreview_Helper</class>
12
+ </catalogpreview>
13
+ </helpers>
14
+ <blocks>
15
+ <catalogpreview>
16
+ <class>Safal_Catalogpreview_Block</class>
17
+ </catalogpreview>
18
+ </blocks>
19
+ <models>
20
+ <catalogpreview>
21
+ <class>Safal_Catalogpreview_Model</class>
22
+ </catalogpreview>
23
+ </models>
24
+ </global>
25
+ <frontend>
26
+ <layout>
27
+ <updates>
28
+ <catalogpreview>
29
+ <file>catalogpreview.xml</file>
30
+ </catalogpreview>
31
+ </updates>
32
+ </layout>
33
+ </frontend>
34
+ <admin>
35
+ <routers>
36
+ <catalogpreview>
37
+ <use>admin</use>
38
+ <args>
39
+ <module>Safal_Catalogpreview</module>
40
+ <frontName>catalogpreview</frontName>
41
+ </args>
42
+ </catalogpreview>
43
+ </routers>
44
+ </admin>
45
+ <adminhtml>
46
+ <layout>
47
+ <updates>
48
+ <catalogpreview>
49
+ <file>catalogpreview.xml</file>
50
+ </catalogpreview>
51
+ </updates>
52
+ </layout>
53
+ </adminhtml>
54
+ <default>
55
+ <catalogpreview>
56
+ <general>
57
+ <enabled>0</enabled>
58
+ <selectcategory>3</selectcategory>
59
+ <enableforupsell>0</enableforupsell>
60
+ <enableforcrosssell>0</enableforcrosssell>
61
+ <includejquery>0</includejquery>
62
+ <imagescope>small_image</imagescope>
63
+ </general>
64
+ <style>
65
+ <backgroundcolor>#FFFFFF</backgroundcolor>
66
+ <borderwidth>1</borderwidth>
67
+ <bordercolor>#000000</bordercolor>
68
+ <title>1</title>
69
+ <titlefontsize>12</titlefontsize>
70
+ <titlebold>0</titlebold>
71
+ <titlecolor>#000000</titlecolor>
72
+ <titleposition>0</titleposition>
73
+ <titlealign>center</titlealign>
74
+ <previewpadding>10</previewpadding>
75
+ <previewwidth>500</previewwidth>
76
+ <previewzindex>10</previewzindex>
77
+ <animation>/default/loader.gif</animation>
78
+ </style>
79
+ </catalogpreview>
80
+ </default>
81
+ </config>
app/code/community/Safal/Catalogpreview/etc/system.xml ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <safal translate="label" module="catalogpreview">
5
+ <label>Safal Web</label>
6
+ <sort_order>200</sort_order>
7
+ </safal>
8
+ </tabs>
9
+ <sections>
10
+ <catalogpreview>
11
+ <label>Catalog Preview</label>
12
+ <tab>safal</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>10</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <general translate="label">
20
+ <label>Preview Configuration</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>599</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <enabled>
28
+ <label>Enable Catalog Preview for product listing</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>610</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <comment>Display product preview on product list page.</comment>
36
+ </enabled>
37
+ <selectcategory>
38
+ <label>Select Category</label>
39
+ <frontend_type>text</frontend_type>
40
+ <frontend_model>catalogpreview/adminhtml_system_config_form_fieldset_catalogpreview_categories</frontend_model>
41
+ <sort_order>610</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ <comment>Display product preview on product list page.</comment>
46
+ </selectcategory>
47
+ <enableforupsell>
48
+ <label>Enable Catalog Preview for Upsell Product</label>
49
+ <frontend_type>select</frontend_type>
50
+ <source_model>adminhtml/system_config_source_yesno</source_model>
51
+ <sort_order>610</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ <comment>Display product preview on Upsell product list section on product detail page.</comment>
56
+ </enableforupsell>
57
+ <enableforcrosssell>
58
+ <label>Enable Catalog Preview for Crosssell Product</label>
59
+ <frontend_type>select</frontend_type>
60
+ <source_model>adminhtml/system_config_source_yesno</source_model>
61
+ <sort_order>611</sort_order>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>1</show_in_website>
64
+ <show_in_store>1</show_in_store>
65
+ <comment>Display product preview on Crosssell product list section on product detail page.</comment>
66
+ </enableforcrosssell>
67
+ <imagescope>
68
+ <label>Image Type to display</label>
69
+ <frontend_type>select</frontend_type>
70
+ <source_model>catalogpreview/adminhtml_system_config_source_imagescope</source_model>
71
+ <sort_order>612</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ <comment>Choose image type to display in popup.</comment>
76
+ </imagescope>
77
+ </fields>
78
+ </general>
79
+ <style>
80
+ <label>Preview Style</label>
81
+ <frontend_type>text</frontend_type>
82
+ <sort_order>600</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ <fields>
87
+ <backgroundcolor>
88
+ <label>Preview Image Background Color</label>
89
+ <frontend_type>text</frontend_type>
90
+ <sort_order>10</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ <comment>Use append [#] to colorcode or use color name.</comment>
95
+ </backgroundcolor>
96
+ <borderwidth>
97
+ <label>Preview Image Border Width</label>
98
+ <frontend_type>text</frontend_type>
99
+ <sort_order>20</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ <comment>Integer value in px. Do not prepend [px].</comment>
104
+ </borderwidth>
105
+ <bordercolor>
106
+ <label>Preview Image Border Color</label>
107
+ <frontend_type>text</frontend_type>
108
+ <sort_order>30</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>1</show_in_store>
112
+ <comment>Use append [#] to colorcode or use color name.</comment>
113
+ </bordercolor>
114
+ <title>
115
+ <label>Show Title [Product Title]</label>
116
+ <frontend_type>select</frontend_type>
117
+ <source_model>adminhtml/system_config_source_yesno</source_model>
118
+ <sort_order>40</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>1</show_in_store>
122
+ <comment>Show product name as product title.</comment>
123
+ </title>
124
+ <titlefontsize>
125
+ <label>Preview Image Title Size</label>
126
+ <frontend_type>text</frontend_type>
127
+ <sort_order>50</sort_order>
128
+ <show_in_default>1</show_in_default>
129
+ <show_in_website>1</show_in_website>
130
+ <show_in_store>1</show_in_store>
131
+ <comment>Integer value in px. Do not prepend [px].</comment>
132
+ </titlefontsize>
133
+ <titlebold>
134
+ <label>Bold Preview Image Title</label>
135
+ <frontend_type>select</frontend_type>
136
+ <source_model>adminhtml/system_config_source_yesno</source_model>
137
+ <sort_order>55</sort_order>
138
+ <show_in_default>1</show_in_default>
139
+ <show_in_website>1</show_in_website>
140
+ <show_in_store>1</show_in_store>
141
+ </titlebold>
142
+ <titlecolor>
143
+ <label>Preview Image Title Color</label>
144
+ <frontend_type>text</frontend_type>
145
+ <sort_order>60</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>1</show_in_website>
148
+ <show_in_store>1</show_in_store>
149
+ <comment>Use append [#] to colorcode or use color name.</comment>
150
+ </titlecolor>
151
+ <titleposition>
152
+ <label>Preview Image Title Position</label>
153
+ <frontend_type>select</frontend_type>
154
+ <source_model>catalogpreview/adminhtml_system_config_source_position</source_model>
155
+ <sort_order>70</sort_order>
156
+ <show_in_default>1</show_in_default>
157
+ <show_in_website>1</show_in_website>
158
+ <show_in_store>1</show_in_store>
159
+ </titleposition>
160
+ <titlealign>
161
+ <label>Preview Image Title Alignment</label>
162
+ <frontend_type>select</frontend_type>
163
+ <source_model>catalogpreview/adminhtml_system_config_source_alignment</source_model>
164
+ <sort_order>70</sort_order>
165
+ <show_in_default>1</show_in_default>
166
+ <show_in_website>1</show_in_website>
167
+ <show_in_store>1</show_in_store>
168
+ </titlealign>
169
+ <previewpadding>
170
+ <label>Preview Image Padding</label>
171
+ <frontend_type>text</frontend_type>
172
+ <sort_order>80</sort_order>
173
+ <show_in_default>1</show_in_default>
174
+ <show_in_website>1</show_in_website>
175
+ <show_in_store>1</show_in_store>
176
+ <comment>Integer value in px. Do not prepend [px].</comment>
177
+ </previewpadding>
178
+ <previewwidth>
179
+ <label>Preview Image Width</label>
180
+ <frontend_type>text</frontend_type>
181
+ <sort_order>90</sort_order>
182
+ <show_in_default>1</show_in_default>
183
+ <show_in_website>1</show_in_website>
184
+ <show_in_store>1</show_in_store>
185
+ <comment>Integer value in px. Do not prepend [px].</comment>
186
+ </previewwidth>
187
+ <previewzindex>
188
+ <label>Preview Image Z-Index</label>
189
+ <frontend_type>text</frontend_type>
190
+ <sort_order>100</sort_order>
191
+ <show_in_default>1</show_in_default>
192
+ <show_in_website>1</show_in_website>
193
+ <show_in_store>1</show_in_store>
194
+ <comment>Integer value in px. Do not prepend [px].</comment>
195
+ </previewzindex>
196
+ <animation>
197
+ <label>Loading Animation</label>
198
+ <frontend_type>image</frontend_type>
199
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
200
+ <upload_dir config="system/filesystem/media" scope_info="1">swcp</upload_dir>
201
+ <base_url type="media" scope_info="1">swcp</base_url>
202
+ <sort_order>110</sort_order>
203
+ <show_in_default>1</show_in_default>
204
+ <show_in_website>1</show_in_website>
205
+ <show_in_store>1</show_in_store>
206
+ <comment>Allowed file types: jpeg, gif, png.</comment>
207
+ </animation>
208
+ </fields>
209
+ </style>
210
+ </groups>
211
+ </catalogpreview>
212
+ </sections>
213
+ </config>
app/design/adminhtml/default/default/layout/catalogpreview.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="1.0.1">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss">
6
+ <stylesheet>lib/prototype/windows/themes/safal.css</stylesheet>
7
+ </action>
8
+ </reference>
9
+ </default>
10
+ <catalogpreview_adminhtml_catalogpreview_selectcategories>
11
+ <reference name="root">
12
+ <action method="setTemplate">
13
+ <template>empty.phtml</template>
14
+ </action>
15
+ </reference>
16
+ <reference name="content">
17
+ <block type="catalogpreview/adminhtml_categories" name="select.category.preview"/>
18
+ </reference>
19
+ </catalogpreview_adminhtml_catalogpreview_selectcategories>
20
+ </layout>
app/design/frontend/default/default/layout/catalogpreview.xml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <catalog_category_default>
4
+ <reference name="head">
5
+ <action method="addJs" ifconfig="catalogpreview/general/enabled">
6
+ <script>swcatalogpreview/preview.js</script>
7
+ </action>
8
+ </reference>
9
+ <reference name="after_body_start">
10
+ <block type="catalogpreview/catalogpreview" name="previewstyle" template="catalogpreview/style.phtml"/>
11
+ </reference>
12
+ <reference name="product_list">
13
+ <action method="setTemplate" ifconfig="catalogpreview/general/enabled">
14
+ <template>catalogpreview/catalog/product/list.phtml</template>
15
+ </action>
16
+ </reference>
17
+ </catalog_category_default>
18
+ <catalog_category_layered>
19
+ <reference name="head">
20
+ <action method="addJs">
21
+ <script>swcatalogpreview/preview.js</script>
22
+ </action>
23
+ </reference>
24
+ <reference name="after_body_start">
25
+ <block type="catalogpreview/catalogpreview" name="previewstyle" template="catalogpreview/style.phtml"/>
26
+ </reference>
27
+ <reference name="product_list">
28
+ <action method="setTemplate" ifconfig="catalogpreview/general/enabled">
29
+ <template>catalogpreview/catalog/product/list.phtml</template>
30
+ </action>
31
+ </reference>
32
+ </catalog_category_layered>
33
+ <catalog_product_view>
34
+ <reference name="head">
35
+ <action method="addJs" ifconfig="catalogpreview/general/enableforupsell">
36
+ <script>swcatalogpreview/preview.js</script>
37
+ </action>
38
+ </reference>
39
+ <reference name="after_body_start">
40
+ <block type="catalogpreview/catalogpreview" name="previewstyle" template="catalogpreview/style.phtml"/>
41
+ </reference>
42
+ <reference name="product.info.upsell">
43
+ <action method="setTemplate" ifconfig="catalogpreview/general/enableforupsell">
44
+ <template>catalogpreview/catalog/product/list/upsell.phtml</template>
45
+ </action>
46
+ </reference>
47
+ </catalog_product_view>
48
+ <checkout_cart_index>
49
+ <reference name="head">
50
+ <action method="addJs" ifconfig="catalogpreview/general/enableforcrosssell">
51
+ <script>swcatalogpreview/preview.js</script>
52
+ </action>
53
+ </reference>
54
+ <reference name="after_body_start">
55
+ <block type="catalogpreview/catalogpreview" name="previewstyle" template="catalogpreview/style.phtml"/>
56
+ </reference>
57
+ <reference name="checkout.cart.crosssell">
58
+ <action method="setTemplate" ifconfig="catalogpreview/general/enableforcrosssell">
59
+ <template>catalogpreview/checkout/cart/crosssell.phtml</template>
60
+ </action>
61
+ </reference>
62
+ </checkout_cart_index>
63
+ </layout>
app/design/frontend/default/default/template/catalogpreview/catalog/product/list.phtml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ ?>
34
+ <?php
35
+ $_productCollection=$this->getLoadedProductCollection();
36
+ $_helper = $this->helper('catalog/output');
37
+ ?>
38
+ <?php if(!$_productCollection->count()): ?>
39
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
40
+ <?php else: ?>
41
+ <div class="category-products">
42
+ <?php echo $this->getToolbarHtml() ?>
43
+ <?php // List mode ?>
44
+ <?php if($this->getMode()!='grid'): ?>
45
+ <?php $_iterator = 0; ?>
46
+ <ol class="products-list" id="products-list">
47
+ <?php foreach ($_productCollection as $_product): ?>
48
+ <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
49
+ <?php // Product Image ?>
50
+ <a href="<?php echo $_product->getProductUrl() ?>" rel="<?php echo Mage::helper('catalogpreview')->getProductRel($_product)?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image preview"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
51
+ <?php // Product description ?>
52
+ <div class="product-shop">
53
+ <div class="f-fix">
54
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
55
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
56
+ <?php if($_product->getRatingSummary()): ?>
57
+ <?php echo $this->getReviewsSummaryHtml($_product) ?>
58
+ <?php endif; ?>
59
+ <?php echo $this->getPriceHtml($_product, true) ?>
60
+ <?php if($_product->isSaleable()): ?>
61
+ <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
62
+ <?php else: ?>
63
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
64
+ <?php endif; ?>
65
+ <div class="desc std">
66
+ <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
67
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
68
+ </div>
69
+ <ul class="add-to-links">
70
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
71
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
72
+ <?php endif; ?>
73
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
74
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
75
+ <?php endif; ?>
76
+ </ul>
77
+ </div>
78
+ </div>
79
+ </li>
80
+ <?php endforeach; ?>
81
+ </ol>
82
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
83
+
84
+ <?php else: ?>
85
+
86
+ <?php // Grid Mode ?>
87
+
88
+ <?php $_collectionSize = $_productCollection->count() ?>
89
+ <?php $_columnCount = $this->getColumnCount(); ?>
90
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
91
+ <?php if ($i++%$_columnCount==0): ?>
92
+ <ul class="products-grid">
93
+ <?php endif ?>
94
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
95
+ <a href="<?php echo $_product->getProductUrl() ?>" rel="<?php echo Mage::helper('catalogpreview')->getProductRel($_product)?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image preview"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
96
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
97
+ <?php if($_product->getRatingSummary()): ?>
98
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
99
+ <?php endif; ?>
100
+ <?php echo $this->getPriceHtml($_product, true) ?>
101
+ <div class="actions">
102
+ <?php if($_product->isSaleable()): ?>
103
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
104
+ <?php else: ?>
105
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
106
+ <?php endif; ?>
107
+ <ul class="add-to-links">
108
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
109
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
110
+ <?php endif; ?>
111
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
112
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
113
+ <?php endif; ?>
114
+ </ul>
115
+ </div>
116
+ </li>
117
+ <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
118
+ </ul>
119
+ <?php endif ?>
120
+ <?php endforeach ?>
121
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
122
+ <?php endif; ?>
123
+
124
+ <div class="toolbar-bottom">
125
+ <?php echo $this->getToolbarHtml() ?>
126
+ </div>
127
+ </div>
128
+ <?php endif; ?>
app/design/frontend/default/default/template/catalogpreview/catalog/product/list/upsell.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if(count($this->getItemCollection()->getItems())): ?>
28
+ <div class="box-collateral box-up-sell">
29
+ <h2><?php echo $this->__('You may also be interested in the following product(s)') ?></h2>
30
+ <table class="products-grid" id="upsell-product-table">
31
+ <?php // $this->setColumnCount(5); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
32
+ <?php $this->resetItemsIterator() ?>
33
+ <?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
34
+ <tr>
35
+ <?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
36
+ <?php if($_link=$this->getIterableItem()): ?>
37
+ <td>
38
+ <a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_link->getName()) ?>" class="product-image preview" rel="<?php echo Mage::helper('catalogpreview')->getProductRel($_link)?>"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a>
39
+ <h3 class="product-name"><a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_link->getName()) ?>"><?php echo $this->htmlEscape($_link->getName()) ?></a></h3>
40
+ <?php echo $this->getPriceHtml($_link, true, '-upsell') ?>
41
+ <?php echo $this->getReviewsSummaryHtml($_link) ?>
42
+ </td>
43
+ <?php else: ?>
44
+ <td class="empty">&nbsp;</td>
45
+ <?php endif; ?>
46
+ <?php endfor; ?>
47
+ </tr>
48
+ <?php endfor; ?>
49
+ </table>
50
+ <script type="text/javascript">decorateTable('upsell-product-table')</script>
51
+ </div>
52
+ <?php endif ?>
app/design/frontend/default/default/template/catalogpreview/checkout/cart/crosssell.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Cart cross sell items template
30
+ *
31
+ * @see Mage_Checkout_Block_Cart_Crosssell
32
+ */
33
+ ?>
34
+ <?php if($this->getItemCount()): ?>
35
+ <div class="crosssell">
36
+ <h2><?php echo $this->__('Based on your selection, you may be interested in the following items:') ?></h2>
37
+ <ul id="crosssell-products-list">
38
+ <?php foreach ($this->getItems() as $_item): ?>
39
+ <li class="item">
40
+ <a class="product-image preview" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" rel="<?php echo Mage::helper('catalogpreview')->getProductRel($_item)?>"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(75); ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
41
+ <div class="product-details">
42
+ <h3 class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></h3>
43
+ <?php echo $this->getPriceHtml($_item, true) ?>
44
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
45
+ <ul class="add-to-links">
46
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
47
+ <li><a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
48
+ <?php endif; ?>
49
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_item)): ?>
50
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
51
+ <?php endif; ?>
52
+ </ul>
53
+ </div>
54
+ </li>
55
+ <?php endforeach; ?>
56
+ </ul>
57
+ <script type="text/javascript">decorateList('crosssell-products-list', 'none-recursive')</script>
58
+ </div>
59
+ <?php endif; ?>
app/design/frontend/default/default/template/catalogpreview/style.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($this->canShowPreview()):?>
2
+ <style type="text/css">
3
+ <?php
4
+ echo Mage::helper('catalogpreview')->getStyle();
5
+ ?>
6
+
7
+ .loaderclass{
8
+ background: url("<?php echo Mage::getBaseUrl('media')."swcp/".Mage::helper('catalogpreview')->getConfig('catalogpreview/style/animation')?>") no-repeat scroll 50% 50% #FFFFFF;
9
+ height: 97%;
10
+ position: absolute;
11
+ width: 97%;
12
+ }
13
+ div#preview img{width: 100%;}
14
+ </style>
15
+ <script type="text/javascript">
16
+ document.observe('dom:loaded', function() {
17
+ var pp = new SafalCatalogPreview("a.preview",'<?php echo Mage::helper('catalogpreview')->getConfigJson()?>');
18
+ });
19
+ </script>
20
+ <?php endif;?>
app/design/frontend/rwd/default/layout/catalogpreview.xml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+ <catalog_category_default>
4
+ <reference name="head">
5
+ <action method="addJs" ifconfig="catalogpreview/general/enabled">
6
+ <script>swcatalogpreview/preview.js</script>
7
+ </action>
8
+ </reference>
9
+ <reference name="after_body_start">
10
+ <block type="catalogpreview/catalogpreview" name="previewstyle" template="catalogpreview/style.phtml"/>
11
+ </reference>
12
+ <reference name="product_list">
13
+ <action method="setTemplate" ifconfig="catalogpreview/general/enabled">
14
+ <template>catalogpreview/catalog/product/list.phtml</template>
15
+ </action>
16
+ </reference>
17
+ </catalog_category_default>
18
+ <catalog_category_layered>
19
+ <reference name="head">
20
+ <action method="addJs">
21
+ <script>swcatalogpreview/preview.js</script>
22
+ </action>
23
+ </reference>
24
+ <reference name="after_body_start">
25
+ <block type="catalogpreview/catalogpreview" name="previewstyle" template="catalogpreview/style.phtml"/>
26
+ </reference>
27
+ <reference name="product_list">
28
+ <action method="setTemplate" ifconfig="catalogpreview/general/enabled">
29
+ <template>catalogpreview/catalog/product/list.phtml</template>
30
+ </action>
31
+ </reference>
32
+ </catalog_category_layered>
33
+ <catalog_product_view>
34
+ <reference name="head">
35
+ <action method="addJs" ifconfig="catalogpreview/general/enableforupsell">
36
+ <script>swcatalogpreview/preview.js</script>
37
+ </action>
38
+ </reference>
39
+ <reference name="after_body_start">
40
+ <block type="catalogpreview/catalogpreview" name="previewstyle" template="catalogpreview/style.phtml"/>
41
+ </reference>
42
+ <reference name="product.info.upsell">
43
+ <action method="setTemplate" ifconfig="catalogpreview/general/enableforupsell">
44
+ <template>catalogpreview/catalog/product/list/upsell.phtml</template>
45
+ </action>
46
+ </reference>
47
+ </catalog_product_view>
48
+ <checkout_cart_index>
49
+ <reference name="head">
50
+ <action method="addJs" ifconfig="catalogpreview/general/enableforcrosssell">
51
+ <script>swcatalogpreview/preview.js</script>
52
+ </action>
53
+ </reference>
54
+ <reference name="after_body_start">
55
+ <block type="catalogpreview/catalogpreview" name="previewstyle" template="catalogpreview/style.phtml"/>
56
+ </reference>
57
+ <reference name="checkout.cart.crosssell">
58
+ <action method="setTemplate" ifconfig="catalogpreview/general/enableforcrosssell">
59
+ <template>catalogpreview/checkout/cart/crosssell.phtml</template>
60
+ </action>
61
+ </reference>
62
+ </checkout_cart_index>
63
+ </layout>
app/design/frontend/rwd/default/template/catalogpreview/catalog/product/list.phtml ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Product list template
30
+ *
31
+ * @see Mage_Catalog_Block_Product_List
32
+ */
33
+ /* @var $this Mage_Catalog_Block_Product_List */
34
+ ?>
35
+ <?php
36
+ $_productCollection=$this->getLoadedProductCollection();
37
+ $_helper = $this->helper('catalog/output');
38
+ ?>
39
+ <?php if(!$_productCollection->count()): ?>
40
+ <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
41
+ <?php else: ?>
42
+ <div class="category-products">
43
+ <?php echo $this->getToolbarHtml() ?>
44
+ <?php // List mode ?>
45
+ <?php if($this->getMode()!='grid'): ?>
46
+ <?php $_iterator = 0; ?>
47
+ <ol class="products-list" id="products-list">
48
+ <?php foreach ($_productCollection as $_product): ?>
49
+ <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
50
+ <?php // Product Image ?>
51
+ <a href="<?php echo $_product->getProductUrl() ?>" rel="<?php echo Mage::helper('catalogpreview')->getProductRel($_product)?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image preview">
52
+ <?php /* Based on the native RWD styling, product images are displayed at a max of ~400px wide when viewed on a
53
+ one column page layout with four product columns from a 1280px viewport. For bandwidth reasons,
54
+ we are going to serve a 300px image, as it will look fine at 400px and most of the times, the image
55
+ will be displayed at a smaller size (eg, if two column are being used or viewport is smaller than 1280px).
56
+ This $_imgSize value could even be decreased further, based on the page layout
57
+ (one column, two column, three column) and number of product columns. */ ?>
58
+ <?php $_imgSize = 300; ?>
59
+ <img id="product-collection-image-<?php echo $_product->getId(); ?>"
60
+ src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize); ?>"
61
+ alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
62
+ </a>
63
+ <?php // Product description ?>
64
+ <div class="product-shop">
65
+ <div class="f-fix">
66
+ <div class="product-primary">
67
+ <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
68
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
69
+ <?php if($_product->getRatingSummary()): ?>
70
+ <?php echo $this->getReviewsSummaryHtml($_product) ?>
71
+ <?php endif; ?>
72
+
73
+ <?php
74
+ $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
75
+ foreach($_nameAfterChildren as $_nameAfterChildName):
76
+ $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
77
+ $_nameAfterChild->setProduct($_product);
78
+ ?>
79
+ <?php echo $_nameAfterChild->toHtml(); ?>
80
+ <?php endforeach; ?>
81
+ </div>
82
+ <div class="product-secondary">
83
+ <?php echo $this->getPriceHtml($_product, true) ?>
84
+ </div>
85
+ <div class="product-secondary">
86
+ <?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
87
+ <p class="action"><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
88
+ <?php elseif($_product->isSaleable()): ?>
89
+ <p class="action"><a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a></p>
90
+ <?php else: ?>
91
+ <p class="action availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
92
+ <?php endif; ?>
93
+ <ul class="add-to-links">
94
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
95
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
96
+ <?php endif; ?>
97
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
98
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
99
+ <?php endif; ?>
100
+ </ul>
101
+ </div>
102
+ <div class="desc std">
103
+ <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
104
+ <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
105
+ </div>
106
+ </div>
107
+ </div>
108
+ </li>
109
+ <?php endforeach; ?>
110
+ </ol>
111
+ <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
112
+
113
+ <?php else: ?>
114
+
115
+ <?php // Grid Mode ?>
116
+
117
+ <?php $_collectionSize = $_productCollection->count() ?>
118
+ <?php $_columnCount = $this->getColumnCount(); ?>
119
+ <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">
120
+ <?php $i=0; foreach ($_productCollection as $_product): ?>
121
+ <?php /*if ($i++%$_columnCount==0): ?>
122
+ <?php endif*/ ?>
123
+ <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
124
+ <a href="<?php echo $_product->getProductUrl() ?>" rel="<?php echo Mage::helper('catalogpreview')->getProductRel($_product)?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image preview">
125
+ <?php $_imgSize = 210; ?>
126
+ <img id="product-collection-image-<?php echo $_product->getId(); ?>"
127
+ src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>"
128
+ alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
129
+ </a>
130
+ <div class="product-info">
131
+ <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
132
+
133
+ <?php
134
+ $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
135
+ foreach($_nameAfterChildren as $_nameAfterChildName):
136
+ $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
137
+ $_nameAfterChild->setProduct($_product);
138
+ ?>
139
+ <?php echo $_nameAfterChild->toHtml(); ?>
140
+ <?php endforeach; ?>
141
+
142
+ <?php echo $this->getPriceHtml($_product, true) ?>
143
+ <?php if($_product->getRatingSummary()): ?>
144
+ <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
145
+ <?php endif; ?>
146
+ <div class="actions">
147
+ <?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
148
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
149
+ <?php elseif($_product->isSaleable()): ?>
150
+ <a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a>
151
+ <?php else: ?>
152
+ <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
153
+ <?php endif; ?>
154
+ <ul class="add-to-links">
155
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
156
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
157
+ <?php endif; ?>
158
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
159
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
160
+ <?php endif; ?>
161
+ </ul>
162
+ </div>
163
+ </div>
164
+ </li>
165
+ <?php /*if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
166
+ <?php endif*/ ?>
167
+ <?php endforeach ?>
168
+ </ul>
169
+ <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
170
+ <?php endif; ?>
171
+
172
+ <div class="toolbar-bottom">
173
+ <?php echo $this->getToolbarHtml() ?>
174
+ </div>
175
+ </div>
176
+ <?php endif; ?>
177
+
178
+ <?php
179
+ //set product collection on after blocks
180
+ $_afterChildren = $this->getChild('after')->getSortedChildren();
181
+ foreach($_afterChildren as $_afterChildName):
182
+ $_afterChild = $this->getChild('after')->getChild($_afterChildName);
183
+ $_afterChild->setProductCollection($_productCollection);
184
+ ?>
185
+ <?php echo $_afterChild->toHtml(); ?>
186
+ <?php endforeach; ?>
app/design/frontend/rwd/default/template/catalogpreview/catalog/product/list/upsell.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php if(count($this->getItemCollection()->getItems())): ?>
28
+ <?php $_columnCount = $this->getColumnCount(); ?>
29
+ <div class="box-collateral box-up-sell">
30
+ <h2><?php echo $this->__('You may also be interested in the following product(s)') ?></h2>
31
+ <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col" id="upsell-product-table">
32
+ <?php // $this->setColumnCount(5); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
33
+ <?php $this->resetItemsIterator() ?>
34
+ <?php foreach ($this->getItemCollection()->getItems() as $_link): ?>
35
+ <?php /*for($_i=0;$_i<$this->getRowCount();$_i++): ?>
36
+ <tr>
37
+ <?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
38
+ <?php if($_link=$this->getIterableItem()): */ ?>
39
+ <li>
40
+ <a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_link->getName()) ?>" class="product-image preview" rel="<?php echo Mage::helper('catalogpreview')->getProductRel($_link)?>">
41
+ <img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(280) ?>" alt="<?php echo $this->escapeHtml($_link->getName()) ?>" />
42
+ </a>
43
+ <h3 class="product-name"><a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->escapeHtml($_link->getName()) ?>"><?php echo $this->escapeHtml($_link->getName()) ?></a></h3>
44
+ <?php echo $this->getPriceHtml($_link, true, '-upsell') ?>
45
+ <?php echo $this->getReviewsSummaryHtml($_link) ?>
46
+ </li>
47
+ <?php /*else: ?>
48
+ <td class="empty">&nbsp;</td>
49
+ <?php endif; ?>
50
+ <?php endfor; ?>
51
+ </tr>
52
+ <?php endfor; */?>
53
+ <?php endforeach; ?>
54
+ </ul>
55
+ <?php /*
56
+ <script type="text/javascript">decorateGeneric($$('#upsell-product-table'), ['odd','even','first','last'])</script>
57
+ */ ?>
58
+ </div>
59
+ <?php endif ?>
app/design/frontend/rwd/default/template/catalogpreview/checkout/cart/crosssell.phtml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package rwd_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * Cart cross sell items template
30
+ *
31
+ * @see Mage_Checkout_Block_Cart_Crosssell
32
+ */
33
+ ?>
34
+ <?php if($this->getItemCount()): ?>
35
+ <div class="crosssell">
36
+ <h2><?php echo $this->__('Based on your selection, you may be interested in the following items:') ?></h2>
37
+ <ul id="crosssell-products-list" class="products-grid products-grid--max-3-col">
38
+ <?php foreach ($this->getItems() as $_item): ?>
39
+ <li class="item">
40
+ <a class="product-image preview" href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" rel="<?php echo Mage::helper('catalogpreview')->getProductRel($_item)?>">
41
+ <img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(210); ?>" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
42
+ </a>
43
+ <div class="product-details">
44
+ <h3 class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></h3>
45
+ <?php echo $this->getPriceHtml($_item, true) ?>
46
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_item) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
47
+ <ul class="add-to-links">
48
+ <?php if ($this->helper('wishlist')->isAllow()) : ?>
49
+ <li><a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
50
+ <?php endif; ?>
51
+ <?php if($_compareUrl=$this->getAddToCompareUrl($_item)): ?>
52
+ <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
53
+ <?php endif; ?>
54
+ </ul>
55
+ </div>
56
+ </li>
57
+ <?php endforeach; ?>
58
+ </ul>
59
+ <?php // <script type="text/javascript">decorateList('crosssell-products-list', 'none-recursive')</script> ?>
60
+ </div>
61
+ <?php endif; ?>
app/design/frontend/rwd/default/template/catalogpreview/style.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if($this->canShowPreview()):?>
2
+ <style type="text/css">
3
+ <?php
4
+ echo Mage::helper('catalogpreview')->getStyle();
5
+ ?>
6
+
7
+ .loaderclass{
8
+ background: url("<?php echo Mage::getBaseUrl('media')."swcp/".Mage::helper('catalogpreview')->getConfig('catalogpreview/style/animation')?>") no-repeat scroll 50% 50% #FFFFFF;
9
+ height: 97%;
10
+ position: absolute;
11
+ width: 97%;
12
+ }
13
+ div#preview img{width: 100%;}
14
+ </style>
15
+ <script type="text/javascript">
16
+ document.observe('dom:loaded', function() {
17
+ var pp = new SafalCatalogPreview("a.preview",'<?php echo Mage::helper('catalogpreview')->getConfigJson()?>');
18
+ });
19
+ </script>
20
+ <?php endif;?>
app/etc/modules/Safal_Catalogpreview.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Safal_Catalogpreview>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Safal_Catalogpreview>
8
+ </modules>
9
+ </config>
js/swcatalogpreview/preview.js ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var SafalCatalogPreview = Class.create();
2
+ SafalCatalogPreview.prototype = {
3
+ initialize: function(target,options) {
4
+ this.target = target;
5
+ this.top = 0;
6
+ this.left = 0;
7
+ this.xOffset = 20;
8
+ this.yOffset = 20;
9
+ this.init=0;
10
+ this.options = options.evalJSON();
11
+ this.wHeight = document.viewport.getHeight();
12
+ this.wWidth = document.viewport.getWidth();
13
+ this.preview = null;
14
+ this.loader = this.options.animation;
15
+ $$(this.target).each(function(element){
16
+ Event.observe(element,'mouseover',this.show.bindAsEventListener(this));
17
+ Event.observe(element,'mouseout',this.hide.bindAsEventListener(this));
18
+ Event.observe(element,'mousemove',this.move.bindAsEventListener(this));
19
+ }.bind(this));
20
+ },
21
+ show: function(event) {
22
+ var parentElem = $(Event.element(event)).up('a');
23
+ if(parentElem){
24
+ this.rel = parentElem.rel;
25
+ this.preview = this.prepareHtml(this.rel,parentElem.title,'first');
26
+ document.body.appendChild(this.preview);
27
+ this.preview.setStyle({display: 'block'});
28
+ }
29
+ },
30
+ hide: function(event){
31
+ if(this.preview != null){
32
+ this.preview.hide();
33
+ }
34
+ },
35
+ move: function(event){
36
+ if(this.preview != null){
37
+ var viewport = document.viewport.getDimensions();
38
+ var window_height = viewport.height+20;
39
+ var window_width = viewport.width+100;
40
+ var element_height = $(this.preview).getHeight();
41
+ var element_width = $(this.preview).getWidth();
42
+ var y_middle = (window_height - element_height + this.yOffset)/2;
43
+ var x_middle = (window_width - element_width + this.xOffset)/2;
44
+ var mouse_x = this.mouseX(event);
45
+ var mouse_y = this.mouseY(event);
46
+ var rel_mouse_position=Object.extend(document.viewport.getDimensions(),document.viewport.getScrollOffsets());
47
+ mouse_x-=rel_mouse_position.left;
48
+ mouse_y-=rel_mouse_position.top;
49
+ if ( (element_height + mouse_y) >= ( window_height - this.yOffset) ){
50
+ if (element_height+this.yOffset > mouse_y ){
51
+ mouse_y = y_middle;
52
+ mouse_y = mouse_y - this.yOffset;
53
+ }else{
54
+ mouse_y = mouse_y - element_height;
55
+ mouse_y = mouse_y - this.yOffset;
56
+ }
57
+
58
+ } else {
59
+ mouse_y = mouse_y + this.yOffset;
60
+ }
61
+
62
+ if ( (element_width + mouse_x) >= ( window_width - this.xOffset) ){
63
+
64
+ if (element_width +this.xOffset > mouse_x){
65
+ mouse_x = x_middle;
66
+ mouse_x = mouse_x - this.xOffset;
67
+ }else{
68
+ mouse_x = mouse_x - element_width;
69
+ mouse_x = mouse_x - this.xOffset;
70
+ }
71
+ } else {
72
+ mouse_x = mouse_x + this.xOffset;
73
+ }
74
+ this.preview.setStyle({
75
+ top: mouse_y + rel_mouse_position.top + 'px',
76
+ left: mouse_x + rel_mouse_position.left + 'px'
77
+ });
78
+ }
79
+ },
80
+ prepareHtml: function(rel,title,order){
81
+ if($("preview")){
82
+ var div = $("preview");
83
+ div.innerHTML = "";
84
+ }
85
+ else{
86
+ var div = document.createElement('div');
87
+ div.id = "preview";
88
+ }
89
+
90
+ this.loaderImg = document.createElement('div');
91
+ this.loaderImg.id = "loader";
92
+ this.loaderImg.className = "loaderclass";
93
+
94
+ var img = document.createElement('img');
95
+ img.src = rel;
96
+ img.alt = "loading";
97
+ Event.observe(img,'load',this.displayAnimation.bindAsEventListener(this));
98
+
99
+ var titlediv = document.createElement('div');
100
+ if(this.options.show == 1){
101
+ titlediv.innerHTML = title;
102
+ }
103
+ div.appendChild(this.loaderImg);
104
+ if(this.options.position == 1){
105
+ div.appendChild(titlediv);
106
+ div.appendChild(img);
107
+ }
108
+ else{
109
+ div.appendChild(img);
110
+ div.appendChild(titlediv);
111
+ }
112
+ return div;
113
+ },
114
+ mouseX: function(evt) {
115
+ if (!evt) evt = window.event;
116
+ if (evt.pageX) return evt.pageX;
117
+ else if (evt.clientX)
118
+ return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
119
+ else return 0;
120
+ },
121
+ mouseY: function(evt) {
122
+ if (!evt) evt = window.event;
123
+ if (evt.pageY) return evt.pageY;
124
+ else if (evt.clientY)
125
+ return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
126
+ else return 0;
127
+ },
128
+ displayAnimation: function(event)
129
+ {
130
+ this.loaderImg.hide();
131
+ }
132
+ };
media/swcp/default/loader.gif ADDED
Binary file
package.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Safal_Catalogpreview</name>
4
+ <version>1.0.1</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Safal Catalog Preview is an extension to preview enlarge product image to customers on your store. &#xD;
10
+ &#xD;
11
+ It's fully customizable from admin.</summary>
12
+ <description>&lt;p&gt;Safal Catalog Preview is an extension to enlarge product image preview to customers on your store. It's fully customizable from admin.&lt;/p&gt;&#xD;
13
+ &#xD;
14
+ &lt;p&gt;Safal Catalog Preview&lt;/p&gt;&#xD;
15
+ &#xD;
16
+ &lt;p&gt;1. 100% free to use and easy to install via Magento Connect.&lt;/p&gt;&#xD;
17
+ &lt;p&gt;2. Requires no changes in magento core files.&lt;/p&gt;&#xD;
18
+ &lt;p&gt;3. Developed using Prototype. So No Jquery Confict on your store.&lt;/p&gt;&#xD;
19
+ &lt;p&gt;4. Preview popup window automatically set according to screen view port.&lt;/p&gt;&#xD;
20
+ &lt;p&gt;5. Custom Set preview popup styling.&lt;/p&gt;&#xD;
21
+ &lt;p&gt;6. Custom Set product name size, style and position on preview box.&lt;/p&gt;&#xD;
22
+ &lt;p&gt;7. Ability to allow preview on selected or every categories.&lt;/p&gt;&#xD;
23
+ &lt;p&gt;8. Allows you to upload your custom loader image from admin.&lt;/p&gt;&#xD;
24
+ &lt;p&gt;9. Use Prototype lib instead of jQuery to avoid javascript conflicts and errors.&lt;/p&gt;&#xD;
25
+ &#xD;
26
+ &lt;strong&gt;Support: &lt;a href="http://www.safalweb.com/contact.html"&gt;http://www.safalweb.com/contact.html&lt;/a&gt;&lt;/strong&gt;&#xD;
27
+ </description>
28
+ <notes>Stable Release of Safal Catalog Preview.</notes>
29
+ <authors><author><name>SafalWeb</name><user>safalweb</user><email>ankit.ank25@gmail.com</email></author></authors>
30
+ <date>2014-05-18</date>
31
+ <time>17:39:09</time>
32
+ <contents><target name="magecommunity"><dir name="Safal"><dir name="Catalogpreview"><dir name="Block"><dir name="Adminhtml"><file name="Categories.php" hash="842f28b5f5f69be96bc91d161d4b15d0"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Catalogpreview"><file name="Categories.php" hash="26537faafb8f3106a153e46ec1223ee6"/></dir></dir></dir></dir></dir></dir><file name="Catalogpreview.php" hash="47ccde01d3f8b267edeb874c7b486a16"/></dir><dir name="Helper"><file name="Data.php" hash="12e41c3f3d83575117029316070f6322"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Alignment.php" hash="b133cde2e56815e6270d56fc29a029a5"/><file name="Imagescope.php" hash="5276b9384ed16d904cf9ccdcc3f0a014"/><file name="Position.php" hash="bc66a19a21030d55e3314f0a9aad12cd"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CatalogpreviewController.php" hash="534e2f363bc134ab9e5d8fcc50a7ebdb"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="dcbd4695ea9d2edf241d28348561375c"/><file name="config.xml" hash="7adf203711778d1ca28c2b0f028709b6"/><file name="system.xml" hash="12eba80ddf24e62754ecaf68deec872f"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="catalogpreview.xml" hash="ce9ff54e47632857890983faf9eb3f66"/></dir><dir name="template"><dir name="catalogpreview"><dir name="catalog"><dir name="product"><dir name="list"><file name="upsell.phtml" hash="8eb66ac0f99c203bf7aa7ac368ee8dec"/></dir><file name="list.phtml" hash="160f0a000dfe43a00abf007c6e2ff29a"/></dir></dir><dir name="checkout"><dir name="cart"><file name="crosssell.phtml" hash="de74e5942f9ced6039bf0fb3095223db"/></dir></dir><file name="style.phtml" hash="c12abc92decce588afeed63597cb3fd8"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="catalogpreview.xml" hash="ce9ff54e47632857890983faf9eb3f66"/></dir><dir name="template"><dir name="catalogpreview"><dir name="catalog"><dir name="product"><dir name="list"><file name="upsell.phtml" hash="4673c9967ef2f7cd1970ee45c53761dd"/></dir><file name="list.phtml" hash="e5c25a931dccfdcb3a449a874c858dfd"/></dir></dir><dir name="checkout"><dir name="cart"><file name="crosssell.phtml" hash="706598580a7bb92b9eb36fc29d54050b"/></dir></dir><file name="style.phtml" hash="c12abc92decce588afeed63597cb3fd8"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="catalogpreview.xml" hash="cfdde1a60db12387094aad8b0f68d0d1"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="."><dir name="js"><dir name="swcatalogpreview"><file name="preview.js" hash="b365a50ca46ac9b7fa87d4ab87862047"/></dir></dir></dir></target><target name="magemedia"><dir name="swcp"><dir name="default"><file name="loader.gif" hash="dceb764a37e08003943a1a2210333a8f"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="safalweb"><dir name="all"><dir name="images"><file name="ok.gif" hash="834dfafd5f8b44c4b24a4c00add56fcf"/></dir></dir></dir><dir name="lib"><dir name="prototype"><dir name="windows"><dir name="themes"><dir name="safal"><file name="btn_bg.gif" hash="37c51a4d48a92da9648dcd3ca011039f"/><file name="content_bg.gif" hash="21278ea0da2d4256f4ced96b6080ba2e"/><file name="top_bg.gif" hash="26f28090de87d64f9b01bf624f89bfe2"/><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><file name="safal.css" hash="7539a58d28ecac8cc10c80f56991dc30"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Safal_Catalogpreview.xml" hash="49aec5229090faa3b4bb6e724c4bc43d"/></dir></target></contents>
33
+ <compatible/>
34
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
35
+ </package>
skin/adminhtml/default/default/lib/prototype/windows/themes/safal.css ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .dialog { border:1px solid #555; }
2
+ .dialog .bot { display:none !important; }
3
+ .overlay_magento { background-color:#000; filter:alpha(opacity=60); -moz-opacity:.6; opacity:.6; -webkit-opacity:.6; }
4
+ .top.table_window { border-bottom:1px solid #e6e6e6; background:#6a838b url(safal/top_bg.gif) 0 100% repeat-x; }
5
+
6
+ .magento_nw { width:6px; height:28px; }
7
+ .magento_n { height:28px; }
8
+ .magento_ne { width:6px; height:28px; }
9
+
10
+ .magento_w { width:6px; }
11
+ .magento_e { width:6px; }
12
+ .magento_w,
13
+ .magento_e,
14
+ .magento_content { background: #fafafa url(safal/content_bg.gif) 0 0 repeat-x; }
15
+
16
+ .magento_sw { background:#deebf0; width:5px; height:3px; }
17
+ .magento_s { background:#deebf0; height:3px; }
18
+ .magento_se,
19
+
20
+ .magento_sizer { background:#deebf0; width:5px; height:3px; }
21
+ .magento_sizer { cursor:se-resize; }
22
+
23
+ .magento_close { width:16px; height:16px; background:url(safal/window_close.png) no-repeat 0 0; position:absolute; top:5px; right:7px; cursor:pointer; z-index:1000; }
24
+ .magento_minimize { width:16px; height:16px; background:url(safal/window_minimize.png) 0 0 no-repeat; position:absolute; top:5px; right:28px; cursor:pointer; z-index:1000; }
25
+ .magento_maximize { width:16px; height:16px; background:url(safal/window_maximize.png)0 0 no-repeat; position:absolute; top:5px; right:49px; cursor:pointer; z-index:1000; }
26
+
27
+ .magento_title { float:left; width:100%; font:bold 12px/28px Arial, Helvetica, sans-serif; color:#fff; text-align:left; }
28
+
29
+ .magento_content { overflow:auto; font-size:12px; }
30
+ .magento_content,
31
+ .magento_content label { color:#333; font-family:Arial, sans-serif; }
32
+
33
+ .magento_buttons { padding:10px; text-align:right; }
34
+ .magento_buttons input.button { border-width:1px; border-style:solid; border-color:#ed6502 #a04300 #a04300 #ed6502; background:#ffac47 url(safal/btn_bg.gif) 0 100% repeat-x; padding:0 7px 1px 7px; font:bold 12px/18px Arial, Helvetica, sans-serif; color:#fff; cursor:pointer; text-align:center; white-space:nowrap; }
35
+
36
+ /* FOR IE */
37
+ * html .magento_close { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/safal/window_maximize.png", sizingMethod="crop"); }
38
+ * html .magento_minimize { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/safal/window_close.png", sizingMethod="crop");}
39
+ * html .magento_maximize { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/safal/window_minimize.png", sizingMethod="crop"); }
skin/adminhtml/default/default/lib/prototype/windows/themes/safal/btn_bg.gif ADDED
Binary file
skin/adminhtml/default/default/lib/prototype/windows/themes/safal/content_bg.gif ADDED
Binary file
skin/adminhtml/default/default/lib/prototype/windows/themes/safal/top_bg.gif ADDED
Binary file
skin/adminhtml/default/default/lib/prototype/windows/themes/safal/window_close.png ADDED
Binary file
skin/adminhtml/default/default/safalweb/all/images/ok.gif ADDED
Binary file