madstack - Version 1.0

Version Notes

vue.ai delivers fashion product recommendations based on visual similarity

Download this release

Release Info

Developer LEAD
Extension madstack
Version 1.0
Comparing to
See all releases


Version 1.0

Files changed (36) hide show
  1. app/code/local/Apptha/Madstack/Block/Adminhtml/Adminhtml/Dashboard/Grids.php +53 -0
  2. app/code/local/Apptha/Madstack/Block/Adminhtml/Adminhtml/Madstackiframe.php +49 -0
  3. app/code/local/Apptha/Madstack/Block/Adminhtml/Dashboard/Grids.php +53 -0
  4. app/code/local/Apptha/Madstack/Block/Adminhtml/Madstackiframe.php +49 -0
  5. app/code/local/Apptha/Madstack/Block/Madstack.php +176 -0
  6. app/code/local/Apptha/Madstack/Helper/Data.php +826 -0
  7. app/code/local/Apptha/Madstack/Model/Installid.php +35 -0
  8. app/code/local/Apptha/Madstack/Model/Mysql4/Installid.php +38 -0
  9. app/code/local/Apptha/Madstack/Model/Mysql4/Installid/Collection.php +39 -0
  10. app/code/local/Apptha/Madstack/Model/Mysql4/Storestatus.php +38 -0
  11. app/code/local/Apptha/Madstack/Model/Mysql4/Storestatus/Collection.php +39 -0
  12. app/code/local/Apptha/Madstack/Model/Observer.php +148 -0
  13. app/code/local/Apptha/Madstack/Model/Storestatus.php +100 -0
  14. app/code/local/Apptha/Madstack/controllers/Adminhtml/IframeController.php +46 -0
  15. app/code/local/Apptha/Madstack/controllers/IndexController.php +38 -0
  16. app/code/local/Apptha/Madstack/controllers/RestController.php +43 -0
  17. app/code/local/Apptha/Madstack/etc/config.xml +223 -0
  18. app/code/local/Apptha/Madstack/etc/system.xml +107 -0
  19. app/code/local/Apptha/Madstack/sql/madstack_setup/mysql4-install-0.1.0.php +57 -0
  20. app/design/adminhtml/default/default/template/madstack/iframe.phtml +43 -0
  21. app/design/frontend/base/default/layout/madstack.xml +88 -0
  22. app/design/frontend/base/default/template/madstack/event/cart.phtml +45 -0
  23. app/design/frontend/base/default/template/madstack/event/checkout.phtml +39 -0
  24. app/design/frontend/base/default/template/madstack/event/removeCart.phtml +39 -0
  25. app/design/frontend/base/default/template/madstack/event/success.phtml +55 -0
  26. app/design/frontend/base/default/template/madstack/event/wishlist.phtml +52 -0
  27. app/design/frontend/base/default/template/madstack/product/slider.phtml +234 -0
  28. app/etc/modules/Apptha_Madstack.xml +40 -0
  29. app/locale/en_US/Apptha_Madstack.csv +208 -0
  30. package.xml +18 -0
  31. skin/frontend/base/default/css/madstack/ie8.css +4 -0
  32. skin/frontend/base/default/css/madstack/madstack.css +439 -0
  33. skin/frontend/base/default/images/madstack/icon_sprite.png +0 -0
  34. skin/frontend/base/default/js/madstack/carouselslider/carousel.js +342 -0
  35. skin/frontend/base/default/js/madstack/carouselslider/jquery.bxslider.min.js +10 -0
  36. skin/frontend/base/default/js/madstack/madstack.js +43 -0
app/code/local/Apptha/Madstack/Block/Adminhtml/Adminhtml/Dashboard/Grids.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ */
30
+ ?>
31
+
32
+ <?php
33
+ class Apptha_Madstack_Block_Adminhtml_Dashboard_Grids extends Mage_Adminhtml_Block_Dashboard_Grids {
34
+ protected function _prepareLayout(){
35
+ parent::_prepareLayout();
36
+ $this->addTab('custom', array(
37
+ 'label' => $this->__('Product viewed'),
38
+ 'content' => 'Total products viewed '.$this->viewCount(),
39
+ ));
40
+ }
41
+
42
+ protected function viewCount(){
43
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
44
+ $result = $db->query("select count('views') as count from report_event");
45
+
46
+ $view = $result->fetch(PDO::FETCH_ASSOC);
47
+ $finalcount = empty((int)$view['count']) ? 0 : (int)$view['count'] ;
48
+
49
+ return $finalcount;
50
+ }
51
+ }
52
+
53
+ ?>
app/code/local/Apptha/Madstack/Block/Adminhtml/Adminhtml/Madstackiframe.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ */
30
+ class Apptha_Madstack_Block_Adminhtml_Madstackiframe extends Mage_Adminhtml_Block_Widget_Grid_Container {
31
+
32
+ /**
33
+ * Construct the inital display of grid information
34
+ * Setting the Block files group for this grid
35
+ * Setting the Header text to display
36
+ * Setting the Controller file for this grid
37
+ *
38
+ * Return seller information as array
39
+ * @return array
40
+ */
41
+ public function __construct() {
42
+ $this->_controller = 'adminhtml_iframecontroller';
43
+ $this->_blockGroup = 'madstack';
44
+ $this->_headerText = Mage::helper('marketplace')->__('Madstack Iframe');
45
+ parent::__construct();
46
+ }
47
+
48
+ }
49
+
app/code/local/Apptha/Madstack/Block/Adminhtml/Dashboard/Grids.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ */
30
+ ?>
31
+
32
+ <?php
33
+ class Apptha_Madstack_Block_Adminhtml_Dashboard_Grids extends Mage_Adminhtml_Block_Dashboard_Grids {
34
+ protected function _prepareLayout(){
35
+ parent::_prepareLayout();
36
+ $this->addTab('custom', array(
37
+ 'label' => $this->__('Product viewed'),
38
+ 'content' => 'Total products viewed '.$this->viewCount(),
39
+ ));
40
+ }
41
+
42
+ protected function viewCount(){
43
+ $db = Mage::getSingleton('core/resource')->getConnection('core_read');
44
+ $result = $db->query("select count('views') as count from report_event");
45
+
46
+ $view = $result->fetch(PDO::FETCH_ASSOC);
47
+ $finalcount = empty((int)$view['count']) ? 0 : (int)$view['count'] ;
48
+
49
+ return $finalcount;
50
+ }
51
+ }
52
+
53
+ ?>
app/code/local/Apptha/Madstack/Block/Adminhtml/Madstackiframe.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ */
30
+ class Apptha_Madstack_Block_Adminhtml_Madstackiframe extends Mage_Adminhtml_Block_Widget_Grid_Container {
31
+
32
+ /**
33
+ * Construct the inital display of grid information
34
+ * Setting the Block files group for this grid
35
+ * Setting the Header text to display
36
+ * Setting the Controller file for this grid
37
+ *
38
+ * Return seller information as array
39
+ * @return array
40
+ */
41
+ public function __construct() {
42
+ $this->_controller = 'adminhtml_iframecontroller';
43
+ $this->_blockGroup = 'madstack';
44
+ $this->_headerText = Mage::helper('marketplace')->__('Madstack Iframe');
45
+ parent::__construct();
46
+ }
47
+
48
+ }
49
+
app/code/local/Apptha/Madstack/Block/Madstack.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_Block_Madstack extends Mage_Core_Block_Template {
31
+
32
+ /**
33
+ * Configure product view blocks
34
+ *
35
+ * @return Mage_Checkout_Block_Cart_Item_Configure
36
+ */
37
+ protected function _prepareLayout()
38
+ {
39
+
40
+ return parent::_prepareLayout();
41
+ }
42
+
43
+ public function storeStatusCollection($storeId){
44
+
45
+ return Mage::getModel('madstack/storestatus')->load ( $storeId , 'store_id' );
46
+ }
47
+
48
+
49
+ /**
50
+ * Function to get the product details
51
+ *
52
+ * Return product collection
53
+ *
54
+ * @return array
55
+ */
56
+ public function sliderProducts() {
57
+
58
+ if(Mage::getStoreConfig('madstack/madstack/activate')){
59
+
60
+ $currentPID = Mage::registry('current_product')->getId();
61
+
62
+ $data = array('productID' => $currentPID , 'uuid' => Mage::getModel('core/cookie')->get('MADid') , 'numberResult' => (Mage::getStoreConfig('madstack/madstack/count_result') + 20));
63
+
64
+ $resultArray = Mage::helper('madstack')->curlFunc($data,'https://contusapi.madstreetden.com/more');
65
+
66
+ if($resultArray['status'] == 'success'){
67
+ $products = Mage::getModel('catalog/product')
68
+ ->getCollection()
69
+ ->addAttributeToSelect('name')
70
+ ->addAttributeToSelect('price')
71
+ ->addFinalPrice('final_price')
72
+ ->addAttributeToSelect('product_url')
73
+ ->addAttributeToSelect('small_image')
74
+ ->addAttributeToFilter('entity_id', array('in' => $resultArray['data']))
75
+ ->addAttributeToFilter('status', 1);
76
+
77
+ }else{
78
+ $products = array();
79
+ }
80
+
81
+ return $products;
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Function to add tracking in view product detail page
87
+ *
88
+ * Return product productId,Category Name and product price for MAD Stack tracking
89
+ *
90
+ * @return json array
91
+ */
92
+ public function viewProduct(){
93
+
94
+ $arrProductView = array();
95
+
96
+ $viewProductDetail = Mage::registry('current_product');
97
+ if ($viewProductDetail) {
98
+ $viewProductId = $viewProductDetail->getId();
99
+ $categories_name = Mage::helper('madstack')->getCategoryName($viewProductId);
100
+ $trackinArray = Mage::helper('madstack')->buildTrackArray('pageView',$viewProductId,$categories_name);
101
+ $trackinArray['prodPrice'] = round($viewProductDetail->getFinalPrice(),2);
102
+ $trackinArray['country'] = Mage::helper('madstack')->getCountry();
103
+
104
+ return Mage::helper('madstack')->trackEvent($trackinArray);
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Function to add tracking for prodcuts added in cart
110
+ *
111
+ * Return product productId,Category Name and product price for MAD Stack tracking
112
+ *
113
+ * @return json array
114
+ */
115
+ public function addToCart(){
116
+ $addedToCart = Mage::getModel('core/session')->getProductToShoppingCart();
117
+
118
+ $arrAddtoCart = array();
119
+
120
+ if ($addedToCart && $addedToCart->getId()):
121
+ $trackinArray = Mage::helper('madstack')->buildTrackArray('addToCart',$addedToCart->getId(),$addedToCart->getCategoryName());
122
+ $trackinArray['prodPrice'] = $addedToCart->getPrice();
123
+ $trackinArray['country'] = Mage::helper('madstack')->getCountry();
124
+
125
+ Mage::getModel('core/session')->unsProductToShoppingCart();
126
+
127
+ return Mage::helper('madstack')->trackEvent($trackinArray);
128
+
129
+ endif;
130
+ }
131
+
132
+ /**
133
+ * Function to add tracking for checkout page
134
+ *
135
+ * Return product productId,Category Name and product price for MAD Stack tracking
136
+ *
137
+ * @return json array
138
+ */
139
+ public function checkOutProducts(){
140
+ $cart = Mage::getModel('checkout/cart')->getQuote();
141
+ foreach ($cart->getAllItems() as $item) {
142
+ $productId = $productId.$item->getProduct()->getid().'_';
143
+ $categories_name = $categories_name.Mage::helper('madstack')->getCategoryName($productId).'_';
144
+ $productPrice = $productPrice.round($productPrice.$item->getProduct()->getFinalPrice(),2).'_';
145
+ $productQty = $productQty.$item->getQty().'_';
146
+ }
147
+
148
+ $trackinArray = Mage::helper('madstack')->buildTrackArray('placeOrder',rtrim($productId,'_'),rtrim($categories_name,'_'));
149
+ $trackinArray['prodPrice'] = rtrim($productPrice,'_');
150
+ $trackinArray['prodQty'] = rtrim($productQty,'_');
151
+
152
+ return Mage::helper('madstack')->trackEvent($trackinArray);
153
+ }
154
+
155
+ /**
156
+ * Function to add tracking for prodcuts added in cart
157
+ *
158
+ * Return product productId,Category Name and product price for MAD Stack tracking
159
+ *
160
+ * @return json array
161
+ */
162
+ public function removeFromCart(){
163
+ $removeFromCart = Mage::getModel('core/session')->getRemoveProduct();
164
+
165
+ if ($removeFromCart && $removeFromCart->getId()):
166
+ $trackinArray = Mage::helper('madstack')->buildTrackArray('removeFromCart',$removeFromCart->getId(),$removeFromCart->getCategoryName());
167
+ $trackinArray['prodPrice'] = $removeFromCart->getPrice();
168
+ $trackinArray['country'] = Mage::helper('madstack')->getCountry();
169
+
170
+ Mage::getModel('core/session')->unsRemoveProduct();
171
+
172
+ return Mage::helper('madstack')->trackEvent($trackinArray);
173
+
174
+ endif;
175
+ }
176
+ }
app/code/local/Apptha/Madstack/Helper/Data.php ADDED
@@ -0,0 +1,826 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+
31
+
32
+ class Apptha_Madstack_Helper_Data extends Mage_Core_Helper_Abstract {
33
+
34
+ /**
35
+ * Check Madstack module enable/disable
36
+ *
37
+ * @return boolen value
38
+ */
39
+
40
+ function checkMadstackEnable() {
41
+ return Mage::getStoreConfig('madstack/madstack/activate');
42
+ }
43
+
44
+ /**
45
+ * Method to check the authendication
46
+ *
47
+ * if a valid user, send the product details to respecive server.
48
+ *
49
+ * @param $authParams as authendication key and action in encrypted format
50
+ *
51
+ * @return array
52
+ *
53
+ */
54
+ public function authendication($authParams) {
55
+ if(!empty($authParams)){
56
+ $decodeUrl = $this->decryptData($authParams);
57
+
58
+ parse_str($decodeUrl,$parameters);
59
+
60
+ $consumerDet = Mage::getModel('madstack/installid')->getCollection();
61
+
62
+ if(!empty($consumerDet)){
63
+ foreach($consumerDet as $consumerData){
64
+ $consumerSecret = $consumerData->getMadstackUuid();
65
+ }
66
+ }
67
+ if($parameters ['install_id'] == $consumerSecret){
68
+ $result = array('success');
69
+ $this->sendResponse ( 200, json_decode ( $result ) );
70
+
71
+ $action = $parameters['action'];
72
+
73
+ try {
74
+ switch ($action) {
75
+ /*
76
+ * Fetch the all products from the site
77
+ */
78
+ case "allProducts" :
79
+ if (empty($parameters ['storeId'])) {
80
+ $this->sendResponse ( 303, json_encode ( array (
81
+ 'error' => true,
82
+ 'message' => 'StoreId parameter is missing'
83
+ ) ) );
84
+ }else{
85
+ $result[] = Mage::helper('madstack')->allproducts($parameters ['storeId']);
86
+ $this->sendResponse ( 200, json_encode ( $result ) );
87
+ break;
88
+ }
89
+
90
+ /*
91
+ * Fetch the products based on the timestamp
92
+ */
93
+ case "timePeriod" :
94
+
95
+ if (empty($parameters ['storeId'])) {
96
+ $this->sendResponse ( 303, json_encode ( array (
97
+ 'error' => true,
98
+ 'message' => 'StoreId parameter is missing'
99
+ ) ) );
100
+ }else{
101
+ if (empty($parameters ['from']) && empty($parameters ['to'])) {
102
+ $this->sendResponse ( 303, json_encode ( array (
103
+ 'error' => true,
104
+ 'message' => 'Product Creation Date parameter is missing'
105
+ ) ) );
106
+ } else if (!empty($parameters ['from'])) {
107
+ $result[] = Mage::helper('madstack')->dateStampProducts($parameters ['from'],$parameters ['to']);
108
+ $this->sendResponse ( 200, json_encode ( $result ) );
109
+ }else{
110
+ $this->sendResponse ( 303, json_encode ( array (
111
+ 'error' => true,
112
+ 'message' => 'Parameter vale missed in datestamp action.'
113
+ ) ) );
114
+ }
115
+ }
116
+
117
+ break;
118
+ /*
119
+ * Fetch the products based on the productID
120
+ */
121
+ case "productDetail" :
122
+
123
+ if (empty($parameters ['productid'])) {
124
+ $this->sendResponse ( 303, json_encode ( array (
125
+ 'error' => true,
126
+ 'message' => 'Product ID parameter is missing'
127
+ ) ) );
128
+ }else if (empty($parameters ['storeId'])) {
129
+ $this->sendResponse ( 303, json_encode ( array (
130
+ 'error' => true,
131
+ 'message' => 'StoreId parameter is missing'
132
+ ) ) );
133
+ } else {
134
+ $result[] = Mage::helper('madstack')->ProductDetail($parameters ['productid'],$parameters ['storeId']);
135
+ $this->sendResponse ( 200, json_encode ( $result ) );
136
+ }
137
+ break;
138
+
139
+ /*
140
+ * Fetch the products based on Updated date
141
+ */
142
+ case "updatedProducts" :
143
+
144
+ if (empty($parameters ['from']) && empty($parameters ['to'])) {
145
+ $this->sendResponse ( 303, json_encode ( array (
146
+ 'error' => true,
147
+ 'message' => 'Updated Product Date parameter is missing'
148
+ ) ) );
149
+ } else if (empty($parameters ['storeId'])) {
150
+ $this->sendResponse ( 303, json_encode ( array (
151
+ 'error' => true,
152
+ 'message' => 'StoreId parameter is missing'
153
+ ) ) );
154
+ } else if (!empty($parameters ['from'])) {
155
+ $result[] = Mage::helper('madstack')->updatedProducts($parameters ['from'],$parameters ['to'],$parameters ['storeId']);
156
+ $this->sendResponse ( 200, json_encode ( $result ) );
157
+ }else{
158
+ $this->sendResponse ( 303, json_encode ( array (
159
+ 'error' => true,
160
+ 'message' => 'Parameter vale missed in updated products.'
161
+ ) ) );
162
+ }
163
+ break;
164
+
165
+ /*
166
+ * Fetch the products qty and price based on the productID
167
+ */
168
+ case "getInventory" :
169
+
170
+ if (empty($parameters ['productid'])) {
171
+ $this->sendResponse ( 303, json_encode ( array (
172
+ 'error' => true,
173
+ 'message' => 'Product ID parameter is missing'
174
+ ) ) );
175
+ } else if (empty($parameters ['storeId'])) {
176
+ $this->sendResponse ( 303, json_encode ( array (
177
+ 'error' => true,
178
+ 'message' => 'StoreId parameter is missing'
179
+ ) ) );
180
+ }else {
181
+ $result[] = Mage::helper('madstack')->getInventory($parameters ['productid'],$parameters ['storeId']);
182
+ $this->sendResponse ( 200, json_encode ( $result ) );
183
+ }
184
+ break;
185
+
186
+ /*
187
+ * Fetch the products qty and price based on the productID
188
+ */
189
+ case "getCategory" :
190
+ if (empty($parameters ['storeId'])) {
191
+ $this->sendResponse ( 303, json_encode ( array (
192
+ 'error' => true,
193
+ 'message' => 'StoreId parameter is missing'
194
+ ) ) );
195
+ }else{
196
+ $result[] = Mage::helper('madstack')->getCategory($parameters ['storeId']);
197
+ $this->sendResponse ( 200, json_encode ( $result ) );
198
+ }
199
+ break;
200
+
201
+ /*
202
+ * Getting the store List.
203
+ */
204
+ case "storeList" :
205
+
206
+ $allStores = Mage::app()->getStores();
207
+ foreach ($allStores as $_eachStoreId => $val)
208
+ {
209
+ $result[$_eachStoreId] = $this->storeInformation($_eachStoreId);
210
+ }
211
+ $this->sendResponse ( 200, json_encode ( $result ) );
212
+
213
+ break;
214
+
215
+ /*
216
+ * Getting the store details.
217
+ */
218
+ case "storeDetails" :
219
+
220
+ if (empty($parameters ['storeId'])) {
221
+ $this->sendResponse ( 303, json_encode ( array (
222
+ 'error' => true,
223
+ 'message' => 'StoreId parameter is missing'
224
+ ) ) );
225
+ }else{
226
+ $storeId = $parameters ['storeId'];
227
+ $result[] = $this->storeInformation($storeId);
228
+ }
229
+ $this->sendResponse ( 200, json_encode ( $result ) );
230
+
231
+ break;
232
+
233
+ /*
234
+ * Getting the time zone for a particular product.
235
+ */
236
+ case "timeZone" :
237
+
238
+ if (empty($parameters ['storeId'])) {
239
+ $this->sendResponse ( 303, json_encode ( array (
240
+ 'error' => true,
241
+ 'message' => 'storeId parameter is missing'
242
+ ) ) );
243
+ } else {
244
+ $storeId = $parameters ['storeId'];
245
+
246
+ $result[] = array(
247
+ 'id' => Mage::app()->getStore($storeId)->getId(),
248
+ 'name' => Mage::app()->getStore($storeId)->getName(),
249
+ 'catalog_url' => Mage::app()->getStore($storeId)->getUrl(),
250
+ 'time_zone' => Mage::app()->getStore($storeId)->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE)
251
+ );
252
+ }
253
+
254
+ $this->sendResponse ( 200, json_encode ( $result ) );
255
+
256
+ break;
257
+
258
+ /*
259
+ * Getting the store status for a madstack.
260
+ */
261
+ case "storeStatus" :
262
+
263
+ if (empty($parameters ['storeId'])) {
264
+ $this->sendResponse ( 303, json_encode ( array (
265
+ 'error' => true,
266
+ 'message' => 'storeId parameter is missing.'
267
+ ) ) );
268
+ } else {
269
+ $data = array('store_id' => $parameters['storeId'],'domain' => Mage::getBaseURL());
270
+ Mage::getModel('madstack/storestatus')->storeStatus($data);
271
+ }
272
+
273
+ $this->sendResponse ( 200, json_encode ( $result ) );
274
+
275
+ break;
276
+ /*
277
+ * Getting the time zone for a particular product.
278
+ */
279
+ case "fashionCategory" :
280
+ $Catageory = array(1=>'Jewery' , 2=> 'Clothing' , 3=>'Handy craft',4=>'Home Decor',5=>'Earrings',6 => 'Necklaces',7=>'Bangles',8=>'Saree',9=>'Salwar Kameez',10=>'Bollywood Sarees',11=>'Designer Sarees',12=>'Bollywood suit',13=>'Anarkali Suit',14=>'Marble',15=>'Wooden',16=>'Wall & door Hangings',17=>'Lighting Lamps',18=>'Candle Holders');
281
+
282
+ $subCategory = array(0=>array(1,2,3,4),1=>array(5,6,7),2=>array(8,9),3=>array(14,15,16),4=>array(17,18),8=>array(10,11),9=>array(12,13));
283
+
284
+ $resultArray = array();
285
+ foreach($subCategory as $key => $value){
286
+ foreach($value as $parentKey => $subcategoryList){
287
+ $resultArray[] = array('id' => $subcategoryList,'name' => $Catageory[$subcategoryList],'parent_id' => $key);
288
+ }
289
+
290
+ }
291
+ $result = array_merge($result,$resultArray);
292
+ $this->sendResponse ( 200, json_encode ( $result ) );
293
+
294
+ break;
295
+
296
+
297
+ /*
298
+ * Default switch case for request action failes
299
+ */
300
+ default :
301
+ $this->sendResponse ( 405, json_encode ( array (
302
+ 'error' => true,
303
+ 'message' => 'Method Not Allowed'
304
+ ) ) );
305
+ break;
306
+
307
+ }
308
+ }catch ( OAuthException $e ) {
309
+
310
+ $errorMessage = json_decode ( $e->lastResponse );
311
+ $error ['message'] = $errorMessage->messages->error [0]->message;
312
+ $error ['code'] = $errorMessage->messages->error [0]->code;
313
+
314
+ $this->sendResponse ( $error ['code'], json_encode ( array (
315
+ 'error' => true,
316
+ 'message' => (isset ( $error ['message'] )) ? $error ['message'] : $e->getMessage (),
317
+ 'success' => 0
318
+ ) ) );
319
+ }
320
+
321
+ }else{
322
+ $this->sendResponse ( 400, json_encode ( array (
323
+ 'error' => true,
324
+ 'message' => 'Bad Request'
325
+ ) ) );
326
+ }
327
+ }else{
328
+ $this->sendResponse ( 303, json_encode ( array (
329
+ 'error' => true,
330
+ 'message' => 'Authendication parameter is empty'
331
+ ) ) );
332
+ }
333
+
334
+ return;
335
+ }
336
+
337
+ /**
338
+ * Method to send response as json format in the body
339
+ *
340
+ * @param $status, staus code for authendication result
341
+ * @param $body, result value
342
+ * @param $content_type, result in json format
343
+ *
344
+ * @return array
345
+ *
346
+ */
347
+
348
+ function sendResponse($status = 200, $body = '', $content_type = 'application/json') {
349
+ $status_header = 'HTTP/1.1 ' . $status . ' ' . $this->getStatusCodeMessage ( $status );
350
+ header ( $status_header );
351
+ header ( 'Content-type: ' . $content_type );
352
+ echo $body;
353
+ }
354
+
355
+ /**
356
+ * Method to get the status code from the url to check whether it is valid or not
357
+ *
358
+ * @param $status, authendication result
359
+ *
360
+ * @return array
361
+ *
362
+ */
363
+
364
+ function getStatusCodeMessage($status)
365
+ {
366
+ $codes = Array (
367
+ 100 => 'Continue',
368
+ 101 => 'Switching Protocols',
369
+ 200 => 'OK',
370
+ 201 => 'Created',
371
+ 202 => 'Accepted',
372
+ 203 => 'Non-Authoritative Information',
373
+ 204 => 'No Content',
374
+ 205 => 'Reset Content',
375
+ 206 => 'Partial Content',
376
+ 300 => 'Multiple Choices',
377
+ 301 => 'Moved Permanently',
378
+ 302 => 'Found',
379
+ 303 => 'See Other',
380
+ 304 => 'Not Modified',
381
+ 305 => 'Use Proxy',
382
+ 306 => '(Unused)',
383
+ 307 => 'Temporary Redirect',
384
+ 400 => 'Bad Request',
385
+ 401 => 'Unauthorized',
386
+ 402 => 'Payment Required',
387
+ 403 => 'Forbidden',
388
+ 404 => 'Not Found',
389
+ 405 => 'Method Not Allowed',
390
+ 406 => 'Not Acceptable',
391
+ 407 => 'Proxy Authentication Required',
392
+ 408 => 'Request Timeout',
393
+ 409 => 'Conflict',
394
+ 410 => 'Gone',
395
+ 411 => 'Length Required',
396
+ 412 => 'Precondition Failed',
397
+ 413 => 'Request Entity Too Large',
398
+ 414 => 'Request-URI Too Long',
399
+ 415 => 'Unsupported Media Type',
400
+ 416 => 'Requested Range Not Satisfiable',
401
+ 417 => 'Expectation Failed',
402
+ 500 => 'Internal Server Error',
403
+ 501 => 'Not Implemented',
404
+ 502 => 'Bad Gateway',
405
+ 503 => 'Service Unavailable',
406
+ 504 => 'Gateway Timeout',
407
+ 505 => 'HTTP Version Not Supported'
408
+ );
409
+
410
+ return (isset ( $codes [$status] )) ? $codes [$status] : '';
411
+ }
412
+
413
+
414
+ /**
415
+ * Function to get product collection
416
+ *
417
+ * Return product collection
418
+ *
419
+ * @return object
420
+ */
421
+ public function productsCollection($store_id) {
422
+
423
+ try{
424
+ return Mage::getModel('catalog/product')->getCollection()->addStoreFilter($store_id)->addAttributeToSelect('*')->addAttributeToFilter('status', array('eq' => 1));
425
+ }catch (Exception $e){
426
+ $e->getMessage();
427
+ }
428
+ }
429
+
430
+ /**
431
+ * Function to get all products
432
+ *
433
+ * Return all products array
434
+ *
435
+ * @return array
436
+ */
437
+ public function allproducts($store_id) {
438
+ $allProducts = $this->productsCollection($store_id);
439
+ return $this->commonArrayCollection($allProducts);
440
+ }
441
+
442
+ /**
443
+ * Function to product details based on date of created product
444
+ *
445
+ * @param $fromDate whether it is from date for collect the created product details
446
+ * @param $toDate whether it is for date for collect the created product details
447
+ *
448
+ * @return array
449
+ */
450
+ public function dateStampProducts($fromDate = '',$toDate = '') {
451
+ /*
452
+ * Here collect a product detail from date to end date.
453
+ */
454
+ if(!empty($fromDate) && !empty($toDate)){
455
+ $allProductsCollection = $this->productsCollection($store_id)
456
+ ->addAttributeToFilter('created_at', array('from'=>date("Y-m-d H:i:s", $fromDate), 'to'=>date("Y-m-d H:i:s", $toDate)));
457
+
458
+ }else{
459
+ /*
460
+ * Here collect a product detail for the from date and to date is same.
461
+ */
462
+ $allProductsCollection = $this->productsCollection($store_id)
463
+ ->addAttributeToFilter('created_at', array('from'=>date("Y-m-d H:i:s", $fromDate), 'to'=>date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")))));
464
+ }
465
+ return $this->productsArray($allProductsCollection);
466
+ }
467
+
468
+ /**
469
+ * Function to product details based on product updated date
470
+ *
471
+ * @param $fromDate whether it is from date for collect the updated product details
472
+ * @param $toDate whether it is for date for collect the updated product details
473
+ *
474
+ * @return array
475
+ */
476
+ public function updatedProducts($fromDate = '',$toDate = '',$store_id) {
477
+ /*
478
+ * Here collect a product detail from date to end date.
479
+ */
480
+ if(!empty($fromDate) && !empty($toDate)){
481
+ $allProductsCollection = $this->productsCollection($store_id)
482
+ ->addAttributeToFilter('updated_at', array('from'=>date("Y-m-d H:i:s", $fromDate), 'to'=>date("Y-m-d H:i:s", $toDate)))
483
+ ->addAttributeToFilter('updated_at', array ('neq' => new Zend_Db_Expr('created_at')));
484
+
485
+ }else{
486
+ /*
487
+ * Here collect a product detail for the from date and to date is same.
488
+ */
489
+ $allProductsCollection = $this->productsCollection($store_id)
490
+ ->addAttributeToFilter('updated_at', array('from'=>date("Y-m-d H:i:s", $fromDate), 'to'=>date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")))))
491
+ ->addAttributeToFilter('updated_at', array ('neq' => new Zend_Db_Expr('created_at')));
492
+ }
493
+ return $this->prodInventoryArray($allProductsCollection);
494
+ }
495
+ /**
496
+ * Function to get product details based on product id.
497
+ *
498
+ * @param $PID whether it is a product id.
499
+ *
500
+ * @return array
501
+ */
502
+ public function ProductDetail($PID,$store_id) {
503
+
504
+ $allProductsCollection = $this->productsCollection($store_id)->addAttributeToFilter('entity_id', array('eq' => $PID));
505
+
506
+ return $this->productsArray($allProductsCollection);
507
+ }
508
+
509
+ /**
510
+ * Function to get product inventory and price based on product id
511
+ *
512
+ * @param $PID whether it is a product id
513
+ *
514
+ * @return array
515
+ */
516
+ public function getInventory($PID) {
517
+
518
+ $allProductsCollection = $this->productsCollection($store_id)->addAttributeToFilter('entity_id', array('eq' => $PID));
519
+
520
+ return $this->prodInventoryArray($allProductsCollection);
521
+ }
522
+
523
+ /**
524
+ * Function for common result, for each action
525
+ *
526
+ * @param $ProductsCollection, it is a product collection.
527
+ *
528
+ * @return array
529
+ */
530
+ public function commonArrayCollection($ProductsCollection) {
531
+ return Mage::helper('madstack')->productsArray($ProductsCollection);
532
+ }
533
+
534
+ /**
535
+ * Function for product details into array
536
+ *
537
+ * @param $productDetails, it is a collection of product detail
538
+ *
539
+ * @return array
540
+ */
541
+ public function productsArray($productDetails) {
542
+ $arrProduct = array();
543
+ if(!empty($productDetails)){
544
+ foreach($productDetails as $prod) {
545
+ $productQty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($prod->getId())->getQty();
546
+
547
+ /*
548
+ * Getting discount percentage
549
+ */
550
+ $originalPrice = $prod->getPrice();
551
+ $finalPrice = $prod->getFinalPrice();
552
+ $percentage = 0;
553
+
554
+ if ($originalPrice > $finalPrice) {
555
+ $percentage = ($originalPrice - $finalPrice) * 100 / $originalPrice;
556
+ }
557
+
558
+ /*
559
+ * Get original image path for the products.
560
+ */
561
+ $varProductId = $prod->getId();
562
+ $productMediaConfig = Mage::getModel('catalog/product_media_config');
563
+ $originalImageUrl = $productMediaConfig->getMediaUrl($prod->getImage());
564
+
565
+ $arrProduct[$varProductId] = array(
566
+ 'id'=>$varProductId,
567
+ 'name' => $prod->getName(),
568
+ 'desc'=>$prod->getDescription(),
569
+ 'url'=>$prod->getProductUrl(),
570
+ 'category'=>$prod->getCategoryIds(),
571
+ 'qty' => round($productQty, 2),
572
+ 'retail_price' => round($prod->getPrice(), 2),
573
+ 'sale_price' =>round($prod->getFinalPrice(), 2),
574
+ 'discount' => $percentage,
575
+ 'image' => $originalImageUrl,
576
+ 'sku' => $prod->getSku(),
577
+ 'store_id' => $prod->getStoreIds()
578
+ );
579
+ }
580
+
581
+ }
582
+ /*
583
+ * If product deatils are empty, return valu as NULL value
584
+ */
585
+ if(empty($arrProduct)){
586
+ $arrProduct = null;
587
+ }
588
+ return $arrProduct;
589
+ }
590
+
591
+ /**
592
+ * Function to get registered category list
593
+ *
594
+ * @return array.
595
+ */
596
+ public function getCategory($storeid) {
597
+
598
+ $storeRootCategoryId = Mage::app()->getStore($storeid)->getRootCategoryId();
599
+
600
+ Mage::getSingleton('core/session')->setCategoryId(array($storeRootCategoryId));
601
+
602
+ Mage::helper('madstack')->getSubCategories($storeRootCategoryId);
603
+
604
+ $getCategoryIds = Mage::getSingleton('core/session')->getCategoryId();
605
+
606
+ $categories = Mage::getModel('catalog/category')
607
+ ->getCollection()
608
+ ->addAttributeToSelect('id')
609
+ ->addAttributeToSelect('parent_id')
610
+ ->addAttributeToSelect('name')
611
+ ->addFieldToFilter('entity_id', array("in"=>$getCategoryIds))
612
+ ->load();
613
+
614
+ foreach ($categories as $category) {
615
+ $resultArray[] = array('id' => $category->getId(),'name' => $category->getName(),'parent_id' => $category->getParentId());
616
+ }
617
+
618
+ Mage::getSingleton('core/session')->unsCategoryId();
619
+
620
+ return $resultArray;
621
+
622
+ }
623
+
624
+ /**
625
+ * Function to get children cartegory id
626
+ *
627
+ * @return
628
+ */
629
+
630
+ public function getSubCategories($parentId,$rootCategory,$childLevel){
631
+
632
+ $cat = Mage::getModel('catalog/category')->load($parentId);
633
+ $subcats = $cat->getChildren();
634
+ $getCategory = Mage::getSingleton('core/session')->getCategoryId();
635
+
636
+
637
+ if(!empty($subcats)){
638
+ $explodeSubCategory = explode(',',$subcats);
639
+ $mergeCategoryId = array_merge($explodeSubCategory,$getCategory);
640
+
641
+ Mage::getSingleton('core/session')->setCategoryId($mergeCategoryId);
642
+
643
+ foreach($explodeSubCategory as $subCatid)
644
+ {
645
+ $_category = Mage::getModel('catalog/category')->load($subCatid);
646
+ Mage::helper('madstack')->getSubCategories($_category->getId());
647
+ }
648
+
649
+ }
650
+ return ;
651
+ }
652
+
653
+ /**
654
+ * Function for track event response code for MAD Stack server, when track an event.
655
+ *
656
+ * @parms $productId, set product id as parameter.
657
+ *
658
+ * @return string.
659
+ */
660
+ public function categoryName($categoryId){
661
+
662
+ $getProductDetail = Mage::getModel('catalog/product')->load($productId);
663
+ $cats = $getProductDetail->getCategoryIds();
664
+
665
+ return Mage::getModel('catalog/category')->load($cats[0])->getName();
666
+ }
667
+
668
+ /**
669
+ * Function for product qty and price into array
670
+ *
671
+ * @param $productDetails, it is a collection of product detail
672
+ *
673
+ * @return array
674
+ */
675
+ public function prodInventoryArray($productDetails) {
676
+ $arrProduct = array();
677
+ if(!empty($productDetails)){
678
+ foreach($productDetails as $prod) {
679
+ $productQty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($prod->getId())->getQty();
680
+ $arrProduct[$prod->getId()] = array(
681
+ 'qty' => round($productQty, 2),
682
+ 'price' => round($prod->getPrice(), 2)
683
+ );
684
+ }
685
+
686
+ }
687
+ return $arrProduct;
688
+ }
689
+
690
+ /**
691
+ * Function for encrypt data
692
+ *
693
+ * @param $varData, authendication key for encrypt the data
694
+ *
695
+ * @return string
696
+ */
697
+ public function encryptData($varData) {
698
+
699
+ return base64_encode($varData);
700
+ }
701
+
702
+ /**
703
+ * Function for decrypt data
704
+ *
705
+ * @param $varData, decrypt the authendication key
706
+ *
707
+ * @return string
708
+ */
709
+ public function decryptData($varData) {
710
+
711
+ return base64_decode($varData);
712
+ }
713
+
714
+ /**
715
+ * Function for used to send request for get product collection from Madstack.
716
+ *
717
+ * Product collection used in product detail page slider.
718
+ *
719
+ * @return string
720
+ */
721
+ public function curlFunc($data,$feed_url){
722
+
723
+ try{
724
+ $curl = new Zend_Http_Client();
725
+
726
+ foreach($data as $key => $value){
727
+ $curl->setParameterPost($key, $value);
728
+ }
729
+ $curl->setMethod(Zend_Http_Client::POST);
730
+ $curl->setUri($feed_url);
731
+
732
+ $jsonData = $curl->request();
733
+ return Mage::helper('core')->jsonDecode($jsonData->getBody($jsonData));
734
+ }catch (Exception $e){
735
+ $e->error('error');
736
+ }
737
+
738
+ }
739
+
740
+ /**
741
+ * Function for track event response code for MAD Stack server, when track an event.
742
+ *
743
+ * @return string
744
+ */
745
+ public function trackEvent($data){
746
+ return '<script type="text/javascript">track('.json_encode($data).')</script>';
747
+
748
+ }
749
+
750
+ /**
751
+ * Function for track event response code for MAD Stack server, when track an event.
752
+ *
753
+ * @return string
754
+ */
755
+ public function buildTrackArray($event,$productId,$categoryName){
756
+
757
+ $arrTracking['event'] = $event;
758
+ $arrTracking['sourceProdID'] = $productId;
759
+ $arrTracking['sourceCatgID'] = $categoryName;
760
+ $arrTracking['vendor'] = Mage::getBaseURL();
761
+
762
+ return $arrTracking;
763
+
764
+ }
765
+
766
+ /**
767
+ * Function for track event response code for MAD Stack server, when track an event.
768
+ *
769
+ * @parms $productId, set product id as parameter.
770
+ *
771
+ * @return string.
772
+ */
773
+ public function getCategoryName($productId){
774
+
775
+ $getProductDetail = Mage::getModel('catalog/product')->load($productId);
776
+ $cats = $getProductDetail->getCategoryIds();
777
+
778
+ return Mage::getModel('catalog/category')->load($cats[0])->getName();
779
+ }
780
+
781
+ /**
782
+ * Function to get country name.
783
+ *
784
+ * @return string
785
+ */
786
+ public function getCountry(){
787
+
788
+ $geocode = file_get_contents('https://freegeoip.net/json/');
789
+ $output = json_decode($geocode);
790
+
791
+ return $output->country_name;
792
+ }
793
+
794
+ /**
795
+ * Function to generate installation id and domain name
796
+ *
797
+ * @return boolean.
798
+ */
799
+ public function generateUUID(){
800
+ $randomNum = '';
801
+ for($i = 0; $i < 16; $i++) {
802
+ $randomNum .= rand(0, 9);
803
+ }
804
+ $collection = Mage::getModel ( 'madstack/installid' );
805
+ $collection->setMadstackUuid ( $randomNum );
806
+ $collection->setDomainName ( Mage::getBaseURL() );
807
+ $collection->setCreatedTime ( Mage::getModel('core/date')->date('Y-m-d H:i:s') );
808
+ $collection->save();
809
+
810
+ return $randomNum;
811
+ }
812
+
813
+ public function storeInformation($store_id){
814
+
815
+ $store_information = array(
816
+ 'id' => Mage::app()->getStore($store_id)->getId(),
817
+ 'name' => Mage::app()->getStore($store_id)->getName(),
818
+ 'catalog_url' => Mage::app()->getStore($store_id)->getUrl(),
819
+ 'time_zone' => Mage::app()->getStore($store_id)->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE)
820
+ );
821
+
822
+ return $store_information;
823
+ }
824
+
825
+
826
+ }
app/code/local/Apptha/Madstack/Model/Installid.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_Model_Installid extends Mage_Core_Model_Abstract {
31
+ public function _construct() {
32
+ parent::_construct();
33
+ $this->_init('madstack/installid');
34
+ }
35
+ }
app/code/local/Apptha/Madstack/Model/Mysql4/Installid.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_Model_Mysql4_Installid extends Mage_Core_Model_Mysql4_Abstract {
31
+ /**
32
+ * (non-PHPdoc)
33
+ * @see Mage_Core_Model_Resource_Abstract::_construct()
34
+ */
35
+ public function _construct() {
36
+ $this->_init ( 'madstack/installid', 'sno' );
37
+ }
38
+ }
app/code/local/Apptha/Madstack/Model/Mysql4/Installid/Collection.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_Model_Mysql4_Installid_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
31
+ /**
32
+ * (non-PHPdoc)
33
+ * @see Mage_Core_Model_Resource_Db_Collection_Abstract::_construct()
34
+ */
35
+ public function _construct() {
36
+ parent::_construct ();
37
+ $this->_init ( 'madstack/installid' );
38
+ }
39
+ }
app/code/local/Apptha/Madstack/Model/Mysql4/Storestatus.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_Model_Mysql4_Storestatus extends Mage_Core_Model_Mysql4_Abstract {
31
+ /**
32
+ * (non-PHPdoc)
33
+ * @see Mage_Core_Model_Resource_Abstract::_construct()
34
+ */
35
+ public function _construct() {
36
+ $this->_init ( 'madstack/storestatus', 'sno' );
37
+ }
38
+ }
app/code/local/Apptha/Madstack/Model/Mysql4/Storestatus/Collection.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_Model_Mysql4_Storestatus_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
31
+ /**
32
+ * (non-PHPdoc)
33
+ * @see Mage_Core_Model_Resource_Db_Collection_Abstract::_construct()
34
+ */
35
+ public function _construct() {
36
+ parent::_construct ();
37
+ $this->_init ( 'madstack/storestatus' );
38
+ }
39
+ }
app/code/local/Apptha/Madstack/Model/Observer.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ */
30
+
31
+ /**
32
+ * Event Observer
33
+ */
34
+ class Apptha_Madstack_Model_Observer {
35
+
36
+ /**
37
+ * Add external js on header of the page.
38
+ *
39
+ * @param array $observer
40
+ *
41
+ * @return void
42
+ */
43
+ public function addHeader(Varien_Event_Observer $observer) {
44
+
45
+ $controller = $observer->getAction();
46
+
47
+ $layout = $controller->getLayout();
48
+ $block = $layout->createBlock('core/text');
49
+
50
+ $block->setText('<script src="'.Mage::getStoreConfig('madstack/madstack_log_url').'"></script>');
51
+ if(Mage::app()->getLayout()->getBlock('head')){
52
+ Mage::app()->getLayout()->getBlock('head')->append($block);
53
+ }
54
+ return;
55
+
56
+ }
57
+
58
+ /**
59
+ * After category changes, send request to MAD Stack
60
+ *
61
+ */
62
+ public function categoryChanges(Varien_Event_Observer $observer){
63
+
64
+ $installIdCollection = Mage::getModel('madstack/installid')->getCollection();
65
+
66
+ foreach($installIdCollection as $value){
67
+ $installid = $value->getMadstackUuid();
68
+ }
69
+
70
+ Mage::helper('madstack')->curlFunc(array('domain'=>Mage::getBaseURL(),'install_id'=>$installid),'http://contus.madstreetden.com/install/');
71
+ return;
72
+
73
+ }
74
+
75
+ /**
76
+ * Add tracking for after adding a product into Cart.
77
+ *
78
+ * Product details can be stored in session and tracking added based on these session values.
79
+ *
80
+ */
81
+ public function trackAddToCart() {
82
+
83
+ $product = Mage::getModel('catalog/product')
84
+ ->load(Mage::app()->getRequest()->getParam('product', 0));
85
+
86
+ if (!$product->getId()) {
87
+ return;
88
+ }
89
+
90
+ $categories = $product->getCategoryIds();
91
+
92
+ Mage::getModel('core/session')->setProductToShoppingCart(
93
+ new Varien_Object(array(
94
+ 'id' => $product->getId(),
95
+ 'qty' => Mage::app()->getRequest()->getParam('qty', 1),
96
+ 'name' => $product->getName(),
97
+ 'price' => round($product->getFinalPrice(),2),
98
+ 'category_name' => Mage::getModel('catalog/category')->load($categories[0])->getName(),
99
+ ))
100
+ );
101
+ return;
102
+ }
103
+
104
+ /**
105
+ * Add tracking for after adding a product into Whislist.
106
+ *
107
+ * Product ID can be stored in session
108
+ *
109
+ */
110
+ public function addProductToWishlist($observer){
111
+
112
+ $itemId = Mage::app()->getRequest()->getParam('product');
113
+
114
+ if (!$itemId) {
115
+ return;
116
+ }
117
+ Mage::getModel('core/session')->setWhislistProductId($itemId);
118
+
119
+ return;
120
+ }
121
+
122
+ /**
123
+ * Add tracking for after adding a product into Whislist.
124
+ *
125
+ * Product ID can be stored in session
126
+ *
127
+ */
128
+ public function removeFromCart($observer){
129
+
130
+ $product = $observer->getQuoteItem()->getProduct();
131
+
132
+ if (!$product->getEntityId()) {
133
+ return;
134
+ }
135
+ $productPrice = empty($product->getSpecialPrice()) ? $product->getPrice() : $product->getSpecialPrice();
136
+
137
+ Mage::getModel('core/session')->setRemoveProduct(
138
+ new Varien_Object(array(
139
+ 'id' => $product->getEntityId(),
140
+ 'price' => round($productPrice,2),
141
+ 'category_name' => Mage::helper('madstack')->getCategoryName($product->getEntityId())
142
+ ))
143
+ );
144
+
145
+ return;
146
+ }
147
+
148
+ }
app/code/local/Apptha/Madstack/Model/Storestatus.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_Model_Storestatus extends Mage_Core_Model_Abstract {
31
+
32
+ /*
33
+ * MAD Stack request URL for collect store enable/disable status.
34
+ */
35
+
36
+ public function _construct() {
37
+ parent::_construct();
38
+ $this->_init('madstack/storestatus');
39
+ }
40
+
41
+ /*
42
+ * function can be used to store the 'STORE' enable/disable status
43
+ *
44
+ * return boolean
45
+ */
46
+ public function storeStatus($data){
47
+
48
+ $resultArray = Mage::helper('madstack')->curlFunc($data,'https://contus.madstreetden.com/store/');
49
+
50
+ $collection = Mage::getModel('madstack/storestatus')->load ( $resultArray['id'] , 'store_id' );
51
+
52
+ /*
53
+ * Store the log url and api url in admin configuration only one time.
54
+ */
55
+ if(empty(Mage::getStoreConfig('madstack/madstack/product_log_url_status'))){
56
+ if(!empty($resultArray['tracking_url'])){
57
+ Mage::getModel('core/config')->saveConfig('madstack/madstack_api_url', $resultArray['carousal_api']);
58
+ Mage::getModel('core/config')->saveConfig('madstack/madstack_log_url', $resultArray['tracking_url']);
59
+ Mage::getModel('core/config')->saveConfig('madstack/madstack/product_log_url_status', 1);
60
+ }
61
+ }
62
+ if($resultArray['carousal_enable'] == false || empty($resultArray['carousal_enable'])){
63
+ $enableOption = 0;
64
+ }else{
65
+ $enableOption = 1;
66
+ }
67
+
68
+ if($resultArray['license_valid'] == false || empty($resultArray['license_valid'])){
69
+ $license_valid = 0;
70
+ }else{
71
+ $license_valid = 1;
72
+ }
73
+
74
+ if($resultArray['digestion_status'] == false || empty($resultArray['digestion_status'])){
75
+ $digestion_status = 0;
76
+ }else{
77
+ $digestion_status = 1;
78
+ }
79
+
80
+ if(empty($collection->getStoreId())){
81
+ $collection = Mage::getModel('madstack/storestatus');
82
+ $collection->setStoreId($resultArray['id']);
83
+ $collection->setLicenseValid($license_valid);
84
+ $collection->setCarousalEnable($enableOption);
85
+ $collection->setDigestionStatus($digestion_status);
86
+ $collection->setCreatedTime(Mage::getModel('core/date')->date('Y-m-d H:i:s'));
87
+ $collection->save();
88
+ }else{
89
+ $collection->setStoreId($resultArray['id']);
90
+ $collection->setLicenseValid($license_valid);
91
+ $collection->setCarousalEnable($enableOption);
92
+ $collection->setDigestionStatus($digestion_status);
93
+ $collection->setUpdatedTime(Mage::getModel('core/date')->date('Y-m-d H:i:s'));
94
+ $collection->save();
95
+ }
96
+ return;
97
+ }
98
+
99
+
100
+ }
app/code/local/Apptha/Madstack/controllers/Adminhtml/IframeController.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_Adminhtml_IframeController extends Mage_Adminhtml_Controller_action {
31
+
32
+ public function indexAction() {
33
+ //Get current layout state
34
+ $this->loadLayout()->_setActiveMenu('madstack');
35
+
36
+ $block = $this->getLayout()->createBlock(
37
+ 'Mage_Core_Block_Template',
38
+ 'madstack/adminhtml_madstackiframe',
39
+ array('template' => 'madstack/iframe.phtml')
40
+ );
41
+
42
+ $this->getLayout()->getBlock('content')->append($block);
43
+ $this->renderLayout();
44
+ }
45
+
46
+ }
app/code/local/Apptha/Madstack/controllers/IndexController.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_IndexController extends Mage_Core_Controller_Front_Action {
31
+
32
+ public function indexAction() {
33
+
34
+ $this->loadLayout ();
35
+ $this->renderLayout ();
36
+ }
37
+
38
+ }
app/code/local/Apptha/Madstack/controllers/RestController.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ class Apptha_Madstack_RestController extends Mage_Core_Controller_Front_Action {
31
+
32
+ public function apiAction() {
33
+
34
+ $varParams = $this->getRequest ()->getParam ( 'params' );
35
+
36
+ /*
37
+ * check the authendication for requested parameters
38
+ */
39
+ Mage::helper ( 'madstack' )->authendication($varParams);
40
+
41
+ return;
42
+ }
43
+ }
app/code/local/Apptha/Madstack/etc/config.xml ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ *
30
+ */
31
+ -->
32
+ <config>
33
+ <modules>
34
+ <Apptha_Madstack>
35
+ <version>0.1.0</version>
36
+ </Apptha_Madstack>
37
+ </modules>
38
+ <frontend>
39
+ <routers>
40
+ <madstack>
41
+ <use>standard</use>
42
+ <args>
43
+ <module>Apptha_Madstack</module>
44
+ <frontName>madstack</frontName>
45
+ </args>
46
+ </madstack>
47
+ </routers>
48
+ <layout>
49
+ <updates>
50
+ <madstack>
51
+ <file>madstack.xml</file>
52
+ </madstack>
53
+ </updates>
54
+ </layout>
55
+ <translate>
56
+ <modules>
57
+ <Apptha_Madstack>
58
+ <files>
59
+ <default>Apptha_Madstack.csv</default>
60
+ </files>
61
+ </Apptha_Madstack>
62
+ </modules>
63
+ </translate>
64
+ </frontend>
65
+ <global>
66
+ <helpers>
67
+ <madstack>
68
+ <class>Apptha_Madstack_Helper</class>
69
+ </madstack>
70
+ </helpers>
71
+ <blocks>
72
+ <madstack>
73
+ <class>Apptha_Madstack_Block</class>
74
+ </madstack>
75
+ <adminhtml>
76
+ <rewrite>
77
+ <dashboard_grids>Apptha_Madstack_Block_Adminhtml_Dashboard_Grids</dashboard_grids>
78
+ </rewrite>
79
+ </adminhtml>
80
+ </blocks>
81
+ <resources>
82
+ <madstack_setup>
83
+ <setup>
84
+ <module>Apptha_Madstack</module>
85
+ </setup>
86
+ <connection>
87
+ <use>core_setup</use>
88
+ </connection>
89
+ </madstack_setup>
90
+ <madstack_write>
91
+ <connection>
92
+ <use>core_write</use>
93
+ </connection>
94
+ </madstack_write>
95
+ <madstack_read>
96
+ <connection>
97
+ <use>core_read</use>
98
+ </connection>
99
+ </madstack_read>
100
+ </resources>
101
+ <models>
102
+ <madstack>
103
+ <class>Apptha_Madstack_Model</class>
104
+ <resourceModel>madstack_mysql4</resourceModel>
105
+ </madstack>
106
+ <madstack_mysql4>
107
+ <class>Apptha_Madstack_Model_Mysql4</class>
108
+ <entities>
109
+ <madstack>
110
+ <table>madstack</table>
111
+ </madstack>
112
+ <installid>
113
+ <table>madstack_installid</table>
114
+ </installid>
115
+ <storestatus>
116
+ <table>madstack_storestatus</table>
117
+ </storestatus>
118
+ </entities>
119
+ </madstack_mysql4>
120
+ </models>
121
+ <events>
122
+ <controller_action_layout_generate_blocks_after>
123
+ <observers>
124
+ <madstack>
125
+ <type>singleton</type>
126
+ <class>madstack/observer</class>
127
+ <method>addHeader</method>
128
+ </madstack>
129
+ </observers>
130
+ </controller_action_layout_generate_blocks_after>
131
+ <catalog_category_prepare_save>
132
+ <observers>
133
+ <madstack>
134
+ <class>madstack/observer</class>
135
+ <method>categoryChanges</method>
136
+ </madstack>
137
+ </observers>
138
+ </catalog_category_prepare_save>
139
+ <catalog_controller_category_delete>
140
+ <observers>
141
+ <madstack>
142
+ <class>madstack/observer</class>
143
+ <method>categoryChanges</method>
144
+ </madstack>
145
+ </observers>
146
+ </catalog_controller_category_delete>
147
+ <catalog_category_tree_move_after>
148
+ <observers>
149
+ <madstack>
150
+ <class>madstack/observer</class>
151
+ <method>categoryChanges</method>
152
+ </madstack>
153
+ </observers>
154
+ </catalog_category_tree_move_after>
155
+ <checkout_cart_product_add_after>
156
+ <observers>
157
+ <madstack>
158
+ <class>madstack/observer</class>
159
+ <method>trackAddToCart</method>
160
+ </madstack>
161
+ </observers>
162
+ </checkout_cart_product_add_after>
163
+ <wishlist_item_add_after>
164
+ <observers>
165
+ <madstack>
166
+ <class>madstack/observer</class>
167
+ <method>addProductToWishlist</method>
168
+ </madstack>
169
+ </observers>
170
+ </wishlist_item_add_after>
171
+ <sales_quote_remove_item>
172
+ <observers>
173
+ <madstack>
174
+ <class>madstack/observer</class>
175
+ <method>removeFromCart</method>
176
+ </madstack>
177
+ </observers>
178
+ </sales_quote_remove_item>
179
+ </events>
180
+ </global>
181
+ <admin>
182
+ <routers>
183
+ <madstackadmin>
184
+ <use>admin</use>
185
+ <args>
186
+ <module>Apptha_Madstack</module>
187
+ <frontName>madstackadmin</frontName>
188
+ </args>
189
+ </madstackadmin>
190
+ </routers>
191
+ </admin>
192
+ <adminhtml>
193
+ <menu>
194
+ <madstack module="madstack" translate="title">
195
+ <title>Vue.ai</title>
196
+ <sort_order>100</sort_order>
197
+ <action>madstackadmin/adminhtml_iframe</action>
198
+ </madstack>
199
+ </menu>
200
+ <acl>
201
+ <resources>
202
+ <all>
203
+ <title>Allow Everything</title>
204
+ </all>
205
+ <admin>
206
+ <children>
207
+ <system>
208
+ <children>
209
+ <config>
210
+ <children>
211
+ <madstack>
212
+ <title>Madstack - All</title>
213
+ </madstack>
214
+ </children>
215
+ </config>
216
+ </children>
217
+ </system>
218
+ </children>
219
+ </admin>
220
+ </resources>
221
+ </acl>
222
+ </adminhtml>
223
+ </config>
app/code/local/Apptha/Madstack/etc/system.xml ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2014 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ *
30
+ */
31
+ -->
32
+ <config>
33
+ <tabs>
34
+ <Apptha translate="label" module="madstack">
35
+ <label>Apptha</label>
36
+ <sort_order>100</sort_order>
37
+ </Apptha>
38
+ </tabs>
39
+ <sections>
40
+ <madstack translate="label" module="madstack">
41
+ <label>Madstack</label>
42
+ <sort_order>130</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ <tab>Apptha</tab>
47
+ <groups>
48
+ <madstack translate="label">
49
+ <label>General Configuration</label>
50
+ <frontend_type>text</frontend_type>
51
+ <sort_order>1</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
+ <fields>
56
+ <activate translate="label">
57
+ <label>Activate Madstack</label>
58
+ <frontend_type>select</frontend_type>
59
+ <source_model>adminhtml/system_config_source_yesno</source_model>
60
+ <sort_order>1</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ </activate>
65
+ <api_url translate="label">
66
+ <label>API call URL</label>
67
+ <frontend_type>text</frontend_type>
68
+ <sort_order>2</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <depends><enabled>0</enabled></depends>
71
+ </api_url>
72
+ <log_url translate="label">
73
+ <label>Log URL</label>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>3</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <depends><enabled>0</enabled></depends>
78
+ </log_url>
79
+ <count_result translate="label">
80
+ <label>Number of result(Carousel)</label>
81
+ <frontend_type>text</frontend_type>
82
+ <sort_order>4</sort_order>
83
+ <validate>required-entry</validate>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </count_result>
88
+ <installation_config translate="label">
89
+ <label>Status</label>
90
+ <frontend_type>text</frontend_type>
91
+ <sort_order>5</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <depends><enabled>0</enabled></depends>
94
+ </installation_config>
95
+ <product_log_url_status translate="label">
96
+ <label>Product log status</label>
97
+ <frontend_type>text</frontend_type>
98
+ <sort_order>6</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <depends><enabled>0</enabled></depends>
101
+ </product_log_url_status>
102
+ </fields>
103
+ </madstack>
104
+ </groups>
105
+ </madstack>
106
+ </sections>
107
+ </config>
app/code/local/Apptha/Madstack/sql/madstack_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ *
30
+ */
31
+ $installer = $this;
32
+
33
+ $installer->startSetup();
34
+
35
+ $installer->run("
36
+ CREATE TABLE IF NOT EXISTS {$this->getTable('madstack_installid')} (
37
+ `sno` int(11) unsigned NOT NULL auto_increment,
38
+ `domain_name` varchar(255) NULL default '',
39
+ `madstack_uuid` varchar(100) NOT NULL default '',
40
+ `created_time` datetime NULL,
41
+ PRIMARY KEY (`sno`)
42
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
43
+
44
+ CREATE TABLE IF NOT EXISTS {$this->getTable('madstack_storestatus')} (
45
+ `sno` int(100) unsigned NOT NULL auto_increment,
46
+ `store_id` int(100) NOT NULL ,
47
+ `license_valid` int(11) NOT NULL ,
48
+ `carousal_enable` int(11) NOT NULL ,
49
+ `digestion_status` varchar(25) NULL default '',
50
+ `created_time` datetime NULL,
51
+ `updated_time` datetime NULL,
52
+ PRIMARY KEY (`sno`)
53
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
54
+
55
+ ");
56
+
57
+ $installer->endSetup();
app/design/adminhtml/default/default/template/madstack/iframe.phtml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ ?>
31
+ <?php
32
+
33
+ if(Mage::getStoreConfig('madstack/madstack/installation_config') != 2 ){
34
+ $result = Mage::helper('madstack')->curlFunc(array('domain'=>Mage::getBaseURL(),'install_id'=>Mage::helper('madstack')->generateUUID()),'https://contus.madstreetden.com/install/');
35
+ if($result['success'] == true){
36
+ Mage::getModel('core/config')->saveConfig('madstack/madstack/installation_config', 2);
37
+ }
38
+ }
39
+
40
+
41
+ ?>
42
+ <iframe src='https://contus.madstreetden.com/?domain=<?php echo Mage::getBaseURL();?>' name="frame1" scrolling="auto" frameborder="no" align="center" height = "700px" width = "100%"></iframe>
43
+
app/design/frontend/base/default/layout/madstack.xml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ *
30
+ */
31
+
32
+ -->
33
+ <layout version="1.0">
34
+ <catalog_product_view>
35
+ <reference name="head">
36
+ <action method="addItem">
37
+ <type>skin_js</type>
38
+ <name>js/madstack/carouselslider/carousel.js</name>
39
+ </action>
40
+ <action method="addItem">
41
+ <type>skin_js</type>
42
+ <name>js/madstack/madstack.js</name>
43
+ </action>
44
+ <action method="addItem">
45
+ <type>skin_css</type><name>css/madstack/madstack.css</name>
46
+ </action>
47
+ <action method="addItem">
48
+ <type>skin_css</type>
49
+ <name>css/madstack/ie8.css</name>
50
+ <params/><if>lt IE 9</if>
51
+ </action>
52
+ </reference>
53
+ <reference name="product.info.additional">
54
+ <block type="madstack/madstack" name="madstack_madstack"
55
+ after="">
56
+ <action method="setTemplate">
57
+ <template>madstack/product/slider.phtml</template>
58
+ </action>
59
+ </block>
60
+ </reference>
61
+ </catalog_product_view>
62
+ <checkout_cart_index>
63
+ <reference name="before_body_end">
64
+ <block type="madstack/madstack" name="madstack_checkout_cart_index" template="madstack/event/cart.phtml" />
65
+ </reference>
66
+ </checkout_cart_index>
67
+ <checkout_onepage_success>
68
+ <reference name="before_body_end">
69
+ <block type="madstack/madstack" name="madstack_checkout_onepage_index" template="madstack/event/success.phtml" />
70
+ </reference>
71
+ </checkout_onepage_success>
72
+ <wishlist_index_index>
73
+ <reference name="head">
74
+ <action method="addItem">
75
+ <type>skin_js</type>
76
+ <name>js/madstack/madstack.js</name>
77
+ </action>
78
+ </reference>
79
+ <reference name="before_body_end">
80
+ <block type="madstack/madstack" name="madstack_wishlist_index" template="madstack/event/wishlist.phtml" />
81
+ </reference>
82
+ </wishlist_index_index>
83
+ <checkout_onepage_index>
84
+ <reference name="before_body_end">
85
+ <block type="madstack/madstack" name="madstack_checkout_onepage_index" template="madstack/event/checkout.phtml" />
86
+ </reference>
87
+ </checkout_onepage_index>
88
+ </layout>
app/design/frontend/base/default/template/madstack/event/cart.phtml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ ?>
31
+
32
+ <?php
33
+
34
+ /*
35
+ * Track event for add to product into cart
36
+ */
37
+ echo $this->addToCart();
38
+
39
+ /*
40
+ * Track event for remove productinfo into Cart
41
+ */
42
+
43
+ echo $this->removeFromCart();
44
+
45
+ ?>
app/design/frontend/base/default/template/madstack/event/checkout.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ ?>
31
+ <?php
32
+
33
+ /*
34
+ * Track event for added product move to next level(Checkout page)
35
+ */
36
+ echo $this->checkOutProducts();
37
+
38
+
39
+ ?>
app/design/frontend/base/default/template/madstack/event/removeCart.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ ?>
31
+ <?php
32
+
33
+ /*
34
+ * Track event for remove productinfo into Cart
35
+ */
36
+
37
+ echo $this->removeFromCart();
38
+ ?>
39
+
app/design/frontend/base/default/template/madstack/event/success.phtml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ ?>
31
+ <?php
32
+ /*
33
+ * Track event for after complete the order success page
34
+ */
35
+ $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
36
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
37
+
38
+ $orderItems = $order->getAllItems();
39
+
40
+ foreach($orderItems as $item) {
41
+ $productID = $productID.$item->getProductId().'_';
42
+ $categoryName = $categoryName.Mage::helper('madstack')->getCategoryName($item->getProductId()).'_';
43
+ $productPrice = $productPrice.round($item->getPrice(),2).'_';
44
+ $productQuanity = $productQuanity.round($item->getQtyOrdered(),0).'_';
45
+ }
46
+
47
+ $trackinArray = Mage::helper('madstack')->buildTrackArray('buy',rtrim($productID,'_'),rtrim($categoryName,'_'));
48
+ $trackinArray['prodPrice'] = rtrim($productPrice,'_');
49
+ $trackinArray['prodQty'] = rtrim($productQuanity,'_');
50
+
51
+ echo Mage::helper('madstack')->trackEvent($trackinArray);
52
+
53
+
54
+
55
+ ?>
app/design/frontend/base/default/template/madstack/event/wishlist.phtml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ ?>
31
+ <?php
32
+
33
+ /*
34
+ * Track event for add to product into whislist
35
+ */
36
+
37
+ $wslist_ProductID = Mage::getModel('core/session')->getWhislistProductId();
38
+
39
+ if($wslist_ProductID){
40
+ $categoryName = Mage::helper('madstack')->getCategoryName($wslist_ProductID);
41
+ $countryName = Mage::helper('madstack')->getCountry();
42
+
43
+ $trackinArray = Mage::helper('madstack')->buildTrackArray('addToWishlist',$wslist_ProductID,$categoryName);
44
+ $trackinArray['prodPrice'] = round(Mage::getModel('catalog/product')->load($wslist_ProductID)->getFinalPrice(),2);
45
+ $trackinArray['country'] = $countryName;
46
+
47
+ Mage::getSingleton('core/session')->unsWhislistProductId();
48
+
49
+ echo Mage::helper('madstack')->trackEvent($trackinArray);
50
+ }
51
+
52
+ ?>
app/design/frontend/base/default/template/madstack/product/slider.phtml ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Apptha
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://www.apptha.com/LICENSE.txt
11
+ *
12
+ * ==============================================================
13
+ * MAGENTO EDITION USAGE NOTICE
14
+ * ==============================================================
15
+ * This package designed for Magento COMMUNITY edition
16
+ * Apptha does not guarantee correct work of this extension
17
+ * on any other Magento edition except Magento COMMUNITY edition.
18
+ * Apptha does not provide extension support in case of
19
+ * incorrect edition usage.
20
+ * ==============================================================
21
+ *
22
+ * @category Apptha
23
+ * @package Apptha_Madstack
24
+ * @version 0.1.0
25
+ * @author Apptha Team <developers@contus.in>
26
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
27
+ * @license http://www.apptha.com/LICENSE.txt
28
+ *
29
+ */
30
+ ?>
31
+ <?php
32
+
33
+ /*
34
+ * Get current product id
35
+ */
36
+ $currentPID = Mage::registry('current_product')->getId();
37
+ $currentCategory = $this->helper('madstack')->getCategoryName($currentPID);
38
+
39
+ $storeStatuscollection = $this->storeStatusCollection(Mage::app()->getStore()->getStoreId());
40
+
41
+ $carouselEnable = $storeStatuscollection->getCarousalEnable();
42
+ $packageLicence = $storeStatuscollection->getLicenseValid();
43
+
44
+ /*
45
+ * Check module status enable/disable
46
+ */
47
+ if(Mage::getStoreConfig('madstack/madstack/activate') && $carouselEnable == 1 && $packageLicence == 1 ){
48
+
49
+ $products = $this->sliderProducts ($data);
50
+ $coreHelper = $this->helper ( 'core' );
51
+ $class = '';
52
+ $carouselWidth = '320px';
53
+ $carouselProductCount = count ( $products );
54
+ if ($carouselProductCount > 0) {
55
+ $baseURL = Mage::getBaseURL();
56
+ ?>
57
+ <h3 class="title-relatedproducts">Related Products</h3>
58
+ <div class="carousel" id="carousel">
59
+ <a href="javascript:" style="<?php if($carouselProductCount < 5){ ?>display:none; <?php }?>" onclick="carouselSwipe('<?php echo $currentPID?>','<?php echo $currentCategory?>','<?php echo $baseURL?>');" class="carousel-control next" rel="next">&rsaquo;</a>
60
+ <a href="javascript:" style="<?php if($carouselProductCount < 5){ ?>display:none; <?php }?>" onclick="carouselSwipe('<?php echo $currentPID?>','<?php echo $currentCategory?>','<?php echo $baseURL?>');" class="carousel-control prev" rel="prev">&lsaquo;</a>
61
+ <div id="middle" class="middle">
62
+ <div id="inner" class="inner" style="width: 2000px;">
63
+ <?php
64
+ $carouselIncrement = 0;
65
+ $countryName = $this->helper('madstack')->getCountry();
66
+ $carouselWidth = $carouselWidth * $carouselProductCount.'px';
67
+ foreach ( $products as $item ) { ?>
68
+ <?php
69
+ $itemId = $item->getId();
70
+
71
+ $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($itemId);
72
+
73
+ if(round($stock->getQty(),2) > 10 && $carouselIncrement < Mage::getStoreConfig('madstack/madstack/count_result')){
74
+
75
+ $originalPrice = $item->getPrice();
76
+ $discountPrice = $item->getFinalPrice();
77
+ $savings = $originalPrice - $discountPrice;
78
+ $savingsPercentage = round ( ($savings / $originalPrice) * 100, 0 );
79
+ $itemCategory = $this->helper('madstack')->getCategoryName($itemId); ?>
80
+
81
+ <?php
82
+ /**
83
+ * Display product image
84
+ */
85
+ ?>
86
+ <div class="prod_detail">
87
+ <a class="product-image" onclick="carouselClick('<?php echo $currentPID?>','<?php echo $currentCategory?>','<?php echo $itemId?>','<?php echo $itemCategory?>','<?php echo $baseURL?>','<?php echo $carouselIncrement?>')" target="_blank" href="<?php echo $item->getProductUrl() ?>"><?php $_imgSize = 260; ?><img src="<?php echo $this->helper('catalog/image')->init($item, 'small_image')->resize($_imgSize); ?>" /></a>
88
+ <h3 class="product-name">
89
+ <a href="<?php echo $item->getProductUrl(); ?>">
90
+ <?php
91
+ $prName = $item->getName();
92
+ $lenPrName = strlen ( $prName );
93
+ $subPrName = substr ( $prName, 0, 23 );
94
+ if ($lenPrName >= 26) {
95
+ $prNameFix = $subPrName . "...";
96
+ } else {
97
+ $prNameFix = $prName;
98
+ }
99
+ echo $prNameFix; ?>
100
+ </a>
101
+ </h3>
102
+ <?php
103
+ /**
104
+ * Display of price details
105
+ */
106
+ ?>
107
+ <div class="product-details">
108
+
109
+ <?php
110
+ $originalPriceFormat = $coreHelper->currency($originalPrice, true, false);
111
+ if($originalPrice > $discountPrice){ ?>
112
+
113
+ <span class="original_price">
114
+ <?php echo $originalPriceFormat; ?>
115
+ </span> <span class="offer_price">
116
+ <?php echo $coreHelper->currency($discountPrice, true, false); ?>
117
+ </span><span class="discount_label">
118
+ <?php echo $this->__('Discount: ') ?>
119
+ </span> <span class="discount_price"
120
+ <?php echo $this->getIdSuffix() ?>>
121
+ <?php echo $savingsPercentage, '%';?>
122
+ <?php echo $this->__ ( 'Off' ); ?>
123
+ </span>
124
+
125
+ <?php }else{ ?>
126
+ <span> <?php echo $originalPriceFormat; ?></span>
127
+ <?php } ?>
128
+ </div>
129
+ <?php
130
+ /**
131
+ * Display Add to cart, add to wishlist and compare
132
+ */
133
+ ?>
134
+ <div class="actions">
135
+ <ul class="add-to-links">
136
+ <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($item) ?>" title="<?php echo $this->__('Add to Wishlist') ?>" class="link-wishlist animated fadeIn <?php echo $class; ?>" onclick="cartOrWishlist('addToWishlistThroughReco','<?php echo $itemId?>','<?php echo $itemCategory?>','<?php echo $countryName?>','<?php echo $discountPrice?>','<?php echo $baseURL?>','<?php echo $carouselIncrement?>');"><?php echo $this->__('Add to Wishlist') ?></a></li>
137
+ <li><a href="<?php $_compareUrl = Mage::helper ( 'catalog/product_compare' )->getAddUrl ( $item ); echo $_compareUrl?>" title="<?php echo $this->__('Add to Compare') ?>" class="link-compare animated fadeIn"><?php echo $this->__('Add to Compare') ?></a></li>
138
+ <li>
139
+ <?php if($item->isSaleable()): ?>
140
+ <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart link-cart" onclick="setLocation('<?php echo Mage::helper('checkout/cart')->getAddUrl($item) ?>'); cartOrWishlist('addToCartThroughReco','<?php echo $itemId?>','<?php echo $itemCategory?>','<?php echo $countryName?>','<?php echo $discountPrice?>','<?php echo $baseURL?>','<?php echo $carouselIncrement?>');">
141
+ <span><span><?php echo $this->__('Add to Cart') ?></span></span>
142
+ </button>
143
+ <?php else: ?>
144
+ <p class="availability out-of-stock">
145
+ <span><?php echo $this->__('Out of stock') ?></span>
146
+ </p>
147
+ <?php endif; ?>
148
+ </li>
149
+ </ul>
150
+ </div>
151
+
152
+ </div>
153
+ <?php
154
+ /**
155
+ * Display of price details
156
+ */
157
+ ?>
158
+ <?php
159
+ $carouselIncrement++;
160
+
161
+ }
162
+ }
163
+
164
+ ?>
165
+ </div>
166
+ </div>
167
+ </div>
168
+
169
+ <script type="text/javascript">
170
+ var fb = document.querySelector(".link-facebook");
171
+ var twitter = document.querySelector(".link-twitter");
172
+ var email = document.querySelector(".link-email-friend");
173
+ var containerWidth = document.getElementById("middle").offsetWidth;
174
+ var imagewidth = document.querySelector(".prod_detail").offsetWidth;
175
+ var estimateSlideCount = (containerWidth)/(imagewidth);
176
+ var roundSlideCount = Math.round(estimateSlideCount);
177
+ var slideCount = (estimateSlideCount < roundSlideCount) ? (((roundSlideCount - estimateSlideCount) < '0.25') ? roundSlideCount : roundSlideCount - 1) : (roundSlideCount);
178
+
179
+ if(fb){
180
+ if(fb.addEventListener){
181
+ fb.addEventListener("click", function(){
182
+ caltrackevent('<?php echo $currentPID ?>','<?php echo $currentCategory?>','<?php echo Mage::getBaseUrl()?>','facebook');
183
+ });
184
+ }else {
185
+ fb.attachEvent("click", function(){
186
+ caltrackevent('<?php echo $currentPID ?>','<?php echo $currentCategory?>','<?php echo Mage::getBaseUrl()?>','facebook');
187
+ });
188
+ }
189
+ }
190
+
191
+ if(twitter){
192
+ if(twitter.addEventListener){
193
+ twitter.addEventListener("click", function(){
194
+ caltrackevent('<?php echo $currentPID ?>','<?php echo $currentCategory?>','<?php echo Mage::getBaseUrl()?>','twitter');
195
+ });
196
+ }else {
197
+ twitter.attachEvent("click", function(){
198
+ caltrackevent('<?php echo $currentPID ?>','<?php echo $currentCategory?>','<?php echo Mage::getBaseUrl()?>','twitter');
199
+ });
200
+ }
201
+ }
202
+
203
+ if(email){
204
+ if(email.addEventListener){
205
+ email.addEventListener("click", function(){
206
+ caltrackevent('<?php echo $currentPID ?>','<?php echo $currentCategory?>','<?php echo Mage::getBaseUrl()?>','email');
207
+ });
208
+ }else {
209
+ email.attachEvent("click", function(){
210
+ caltrackevent('<?php echo $currentPID ?>','<?php echo $currentCategory?>','<?php echo Mage::getBaseUrl()?>','email');
211
+ });
212
+ }
213
+ }
214
+
215
+ document.getElementById("inner").style.width = '<?php echo $carouselWidth;?>';
216
+ new Carousel($('carousel').down('.middle'), $('carousel').down('.inner').select('img'), $('carousel').select('a.carousel-control'), {
217
+ duration: 0.5,
218
+ transition: 'sinoidal',
219
+ circular: true,
220
+ wheel:false,
221
+ visibleSlides:slideCount,
222
+ slideProdCount:slideCount
223
+ });
224
+ </script>
225
+ <?php }
226
+ }
227
+
228
+ /*
229
+ * Track event for view product details(MAD Stack)
230
+ */
231
+ echo $this->viewProduct();
232
+
233
+ ?>
234
+
app/etc/modules/Apptha_Madstack.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Apptha
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://www.apptha.com/LICENSE.txt
12
+ *
13
+ * ==============================================================
14
+ * MAGENTO EDITION USAGE NOTICE
15
+ * ==============================================================
16
+ * This package designed for Magento COMMUNITY edition
17
+ * Apptha does not guarantee correct work of this extension
18
+ * on any other Magento edition except Magento COMMUNITY edition.
19
+ * Apptha does not provide extension support in case of
20
+ * incorrect edition usage.
21
+ * ==============================================================
22
+ *
23
+ * @category Apptha
24
+ * @package Apptha_Madstack
25
+ * @version 0.1.0
26
+ * @author Apptha Team <developers@contus.in>
27
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
28
+ * @license http://www.apptha.com/LICENSE.txt
29
+ *
30
+ */
31
+ -->
32
+ <config>
33
+ <modules>
34
+ <Apptha_Madstack>
35
+ <active>true</active>
36
+ <codePool>local</codePool>
37
+ <version>1.0</version>
38
+ </Apptha_Madstack>
39
+ </modules>
40
+ </config>
app/locale/en_US/Apptha_Madstack.csv ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Activate Madstack,Activate Madstack,
2
+ API call URL,API call URL,
3
+ Log URL ,Log URL,
4
+ Number of result(Carousel),Number of result(Carousel),
5
+ ,,
6
+ ,,
7
+ ,,
8
+ ,,
9
+ ,,
10
+ ,,
11
+ ,,
12
+ ,,
13
+ ,,
14
+ ,,
15
+ ,,
16
+ ,,
17
+ ,,
18
+ ,,
19
+ ,,
20
+ ,,
21
+ ,,
22
+ ,,
23
+ ,,
24
+ ,,
25
+ ,,
26
+ ,,
27
+ ,,
28
+ ,,
29
+ ,,
30
+ ,,
31
+ ,,
32
+ ,,
33
+ ,,
34
+ ,,
35
+ ,,
36
+ ,,
37
+ ,,
38
+ ,,
39
+ ,,
40
+ ,,
41
+ ,,
42
+ ,,
43
+ ,,
44
+ ,,
45
+ ,,
46
+ ,,
47
+ ,,
48
+ ,,
49
+ ,,
50
+ ,,
51
+ ,,
52
+ ,,
53
+ ,,
54
+ ,,
55
+ ,,
56
+ ,,
57
+ ,,
58
+ ,,
59
+ ,,
60
+ ,,
61
+ ,,
62
+ ,,
63
+ ,,
64
+ ,,
65
+ ,,
66
+ ,,
67
+ ,,
68
+ ,,
69
+ ,,
70
+ ,,
71
+ ,,
72
+ ,,
73
+ ,,
74
+ ,,
75
+ ,,
76
+ ,,
77
+ ,,
78
+ ,,
79
+ ,,
80
+ ,,
81
+ ,,
82
+ ,,
83
+ ,,
84
+ ,,
85
+ ,,
86
+ ,,
87
+ ,,
88
+ ,,
89
+ ,,
90
+ ,,
91
+ ,,
92
+ ,,
93
+ ,,
94
+ ,,
95
+ ,,
96
+ ,,
97
+ ,,
98
+ ,,
99
+ ,,
100
+ ,,
101
+ ,,
102
+ ,,
103
+ ,,
104
+ ,,
105
+ ,,
106
+ ,,
107
+ ,,
108
+ ,,
109
+ ,,
110
+ ,,
111
+ ,,
112
+ ,,
113
+ ,,
114
+ ,,
115
+ ,,
116
+ ,,
117
+ ,,
118
+ ,,
119
+ ,,
120
+ ,,
121
+ ,,
122
+ ,,
123
+ ,,
124
+ ,,
125
+ ,,
126
+ ,,
127
+ ,,
128
+ ,,
129
+ ,,
130
+ ,,
131
+ ,,
132
+ ,,
133
+ ,,
134
+ ,,
135
+ ,,
136
+ ,,
137
+ ,,
138
+ ,,
139
+ ,,
140
+ ,,
141
+ ,,
142
+ ,,
143
+ ,,
144
+ ,,
145
+ ,,
146
+ ,,
147
+ ,,
148
+ ,,
149
+ ,,
150
+ ,,
151
+ ,,
152
+ ,,
153
+ ,,
154
+ ,,
155
+ ,,
156
+ ,,
157
+ ,,
158
+ ,,
159
+ ,,
160
+ ,,
161
+ ,,
162
+ ,,
163
+ ,,
164
+ ,,
165
+ ,,
166
+ ,,
167
+ ,,
168
+ ,,
169
+ ,,
170
+ ,,
171
+ ,,
172
+ ,,
173
+ ,,
174
+ ,,
175
+ ,,
176
+ ,,
177
+ ,,
178
+ ,,
179
+ ,,
180
+ ,,
181
+ ,,
182
+ ,,
183
+ ,,
184
+ ,,
185
+ ,,
186
+ ,,
187
+ ,,
188
+ ,,
189
+ ,,
190
+ ,,
191
+ ,,
192
+ ,,
193
+ ,,
194
+ ,,
195
+ ,,
196
+ ,,
197
+ ,,
198
+ ,,
199
+ ,,
200
+ ,,
201
+ ,,
202
+ ,,
203
+ ,,
204
+ ,,
205
+ ,,
206
+ ,,
207
+ ,,
208
+ ,,Product Custom Option
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>vue_ai</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>vue.ai delivers fashion product recommendations based on visual similarity</summary>
10
+ <description>vue.ai delivers fashion product recommendations based on visual similarity</description>
11
+ <notes>vue.ai delivers fashion product recommendations based on visual similarity</notes>
12
+ <authors><author><name>apptha</name><user>apptha</user><email>info@apptha.com</email></author></authors>
13
+ <date>2016-01-19</date>
14
+ <time>12:21:30</time>
15
+ <contents><target name="magelocal"><dir name="Apptha"><dir name="Madstack"><dir name="Block"><dir name="Adminhtml"><dir name="Adminhtml"><dir name="Dashboard"><file name="Grids.php" hash="194669005f16de1b324fbe4e3ac6ca24"/></dir><file name="Madstackiframe.php" hash="b6fc99e8ac90163d152802b5ef1a924f"/></dir><dir name="Dashboard"><file name="Grids.php" hash="194669005f16de1b324fbe4e3ac6ca24"/></dir><file name="Madstackiframe.php" hash="b6fc99e8ac90163d152802b5ef1a924f"/></dir><file name="Madstack.php" hash="fc3b8c9f5af221bd77e1694a0ca5b66d"/></dir><dir name="Helper"><file name="Data.php" hash="15c9dca3312d0d2dd2721255744f9ef3"/></dir><dir name="Model"><file name="Installid.php" hash="69292ea03859e7b8a0ab7adce9b944f2"/><dir name="Mysql4"><dir name="Installid"><file name="Collection.php" hash="232efeba03e77b7c2b0f1989415a70ef"/></dir><file name="Installid.php" hash="014341f9864c280327499b38792e0b9f"/><dir name="Storestatus"><file name="Collection.php" hash="983605021d1cd6338ed10de1a1844268"/></dir><file name="Storestatus.php" hash="1d93626ce3149414ee597d4a2695f411"/></dir><file name="Observer.php" hash="a3fc6610890302d3e6ae69db3f19b0df"/><file name="Storestatus.php" hash="46aa235d355a806d9d815c7353ea27c2"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IframeController.php" hash="3d137e5d851f80a3c0a8b6020640f8dc"/></dir><file name="IndexController.php" hash="27d856d1f7dc32a1151846551f9a4e60"/><file name="RestController.php" hash="8091db1322d382d274b15692b61cdc77"/></dir><dir name="etc"><file name="config.xml" hash="b63a317e6a43d1f66d265ca2e48f1362"/><file name="system.xml" hash="af21d81f789615ecb8f47f638074a908"/></dir><dir name="sql"><dir name="madstack_setup"><file name="mysql4-install-0.1.0.php" hash="b89afb3f52cb7cbfdba40da3680fe217"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Apptha_Madstack.xml" hash="a8d15ee609fad4fb908076f93d331e8b"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="madstack.xml" hash="607d7015e187b2c8bb847c553e413445"/></dir><dir name="template"><dir name="madstack"><dir name="event"><file name="cart.phtml" hash="a34d06f73db963777d6bf5a6159e7898"/><file name="checkout.phtml" hash="129a1d78678a0d19f94102afc5cc272b"/><file name="removeCart.phtml" hash="bbd1384a9c564b157d7457dc7623d794"/><file name="success.phtml" hash="ee1f9389c42d80f78a49b0af924fa0c3"/><file name="wishlist.phtml" hash="a69e2eed4aa303b8148f0e25f5309ae5"/></dir><dir name="product"><file name="slider.phtml" hash="cabc1568b6f596638ccc0a6cdd1507f2"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="madstack"><file name="iframe.phtml" hash="fb4d4db5779a5ca931b8cb397512ef98"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Apptha_Madstack.csv" hash="67873e87104b9db14eb79f57ab43db4f"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="madstack"><file name="ie8.css" hash="e957ec7422b355060c535775e83b0a00"/><file name="madstack.css" hash="a9fb922a43539f875890203a6a8d07f6"/></dir></dir><dir name="js"><dir name="madstack"><dir name="carouselslider"><file name="carousel.js" hash="f5c4d162aa872fa2cbd4121d8faa9019"/><file name="jquery.bxslider.min.js" hash="7658757f3908f59389898e30f4de4067"/></dir><file name="madstack.js" hash="3a6dd8a9d7f324fb2fbdea12aad63a22"/></dir></dir><dir name="images"><dir name="madstack"><file name="icon_sprite.png" hash="0309aa1a7608283e77c3f5efa74b614c"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/frontend/base/default/css/madstack/ie8.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ #carousel .prod_detail .actions .add-to-links li a.link-wishlist,#carousel .prod_detail .actions .add-to-links li a.link-compare,#carousel .prod_detail .actions .link-cart{
2
+ background-color:#000;
3
+ -ms-border-radius: 50%;
4
+ }
skin/frontend/base/default/css/madstack/madstack.css ADDED
@@ -0,0 +1,439 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ outline: none;
5
+ line-height: 14px;
6
+ }
7
+
8
+ body {
9
+ background-color: #FFF;
10
+ font-size: 12px;
11
+ font-family: Verdana, Arial, Sans;
12
+ }
13
+
14
+ h1 {
15
+ font-size: 16px;
16
+ font-weight: bold;
17
+ padding-bottom: 10px;
18
+ }
19
+
20
+ h2 {
21
+ font-size: 12px;
22
+ font-style: italic;
23
+ }
24
+
25
+ h3 {
26
+ font-size: 12px;
27
+ }
28
+
29
+ a {
30
+ color: #0000a8;
31
+ }
32
+
33
+ ul {
34
+ list-style-type: none;
35
+ margin-top: 10px;
36
+ }
37
+ .carousel ul {margin-left:0;}
38
+
39
+ ul li {
40
+ display: inline;
41
+ }
42
+
43
+ #main {
44
+ width: 600px;
45
+ padding: 15px 15px 0 15px;
46
+ margin: 50px auto 0 auto;
47
+ background-color: #E8F0FF;
48
+ border: 1px solid #808ea8;
49
+ }
50
+
51
+ #container {
52
+ border: 1px solid #808ea8;
53
+ }
54
+
55
+ img {
56
+ border: 0;
57
+ }
58
+
59
+ a img {
60
+ display: block;
61
+ }
62
+
63
+ ul.tabs {
64
+ margin: 20px -15px 0 -15px;
65
+ border-bottom: 1px solid #808EA8;
66
+ height: 26px;
67
+ padding: 0 15px;
68
+ }
69
+
70
+ ul.tabs li a {
71
+ float: left;
72
+ height: 25px;
73
+ line-height: 25px;
74
+ padding: 0 10px;
75
+ border: 1px solid #808ea8;
76
+ margin-right: 3px;
77
+ margin-bottom: -1px;
78
+ }
79
+
80
+ ul.tabs li a.carousel-selected {
81
+ background-color: #c2d7ff;
82
+ border-bottom-color: #c2d7ff;
83
+ }
84
+
85
+ div.tabs {
86
+ /* margin: 0 -15px 0 -15px; */
87
+ /* background-color: #c2d7ff; */
88
+ /* height: 310px; */
89
+ overflow: hidden;
90
+ /* border-bottom: 1px solid #808EA8 !important; */
91
+ }
92
+
93
+ div.middle-tabs {
94
+ width: 650px;
95
+ overflow: auto;
96
+ }
97
+
98
+ div.inner-tabs {
99
+ width: 1910px; /* 630*n + 20 */
100
+ height: 330px;
101
+ }
102
+
103
+ div.tab {
104
+ float: left;
105
+ width: 600px;
106
+ height: 280px;
107
+ padding: 15px;
108
+ }
109
+
110
+ div.tab p {
111
+ padding-bottom: 7px;
112
+ line-height: 16px;
113
+ }
114
+
115
+ .carousel {
116
+ overflow: hidden;
117
+ padding: 7px;
118
+ }
119
+
120
+
121
+ .carousel .middle {
122
+ overflow: auto;
123
+ }
124
+
125
+
126
+ /* Example 1 ---------------------------------- */
127
+
128
+ #example-1 {
129
+ background-color: #E8F0FF;
130
+ border: 1px solid #AAC8FF;
131
+ width: 598px;
132
+ height: 223px;
133
+ }
134
+
135
+ #example-1 .middle {
136
+ height: 240px;
137
+ }
138
+
139
+ #example-1 .slide {
140
+ width: 578px;
141
+ /*height: 200px;*/
142
+ padding: 10px;
143
+ float: left;
144
+ }
145
+
146
+ #tab-1 .controls {
147
+ background-color: #AAC8FF;
148
+ border: 1px solid #AAC8FF;
149
+ border-top: 0;
150
+ border-bottom: 0;
151
+ padding: 7px 9px;
152
+ margin-top: 5px;
153
+ }
154
+
155
+ #tab-1 .controls a {
156
+ font-weight: bold;
157
+ }
158
+
159
+ .table-example-1 {
160
+ margin-top: 10px;
161
+ background-color: #AAC8FF;
162
+ width: 100%;
163
+ }
164
+
165
+ .table-example-1 tr th,
166
+ .table-example-1 tr td {
167
+ padding: 5px;
168
+ }
169
+
170
+ .table-example-1 tr td {
171
+ background-color: #FFF;
172
+ }
173
+
174
+
175
+ /* Example 2 ---------------------------------- */
176
+
177
+ #carousel {
178
+ /* width: 100%; */
179
+ margin-top: 15px;
180
+ }
181
+
182
+ #carousel .middle {
183
+ float: left;
184
+ width: 100%;
185
+ overflow-y: hidden;
186
+ overflow-x: hidden;
187
+ padding: 1px;
188
+ height:380px;
189
+ }
190
+
191
+ #carousel .inner img {
192
+ float: left;
193
+ width: 100%;
194
+ }
195
+
196
+ #carousel a { float: left; background-color: #AAC8FF; text-align: center; text-decoration: none; font-size: 36px; line-height: 349px; color:#636363;}
197
+
198
+ #carousel a.next {
199
+ float: right;
200
+ }
201
+
202
+ #carousel a:hover {
203
+ color: #000;
204
+ }
205
+
206
+ #tab-2 ul li {
207
+ display: block;
208
+ padding-bottom: 5px;
209
+ }
210
+
211
+
212
+ /* Example 3 ---------------------------------- */
213
+
214
+ #example-3 {
215
+ background-color: #E8F0FF;
216
+ border: 1px solid #AAC8FF;
217
+ width: 600px;
218
+ height: 223px;
219
+ }
220
+
221
+ #example-3 .middle {
222
+ height: 240px;
223
+ }
224
+
225
+ #example-3 .slide {
226
+ width: 578px;
227
+ height: 200px;
228
+ padding: 10px;
229
+ float: left;
230
+ }
231
+
232
+ #tab-3 .controls {
233
+ background-color: #AAC8FF;
234
+ border: 1px solid #AAC8FF;
235
+ border-top: 0;
236
+ border-bottom: 0;
237
+ padding: 7px 9px;
238
+ margin-top: 5px;
239
+ }
240
+
241
+ #tab-3 .controls a {
242
+ font-weight: bold;
243
+ }
244
+
245
+ .table-example-3 {
246
+ margin-top: 10px;
247
+ background-color: #AAC8FF;
248
+ width: 100%;
249
+ }
250
+
251
+ .table-example-3 tr th,
252
+ .table-example-3 tr td {
253
+ padding: 5px;
254
+ }
255
+
256
+ .table-example-3 tr td {
257
+ background-color: #FFF;
258
+ }
259
+ /* Produc Details Page */
260
+ .title-relatedproducts{ position: relative;
261
+ top: 35px;
262
+ font-size: 24px;}
263
+ /* Carousel Slider CSS */
264
+ #carousel .prod_detail{width: 280px;float:left; transition: all 300ms ease- out; -webkit-transition: all 300ms ease-out; -moz-transition: all 300ms ease-out; -ms-transition: all 300ms ease-out; -0-transition: all 300ms ease-out;/* margin: -5px; */padding: 10px; margin: 0 9px;position: relative;}
265
+ #carousel .prod_detail:hover{/*box-shadow: 0 1px 2px rgba(43,59,93,0.29),0 0 13px rgba(43,59,93,0.29);-webkit-box-shadow: 0 1px 2px rgba (43,59,93,0.29),0 0 13px rgba(43,59,93,0.29);-moz-box-shadow: 0 1px 2px rgba(43,59,93,0.29),0 0 13px rgba(43,59,93,0.29);-ms-box-shadow: 0 1px 2px rgba(43,59,93,0.29),0 0 13px rgba(43,59,93,0.29); -o-box-shadow: 0 1px 2px rgba(43,59,93,0.29),0 0 13px rgba(43,59,93,0.29);*/ border-bottom: 1px solid #ddd; box-shadow: 0 2px 0 0 #ddd !important; -moz-box-shadow: 0 2px 0 0 #ddd; -o-box-shadow: 0 2px 0 0 #ddd; -webkit-box-shadow: 0 2px 0 0 #ddd;}
266
+ #carousel .prod_detail:hover .actions{ visibility: visible !important; transition: all 300ms ease; -webkit-transition: all 300ms ease; -moz-transition: all 300ms ease; -ms-transition: all 300ms ease; -o-transition: all 300ms ease; transform:scale(1);-webkit-transform:scale(1);-moz-transform:scale(1);-ms- transform:scale(1);-0-transform:scale(1); }
267
+ #carousel .prod_detail .actions { z-index:1; visibility:hidden; position: absolute; right: 0;left: 0; text-align: center; width: 110px; height: 40px; top: 0; bottom: 0; margin: auto; transition: all 300ms ease; -webkit-transition: all 300ms ease; -moz-transition: all 300ms ease; -ms-transition: all 300ms ease; -o-transition: all 300ms ease; transform:scale(0);-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);-o-transform:scale (0);}
268
+ .product-view .add-to-links {margin-right:3px !important;}
269
+ #carousel .prod_detail:hover .actions .add-to-links li a.link-compare, #carousel .prod_detail:hover .actions .link-cart, #carousel .prod_detail:hover .actions .add-to-links li a.link-wishlist{transition: all 300ms ease; -webkit-transition: all 300ms ease; -moz-transition: all 300ms ease; -ms-transition: all 300ms ease; -o-transition: all 300ms ease;/* float: left; */}
270
+ #carousel .prod_detail .actions .add-to-links li a.link-compare{ background: url("../../images/madstack/icon_sprite.png") no-repeat; border-radius: 50%; background-position: -28px -462px; background-color: rgba(0,0,0,0.6); text-indent: -9999px; width: 30px; height: 30px;}
271
+ #carousel .prod_detail .actions .link-cart{ background: url("../../images/madstack/icon_sprite.png") no-repeat; border-radius: 50%; background- position: -28px -407px; background-color: rgba(0,0,0,0.6); text-indent: -9999px; width: 30px; height: 30px;background-position: -28px -407px; padding:0; margin-left:0px;}
272
+ #carousel .prod_detail .actions .add-to-links li a {margin-right: 7px !important; padding:0 !important; margin-left:0 !important; border:0;}
273
+ #carousel .prod_detail .add-to-links a {border-right:none !important;}
274
+ #carousel .prod_detail .actions .add-to-links li a.link-wishlist{ background: url("../../images/madstack/icon_sprite.png") no-repeat; border-radius: 50%; background-position: -28px -435px; background-color: rgba(0,0,0,0.6); text-indent: -9999px; width: 30px; height: 30px;}
275
+ #carousel .prod_detail .product-image{border:0px;width:100%}
276
+ #carousel .prod_detail .product-name{display: inline-block;margin: 0;padding-bottom: 10px;font-size: 15px;text-transform:none;}
277
+ #carousel .prod_detail .product-details {padding-bottom:10px;font-size:12px;width: 100%;}
278
+ #carousel .prod_detail .product-details .original_price{text-decoration: line-through;padding-bottom:5px;/* padding: 0 10px; */}
279
+ #carousel .prod_detail .product-details .offer_price{font-weight:bold;color:#222;padding-bottom:5px;}
280
+ #carousel .prod_detail .product-details .discount_label{font-weight:bold;display: none;}
281
+ #carousel .prod_detail .product-details .discount_price{font-weight:bold;color:#6fba54;}
282
+ #carousel a.next:before, #carousel a.next:after, #carousel a.previous:before, #carousel a.previous:after {display:none;}
283
+
284
+ h3.product-name a {
285
+ background: none !important;
286
+ font-size:13px !important;
287
+ clear:both;
288
+ }
289
+
290
+ .prod_detail button.button span {border: 0px !important; background: none !important;}
291
+
292
+ .prod_detail {
293
+ float: left;
294
+ }
295
+
296
+ .product-details {
297
+ }
298
+
299
+ .actions {
300
+ /* float: left; */
301
+ /* clear: both; */
302
+ }
303
+ .product-name a {
304
+ line-height: 34px !important;
305
+ float: left;
306
+ }
307
+ .prod_detail .product-view .add-to-links {margin-right: 0px !important;}
308
+ .carousel .inner { display: table;clear: both;}
309
+
310
+ #carousel .prod_detail:first-child {
311
+ /* margin-left: 23px; */
312
+ }
313
+
314
+ #carousel .prev, #carousel .next { position: relative; width: 40px; height: 40px; font-size: 50px; z-index: 9; left: -2px; text-decoration: none; background-color: rgba(0,0,0,0.5); border-radius: 50%; text-align: center; line-height: 30px; color: #fff; background-color: #333\9; top: 186px !important; padding: 0 !important;}
315
+ #carousel .prod_detail a.next:before, #carousel .prod_detail a.next:after, #carousel .prod_detail a.previous:before, #carousel .prod_detail a.previous:after {display:none;}
316
+
317
+ #carousel .prod_detail .product-details span {
318
+ margin: 0 7px;
319
+ }
320
+
321
+ .product-view .add-to-links li {
322
+ clear: none !important;
323
+ }
324
+ /* Carousel Slider Media Query CSS */
325
+
326
+ /*IPAD view*/
327
+ @media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait){
328
+ #carousel .prod_detail{width: 222px;}
329
+ #carousel .inner img{max-width: 100%;}
330
+ #carousel .carousel-control.next{top:186px !important;}
331
+ #carousel .carousel-control.prev{top:186px !important;}
332
+ #carousel h3.product-name a{font-size:13px;}
333
+ #carousel .prod_detail .product-details span {margin:0 3px;font-size: 11px;}
334
+ h3.product-name a {font-size:12px !important;}
335
+ }
336
+ @media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape){
337
+ #carousel .prod_detail{width: 226px;}
338
+ #carousel .inner img{max-width: 100%;}
339
+ #carousel .carousel-control.next{top:186px !important;}
340
+ #carousel .carousel-control.prev{top:186px !important;}
341
+ #carousel .prod_detail .product-details span {margin:0 3px;font-size: 11px;}
342
+ h3.product-name a {font-size:12px !important;}
343
+
344
+ }
345
+ /*ENDS HERE*/
346
+
347
+ /*IPone 6 */
348
+ @media only screen and (min-width: 360px) and (max-width: 640px) and (orientation: portrait){
349
+ #carousel .prod_detail{width: 280px;margin-left: 27px;text-align: center;}
350
+ #carousel .inner img{max-width: 100%;}
351
+ #carousel .carousel-control.next{top:186px;}
352
+ #carousel .carousel-control.prev{top:186px;}
353
+ #carousel h3.product-name a{font-size: 11px !important;}
354
+ #carousel {width: 89%; margin-top: 15px; margin: 0 auto;}
355
+ #carousel .middle {width:300px;}
356
+ .title-relatedproducts {top:0 !important;}
357
+ }
358
+
359
+ @media only screen and (min-width: 360px) and (max-width: 667px) and (orientation: landscape) {
360
+ #carousel .prod_detail{width: 240px;margin-left: 27px;text-align: center;}
361
+ #carousel .inner img{max-width: 100%;}
362
+ #carousel .carousel-control.next{top:px;}
363
+ #carousel .carousel-control.prev{top:186px;}
364
+ #carousel h3.product-name a{font-size: 12px !important;}
365
+ #carousel {width: 89%; margin-top: 15px; margin: 0 auto;}
366
+ #carousel .prod_detail .product-details span {margin:0 3px;font-size: 11px;}
367
+ #carousel .middle {width:300px;}
368
+ .title-relatedproducts {top:0 !important;}
369
+ }
370
+ /*ENDS HERE*/
371
+
372
+ /*IPone 6 Plus*/
373
+ @media only screen and (min-width: 414px) and (max-width: 736px) and (orientation: portrait){
374
+ #carousel .prod_detail{width: 270px; text-align: center;}
375
+ #carousel .inner img{max-width: 100%;}
376
+ #carousel .carousel-control.next{top:186px;}
377
+ #carousel .carousel-control.prev{top:186px;}
378
+ #carousel h3.product-name a{font-size: 11px !important;}
379
+ #carousel {width: 89%; margin-top: 15px; margin: 0 auto;}
380
+ #carousel .middle {width:300px;}
381
+ .title-relatedproducts {top:0 !important;}
382
+ }
383
+
384
+ @media only screen and (min-width: 414px) and (max-width: 736px) and (orientation: landscape) {
385
+ #carousel .prod_detail{width: 240px;margin-left: 27px;text-align: center;}
386
+ #carousel .inner img{max-width: 100%;}
387
+ #carousel .carousel-control.next{top:px;}
388
+ #carousel .carousel-control.prev{top:186px;}
389
+ #carousel h3.product-name a{font-size: 12px !important;}
390
+ #carousel {width: 89%; margin-top: 15px; margin: 0 auto;}
391
+ #carousel .prod_detail .product-details span {margin:0 3px;font-size: 11px;}
392
+ #carousel .middle {width:500px;}
393
+ .title-relatedproducts {top:0 !important;}
394
+ }
395
+ /*ENDS HERE*/
396
+
397
+ /*IPhone 5 & 5s */
398
+ @media only screen and (min-width: 320px) and (max-width: 568px) and (orientation: landscape){
399
+ #carousel .prod_detail{width: 210px; text-align:center;}
400
+ #carousel .inner img{max-width: 100%;}
401
+ #carousel h3.product-name a{font-size:11px !important;}
402
+ #carousel .carousel-control.next{top:186px !important;}
403
+ #carousel .carousel-control.prev{top:186px !important;}
404
+ #carousel {width: 100%; margin-top: 15px; margin: 0 auto;}
405
+ #carousel .prod_detail .product-details span {margin:0 2px;font-size: 10px;}
406
+ #carousel h3.product-name a{line-height:20px !important}
407
+ .title-relatedproducts {top:0 !important;}
408
+ }
409
+
410
+ @media only screen and (min-width: 320px) and (max-width: 568px) and (orientation: portrait){
411
+ #carousel .prod_detail{width: 280px; text-align:center;}
412
+ #carousel .inner img{max-width: 100%;}
413
+ #carousel h3.product-name a{font-size:13px !important;}
414
+ #carousel .carousel-control.next{top:186px !important;}
415
+ #carousel .carousel-control.prev{top:186px !important;}
416
+ #carousel {width: 100%; margin-top: 15px; margin: 0 auto;}
417
+ #carousel .prod_detail .product-details span {margin:0 2px;font-size: 12px;}
418
+ .title-relatedproducts {top:0 !important;}
419
+ }
420
+ /* ENDS HERE */
421
+
422
+ /*IPhone 4 & 4s */
423
+ @media only screen and (min-width: 320px) and (max-width: 480px){
424
+ #carousel .carousel-control.next{right:0;}
425
+ #carousel .carousel-control.prev{left:0;}
426
+ #carousel .middle {width:280px;}
427
+ .title-relatedproducts {top:0 !important;}
428
+ }
429
+ @media only screen and (min-width: 320px) and (max-width: 480px) and (orientation: landscape){
430
+ #carousel .prod_detail{width: 193px; margin-left: 13px;}
431
+ #carousel .inner img{max-width: 100%;}
432
+ #carousel h3.product-name a{font-size: 11px !important;}
433
+ #carousel .carousel-control.next{top:186px !important;}
434
+ #carousel .carousel-control.prev{top:186px !important;}
435
+ #carousel .prod_detail .product-details span {margin: 0 1px;font-size: 10px;}
436
+ #carousel .middle {width:400px;}
437
+ .title-relatedproducts {top:0 !important;}
438
+ }
439
+ /*ENDS HERE*/
skin/frontend/base/default/images/madstack/icon_sprite.png ADDED
Binary file
skin/frontend/base/default/js/madstack/carouselslider/carousel.js ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Copyright (c) 2009 Victor Stanciu - http://www.victorstanciu.ro
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation
6
+ files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the
10
+ Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
24
+ */
25
+
26
+ /*
27
+ * @category Apptha
28
+ * @package Name Apptha_Madstack
29
+ * @version 0.1.0
30
+ * @version 0.1.0
31
+ * @author Apptha Team <developers@contus.in>
32
+ * @copyright Copyright (c) 2015 Apptha. (http://www.apptha.com)
33
+ * @license http://www.apptha.com/LICENSE.txt
34
+ *
35
+ */
36
+
37
+ Carousel = Class.create(Abstract, {
38
+ initialize: function (scroller, slides, controls, options) {
39
+ this.scrolling = false;
40
+ this.scroller = $(scroller);
41
+ this.slides = slides;
42
+ this.controls = controls;
43
+
44
+ this.options = Object.extend({
45
+ duration: 1,
46
+ auto: false,
47
+ frequency: 3,
48
+ visibleSlides: 1,
49
+ controlClassName: 'carousel-control',
50
+ jumperClassName: 'carousel-jumper',
51
+ disabledClassName: 'carousel-disabled',
52
+ selectedClassName: 'carousel-selected',
53
+ circular: false,
54
+ wheel: true,
55
+ effect: 'scroll',
56
+ transition: 'sinoidal',
57
+ slideProdCount: 1
58
+
59
+ }, options || {});
60
+
61
+ if (this.options.effect == 'fade') {
62
+ this.options.circular = true;
63
+ }
64
+
65
+ this.slides.each(function(slide, index) {
66
+ slide._index = index;
67
+ });
68
+
69
+ if (this.controls) {
70
+ this.controls.invoke('observe', 'click', this.click.bind(this));
71
+ }
72
+
73
+ if (this.options.wheel) {
74
+ this.scroller.observe('mousewheel', this.wheel.bindAsEventListener(this)).observe('DOMMouseScroll', this.wheel.bindAsEventListener(this));;
75
+ }
76
+
77
+ if (this.options.auto) {
78
+ this.start();
79
+ }
80
+
81
+ if (this.options.initial) {
82
+ var initialIndex = this.slides.indexOf($(this.options.initial));
83
+ if (initialIndex > (this.options.visibleSlides - 1) && this.options.visibleSlides > 1) {
84
+ if (initialIndex > this.slides.length - (this.options.visibleSlides + 1)) {
85
+ initialIndex = this.slides.length - this.options.visibleSlides;
86
+ }
87
+ }
88
+ this.moveTo(this.slides[initialIndex]);
89
+ }
90
+ },
91
+
92
+ click: function (event) {
93
+ this.stop();
94
+
95
+ var element = event.findElement('a');
96
+
97
+ if (!element.hasClassName(this.options.disabledClassName)) {
98
+ if (element.hasClassName(this.options.controlClassName)) {
99
+ eval("this." + element.rel + "()");
100
+ } else if (element.hasClassName(this.options.jumperClassName)) {
101
+ this.moveTo(element.rel);
102
+ if (this.options.selectedClassName) {
103
+ this.controls.invoke('removeClassName', this.options.selectedClassName);
104
+ element.addClassName(this.options.selectedClassName);
105
+ }
106
+ }
107
+ }
108
+
109
+ this.deactivateControls();
110
+
111
+ event.stop();
112
+ },
113
+
114
+ moveTo: function (element) {
115
+ if (this.options.beforeMove && (typeof this.options.beforeMove == 'function')) {
116
+ this.options.beforeMove();
117
+ }
118
+
119
+ this.previous = this.current ? this.current : this.slides[0];
120
+ this.current = $(element);
121
+
122
+ var scrollerOffset = this.scroller.cumulativeOffset();
123
+ var elementOffset = this.current.cumulativeOffset();
124
+
125
+ if (this.scrolling) {
126
+ this.scrolling.cancel();
127
+ }
128
+
129
+ switch (this.options.effect) {
130
+ case 'fade':
131
+ this.scrolling = new Effect.Opacity(this.scroller, {
132
+ from: 1.0,
133
+ to: 0,
134
+ duration: this.options.duration,
135
+ afterFinish: (function () {
136
+ this.scroller.scrollLeft = elementOffset[0] - scrollerOffset[0];
137
+ this.scroller.scrollTop = elementOffset[1] - scrollerOffset[1];
138
+
139
+ new Effect.Opacity(this.scroller, {
140
+ from: 0,
141
+ to: 1.0,
142
+ duration: this.options.duration,
143
+ afterFinish: (function () {
144
+ if (this.controls) {
145
+ this.activateControls();
146
+ }
147
+ if (this.options.afterMove && (typeof this.options.afterMove == 'function')) {
148
+ this.options.afterMove();
149
+ }
150
+ }).bind(this)
151
+ });
152
+ }
153
+ ).bind(this)});
154
+ break;
155
+ case 'scroll':
156
+ default:
157
+ var transition;
158
+ switch (this.options.transition) {
159
+ case 'spring':
160
+ transition = Effect.Transitions.spring;
161
+ break;
162
+ case 'sinoidal':
163
+ default:
164
+ transition = Effect.Transitions.sinoidal;
165
+ break;
166
+ }
167
+
168
+ this.scrolling = new Effect.SmoothScroll(this.scroller, {
169
+ duration: this.options.duration,
170
+ x: (elementOffset[0] - scrollerOffset[0]),
171
+ y: (elementOffset[1] - scrollerOffset[1]),
172
+ transition: transition,
173
+ afterFinish: (function () {
174
+ if (this.controls) {
175
+ this.activateControls();
176
+ }
177
+ if (this.options.afterMove && (typeof this.options.afterMove == 'function')) {
178
+ this.options.afterMove();
179
+ }
180
+ this.scrolling = false;
181
+ }).bind(this)});
182
+ break;
183
+ }
184
+
185
+ return false;
186
+ },
187
+
188
+ prev: function () {
189
+ if (this.current) {
190
+ var currentIndex = this.current._index;
191
+ var prevIndex = (currentIndex == 0) ? (this.options.circular ? this.slides.length - this.options.slideProdCount : 0) : currentIndex - this.options.slideProdCount;
192
+ } else {
193
+ var prevIndex = (this.options.circular ? this.slides.length - this.options.slideProdCount : 0);
194
+ }
195
+
196
+ if(prevIndex < 0){
197
+ prevIndex = 0;
198
+ }
199
+
200
+ if (prevIndex == (this.slides.length - 1) && this.options.circular && this.options.effect != 'fade') {
201
+ this.scroller.scrollLeft = (this.slides.length - 1) * this.slides.first().getWidth();
202
+ this.scroller.scrollTop = (this.slides.length - 1) * this.slides.first().getHeight();
203
+ prevIndex = this.slides.length - 2;
204
+ }
205
+
206
+ this.moveTo(this.slides[prevIndex]);
207
+ },
208
+
209
+ next: function () {
210
+ if (this.current) {
211
+ var currentIndex = this.current._index;
212
+ var nextIndex = (this.slides.length - this.options.slideProdCount == currentIndex) ? (this.options.circular ? 0 : currentIndex) : currentIndex + this.options.slideProdCount;
213
+ } else {
214
+ var nextIndex = this.options.slideProdCount;
215
+ }
216
+
217
+ if (nextIndex == 0 && this.options.circular && this.options.effect != 'fade') {
218
+ nextIndex = 0;
219
+ }
220
+
221
+ if (nextIndex > this.slides.length - (this.options.visibleSlides + 1)) {
222
+ nextIndex = this.slides.length - this.options.visibleSlides;
223
+ }
224
+
225
+ this.moveTo(this.slides[nextIndex]);
226
+ },
227
+
228
+ first: function () {
229
+ this.moveTo(this.slides[0]);
230
+ },
231
+
232
+ last: function () {
233
+ this.moveTo(this.slides[this.slides.length - 1]);
234
+ },
235
+
236
+ toggle: function () {
237
+ if (this.previous) {
238
+ this.moveTo(this.slides[this.previous._index]);
239
+ } else {
240
+ return false;
241
+ }
242
+ },
243
+
244
+ stop: function () {
245
+ if (this.timer) {
246
+ clearTimeout(this.timer);
247
+ }
248
+ },
249
+
250
+ start: function () {
251
+ this.periodicallyUpdate();
252
+ },
253
+
254
+ pause: function () {
255
+ this.stop();
256
+ this.activateControls();
257
+ },
258
+
259
+ resume: function (event) {
260
+ if (event) {
261
+ var related = event.relatedTarget || event.toElement;
262
+ if (!related || (!this.slides.include(related) && !this.slides.any(function (slide) { return related.descendantOf(slide); }))) {
263
+ this.start();
264
+ }
265
+ } else {
266
+ this.start();
267
+ }
268
+ },
269
+
270
+ periodicallyUpdate: function () {
271
+ if (this.timer != null) {
272
+ clearTimeout(this.timer);
273
+ this.next();
274
+ }
275
+ this.timer = setTimeout(this.periodicallyUpdate.bind(this), this.options.frequency * 1000);
276
+ },
277
+
278
+ wheel: function (event) {
279
+ event.cancelBubble = true;
280
+ event.stop();
281
+
282
+ var delta = 0;
283
+ if (!event) {
284
+ event = window.event;
285
+ }
286
+ if (event.wheelDelta) {
287
+ delta = event.wheelDelta / 120;
288
+ } else if (event.detail) {
289
+ delta = -event.detail / 3;
290
+ }
291
+
292
+ if (!this.scrolling) {
293
+ this.deactivateControls();
294
+ if (delta > 0) {
295
+ this.prev();
296
+ } else {
297
+ this.next();
298
+ }
299
+ }
300
+
301
+ return Math.round(delta); //Safari Round
302
+ },
303
+
304
+ deactivateControls: function () {
305
+ this.controls.invoke('addClassName', this.options.disabledClassName);
306
+ },
307
+
308
+ activateControls: function () {
309
+ this.controls.invoke('removeClassName', this.options.disabledClassName);
310
+ }
311
+ });
312
+
313
+
314
+ Effect.SmoothScroll = Class.create();
315
+ Object.extend(Object.extend(Effect.SmoothScroll.prototype, Effect.Base.prototype), {
316
+ initialize: function (element) {
317
+ this.element = $(element);
318
+ var options = Object.extend({ x: 0, y: 0, mode: 'absolute' } , arguments[1] || {});
319
+ this.start(options);
320
+ },
321
+
322
+ setup: function () {
323
+ if (this.options.continuous && !this.element._ext) {
324
+ this.element.cleanWhitespace();
325
+ this.element._ext = true;
326
+ this.element.appendChild(this.element.firstChild);
327
+ }
328
+
329
+ this.originalLeft = this.element.scrollLeft;
330
+ this.originalTop = this.element.scrollTop;
331
+
332
+ if (this.options.mode == 'absolute') {
333
+ this.options.x -= this.originalLeft;
334
+ this.options.y -= this.originalTop;
335
+ }
336
+ },
337
+
338
+ update: function (position) {
339
+ this.element.scrollLeft = this.options.x * position + this.originalLeft;
340
+ this.element.scrollTop = this.options.y * position + this.originalTop;
341
+ }
342
+ });
skin/frontend/base/default/js/madstack/carouselslider/jquery.bxslider.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * BxSlider v4.1.2 - Fully loaded, responsive content slider
3
+ * http://bxslider.com
4
+ *
5
+ * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
6
+ * Written while drinking Belgian ales and listening to jazz
7
+ *
8
+ * Released under the MIT license - http://opensource.org/licenses/MIT
9
+ */
10
+ !function(t){var e={},s={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){},onSliderResize:function(){}};t.fn.bxSlider=function(n){if(0==this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var o={},r=this;e.el=this;var a=t(window).width(),l=t(window).height(),d=function(){o.settings=t.extend({},s,n),o.settings.slideWidth=parseInt(o.settings.slideWidth),o.children=r.children(o.settings.slideSelector),o.children.length<o.settings.minSlides&&(o.settings.minSlides=o.children.length),o.children.length<o.settings.maxSlides&&(o.settings.maxSlides=o.children.length),o.settings.randomStart&&(o.settings.startSlide=Math.floor(Math.random()*o.children.length)),o.active={index:o.settings.startSlide},o.carousel=o.settings.minSlides>1||o.settings.maxSlides>1,o.carousel&&(o.settings.preloadImages="all"),o.minThreshold=o.settings.minSlides*o.settings.slideWidth+(o.settings.minSlides-1)*o.settings.slideMargin,o.maxThreshold=o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin,o.working=!1,o.controls={},o.interval=null,o.animProp="vertical"==o.settings.mode?"top":"left",o.usingCSS=o.settings.useCSS&&"fade"!=o.settings.mode&&function(){var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var i in e)if(void 0!==t.style[e[i]])return o.cssPrefix=e[i].replace("Perspective","").toLowerCase(),o.animProp="-"+o.cssPrefix+"-transform",!0;return!1}(),"vertical"==o.settings.mode&&(o.settings.maxSlides=o.settings.minSlides),r.data("origStyle",r.attr("style")),r.children(o.settings.slideSelector).each(function(){t(this).data("origStyle",t(this).attr("style"))}),c()},c=function(){r.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>'),o.viewport=r.parent(),o.loader=t('<div class="bx-loading" />'),o.viewport.prepend(o.loader),r.css({width:"horizontal"==o.settings.mode?100*o.children.length+215+"%":"auto",position:"relative"}),o.usingCSS&&o.settings.easing?r.css("-"+o.cssPrefix+"-transition-timing-function",o.settings.easing):o.settings.easing||(o.settings.easing="swing"),f(),o.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),o.viewport.parent().css({maxWidth:p()}),o.settings.pager||o.viewport.parent().css({margin:"0 auto 0px"}),o.children.css({"float":"horizontal"==o.settings.mode?"left":"none",listStyle:"none",position:"relative"}),o.children.css("width",u()),"horizontal"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginRight",o.settings.slideMargin),"vertical"==o.settings.mode&&o.settings.slideMargin>0&&o.children.css("marginBottom",o.settings.slideMargin),"fade"==o.settings.mode&&(o.children.css({position:"absolute",zIndex:0,display:"none"}),o.children.eq(o.settings.startSlide).css({zIndex:o.settings.slideZIndex,display:"block"})),o.controls.el=t('<div class="bx-controls" />'),o.settings.captions&&P(),o.active.last=o.settings.startSlide==x()-1,o.settings.video&&r.fitVids();var e=o.children.eq(o.settings.startSlide);"all"==o.settings.preloadImages&&(e=o.children),o.settings.ticker?o.settings.pager=!1:(o.settings.pager&&T(),o.settings.controls&&C(),o.settings.auto&&o.settings.autoControls&&E(),(o.settings.controls||o.settings.autoControls||o.settings.pager)&&o.viewport.after(o.controls.el)),g(e,h)},g=function(e,i){var s=e.find("img, iframe").length;if(0==s)return i(),void 0;var n=0;e.find("img, iframe").each(function(){t(this).one("load",function(){++n==s&&i()}).each(function(){this.complete&&t(this).load()})})},h=function(){if(o.settings.infiniteLoop&&"fade"!=o.settings.mode&&!o.settings.ticker){var e="vertical"==o.settings.mode?o.settings.minSlides:o.settings.maxSlides,i=o.children.slice(0,e).clone().addClass("bx-clone"),s=o.children.slice(-e).clone().addClass("bx-clone");r.append(i).prepend(s)}o.loader.remove(),S(),"vertical"==o.settings.mode&&(o.settings.adaptiveHeight=!0),o.viewport.height(v()),r.redrawSlider(),o.settings.onSliderLoad(o.active.index),o.initialized=!0,o.settings.responsive&&t(window).bind("resize",Z),o.settings.auto&&o.settings.autoStart&&H(),o.settings.ticker&&L(),o.settings.pager&&q(o.settings.startSlide),o.settings.controls&&W(),o.settings.touchEnabled&&!o.settings.ticker&&O()},v=function(){var e=0,s=t();if("vertical"==o.settings.mode||o.settings.adaptiveHeight)if(o.carousel){var n=1==o.settings.moveSlides?o.active.index:o.active.index*m();for(s=o.children.eq(n),i=1;i<=o.settings.maxSlides-1;i++)s=n+i>=o.children.length?s.add(o.children.eq(i-1)):s.add(o.children.eq(n+i))}else s=o.children.eq(o.active.index);else s=o.children;return"vertical"==o.settings.mode?(s.each(function(){e+=t(this).outerHeight()}),o.settings.slideMargin>0&&(e+=o.settings.slideMargin*(o.settings.minSlides-1))):e=Math.max.apply(Math,s.map(function(){return t(this).outerHeight(!1)}).get()),e},p=function(){var t="100%";return o.settings.slideWidth>0&&(t="horizontal"==o.settings.mode?o.settings.maxSlides*o.settings.slideWidth+(o.settings.maxSlides-1)*o.settings.slideMargin:o.settings.slideWidth),t},u=function(){var t=o.settings.slideWidth,e=o.viewport.width();return 0==o.settings.slideWidth||o.settings.slideWidth>e&&!o.carousel||"vertical"==o.settings.mode?t=e:o.settings.maxSlides>1&&"horizontal"==o.settings.mode&&(e>o.maxThreshold||e<o.minThreshold&&(t=(e-o.settings.slideMargin*(o.settings.minSlides-1))/o.settings.minSlides)),t},f=function(){var t=1;if("horizontal"==o.settings.mode&&o.settings.slideWidth>0)if(o.viewport.width()<o.minThreshold)t=o.settings.minSlides;else if(o.viewport.width()>o.maxThreshold)t=o.settings.maxSlides;else{var e=o.children.first().width();t=Math.floor(o.viewport.width()/e)}else"vertical"==o.settings.mode&&(t=o.settings.minSlides);return t},x=function(){var t=0;if(o.settings.moveSlides>0)if(o.settings.infiniteLoop)t=o.children.length/m();else for(var e=0,i=0;e<o.children.length;)++t,e=i+f(),i+=o.settings.moveSlides<=f()?o.settings.moveSlides:f();else t=Math.ceil(o.children.length/f());return t},m=function(){return o.settings.moveSlides>0&&o.settings.moveSlides<=f()?o.settings.moveSlides:f()},S=function(){if(o.children.length>o.settings.maxSlides&&o.active.last&&!o.settings.infiniteLoop){if("horizontal"==o.settings.mode){var t=o.children.last(),e=t.position();b(-(e.left-(o.viewport.width()-t.width())),"reset",0)}else if("vertical"==o.settings.mode){var i=o.children.length-o.settings.minSlides,e=o.children.eq(i).position();b(-e.top,"reset",0)}}else{var e=o.children.eq(o.active.index*m()).position();o.active.index==x()-1&&(o.active.last=!0),void 0!=e&&("horizontal"==o.settings.mode?b(-e.left,"reset",0):"vertical"==o.settings.mode&&b(-e.top,"reset",0))}},b=function(t,e,i,s){if(o.usingCSS){var n="vertical"==o.settings.mode?"translate3d(0, "+t+"px, 0)":"translate3d("+t+"px, 0, 0)";r.css("-"+o.cssPrefix+"-transition-duration",i/1e3+"s"),"slide"==e?(r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),D()})):"reset"==e?r.css(o.animProp,n):"ticker"==e&&(r.css("-"+o.cssPrefix+"-transition-timing-function","linear"),r.css(o.animProp,n),r.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),b(s.resetValue,"reset",0),N()}))}else{var a={};a[o.animProp]=t,"slide"==e?r.animate(a,i,o.settings.easing,function(){D()}):"reset"==e?r.css(o.animProp,t):"ticker"==e&&r.animate(a,speed,"linear",function(){b(s.resetValue,"reset",0),N()})}},w=function(){for(var e="",i=x(),s=0;i>s;s++){var n="";o.settings.buildPager&&t.isFunction(o.settings.buildPager)?(n=o.settings.buildPager(s),o.pagerEl.addClass("bx-custom-pager")):(n=s+1,o.pagerEl.addClass("bx-default-pager")),e+='<div class="bx-pager-item"><a href="" data-slide-index="'+s+'" class="bx-pager-link">'+n+"</a></div>"}o.pagerEl.html(e)},T=function(){o.settings.pagerCustom?o.pagerEl=t(o.settings.pagerCustom):(o.pagerEl=t('<div class="bx-pager" />'),o.settings.pagerSelector?t(o.settings.pagerSelector).html(o.pagerEl):o.controls.el.addClass("bx-has-pager").append(o.pagerEl),w()),o.pagerEl.on("click","a",I)},C=function(){o.controls.next=t('<a class="bx-next" href="">'+o.settings.nextText+"</a>"),o.controls.prev=t('<a class="bx-prev" href="">'+o.settings.prevText+"</a>"),o.controls.next.bind("click",y),o.controls.prev.bind("click",z),o.settings.nextSelector&&t(o.settings.nextSelector).append(o.controls.next),o.settings.prevSelector&&t(o.settings.prevSelector).append(o.controls.prev),o.settings.nextSelector||o.settings.prevSelector||(o.controls.directionEl=t('<div class="bx-controls-direction" />'),o.controls.directionEl.append(o.controls.prev).append(o.controls.next),o.controls.el.addClass("bx-has-controls-direction").append(o.controls.directionEl))},E=function(){o.controls.start=t('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+o.settings.startText+"</a></div>"),o.controls.stop=t('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+o.settings.stopText+"</a></div>"),o.controls.autoEl=t('<div class="bx-controls-auto" />'),o.controls.autoEl.on("click",".bx-start",k),o.controls.autoEl.on("click",".bx-stop",M),o.settings.autoControlsCombine?o.controls.autoEl.append(o.controls.start):o.controls.autoEl.append(o.controls.start).append(o.controls.stop),o.settings.autoControlsSelector?t(o.settings.autoControlsSelector).html(o.controls.autoEl):o.controls.el.addClass("bx-has-controls-auto").append(o.controls.autoEl),A(o.settings.autoStart?"stop":"start")},P=function(){o.children.each(function(){var e=t(this).find("img:first").attr("title");void 0!=e&&(""+e).length&&t(this).append('<div class="bx-caption"><span>'+e+"</span></div>")})},y=function(t){o.settings.auto&&r.stopAuto(),r.goToNextSlide(),t.preventDefault()},z=function(t){o.settings.auto&&r.stopAuto(),r.goToPrevSlide(),t.preventDefault()},k=function(t){r.startAuto(),t.preventDefault()},M=function(t){r.stopAuto(),t.preventDefault()},I=function(e){o.settings.auto&&r.stopAuto();var i=t(e.currentTarget),s=parseInt(i.attr("data-slide-index"));s!=o.active.index&&r.goToSlide(s),e.preventDefault()},q=function(e){var i=o.children.length;return"short"==o.settings.pagerType?(o.settings.maxSlides>1&&(i=Math.ceil(o.children.length/o.settings.maxSlides)),o.pagerEl.html(e+1+o.settings.pagerShortSeparator+i),void 0):(o.pagerEl.find("a").removeClass("active"),o.pagerEl.each(function(i,s){t(s).find("a").eq(e).addClass("active")}),void 0)},D=function(){if(o.settings.infiniteLoop){var t="";0==o.active.index?t=o.children.eq(0).position():o.active.index==x()-1&&o.carousel?t=o.children.eq((x()-1)*m()).position():o.active.index==o.children.length-1&&(t=o.children.eq(o.children.length-1).position()),t&&("horizontal"==o.settings.mode?b(-t.left,"reset",0):"vertical"==o.settings.mode&&b(-t.top,"reset",0))}o.working=!1,o.settings.onSlideAfter(o.children.eq(o.active.index),o.oldIndex,o.active.index)},A=function(t){o.settings.autoControlsCombine?o.controls.autoEl.html(o.controls[t]):(o.controls.autoEl.find("a").removeClass("active"),o.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},W=function(){1==x()?(o.controls.prev.addClass("disabled"),o.controls.next.addClass("disabled")):!o.settings.infiniteLoop&&o.settings.hideControlOnEnd&&(0==o.active.index?(o.controls.prev.addClass("disabled"),o.controls.next.removeClass("disabled")):o.active.index==x()-1?(o.controls.next.addClass("disabled"),o.controls.prev.removeClass("disabled")):(o.controls.prev.removeClass("disabled"),o.controls.next.removeClass("disabled")))},H=function(){o.settings.autoDelay>0?setTimeout(r.startAuto,o.settings.autoDelay):r.startAuto(),o.settings.autoHover&&r.hover(function(){o.interval&&(r.stopAuto(!0),o.autoPaused=!0)},function(){o.autoPaused&&(r.startAuto(!0),o.autoPaused=null)})},L=function(){var e=0;if("next"==o.settings.autoDirection)r.append(o.children.clone().addClass("bx-clone"));else{r.prepend(o.children.clone().addClass("bx-clone"));var i=o.children.first().position();e="horizontal"==o.settings.mode?-i.left:-i.top}b(e,"reset",0),o.settings.pager=!1,o.settings.controls=!1,o.settings.autoControls=!1,o.settings.tickerHover&&!o.usingCSS&&o.viewport.hover(function(){r.stop()},function(){var e=0;o.children.each(function(){e+="horizontal"==o.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)});var i=o.settings.speed/e,s="horizontal"==o.settings.mode?"left":"top",n=i*(e-Math.abs(parseInt(r.css(s))));N(n)}),N()},N=function(t){speed=t?t:o.settings.speed;var e={left:0,top:0},i={left:0,top:0};"next"==o.settings.autoDirection?e=r.find(".bx-clone").first().position():i=o.children.first().position();var s="horizontal"==o.settings.mode?-e.left:-e.top,n="horizontal"==o.settings.mode?-i.left:-i.top,a={resetValue:n};b(s,"ticker",speed,a)},O=function(){o.touch={start:{x:0,y:0},end:{x:0,y:0}},o.viewport.bind("touchstart",X)},X=function(t){if(o.working)t.preventDefault();else{o.touch.originalPos=r.position();var e=t.originalEvent;o.touch.start.x=e.changedTouches[0].pageX,o.touch.start.y=e.changedTouches[0].pageY,o.viewport.bind("touchmove",Y),o.viewport.bind("touchend",V)}},Y=function(t){var e=t.originalEvent,i=Math.abs(e.changedTouches[0].pageX-o.touch.start.x),s=Math.abs(e.changedTouches[0].pageY-o.touch.start.y);if(3*i>s&&o.settings.preventDefaultSwipeX?t.preventDefault():3*s>i&&o.settings.preventDefaultSwipeY&&t.preventDefault(),"fade"!=o.settings.mode&&o.settings.oneToOneTouch){var n=0;if("horizontal"==o.settings.mode){var r=e.changedTouches[0].pageX-o.touch.start.x;n=o.touch.originalPos.left+r}else{var r=e.changedTouches[0].pageY-o.touch.start.y;n=o.touch.originalPos.top+r}b(n,"reset",0)}},V=function(t){o.viewport.unbind("touchmove",Y);var e=t.originalEvent,i=0;if(o.touch.end.x=e.changedTouches[0].pageX,o.touch.end.y=e.changedTouches[0].pageY,"fade"==o.settings.mode){var s=Math.abs(o.touch.start.x-o.touch.end.x);s>=o.settings.swipeThreshold&&(o.touch.start.x>o.touch.end.x?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto())}else{var s=0;"horizontal"==o.settings.mode?(s=o.touch.end.x-o.touch.start.x,i=o.touch.originalPos.left):(s=o.touch.end.y-o.touch.start.y,i=o.touch.originalPos.top),!o.settings.infiniteLoop&&(0==o.active.index&&s>0||o.active.last&&0>s)?b(i,"reset",200):Math.abs(s)>=o.settings.swipeThreshold?(0>s?r.goToNextSlide():r.goToPrevSlide(),r.stopAuto()):b(i,"reset",200)}o.viewport.unbind("touchend",V)},Z=function(){var e=t(window).width(),i=t(window).height();(a!=e||l!=i)&&(a=e,l=i,r.redrawSlider(),o.settings.onSliderResize.call(r,o.active.index))};return r.goToSlide=function(e,i){if(!o.working&&o.active.index!=e)if(o.working=!0,o.oldIndex=o.active.index,o.active.index=0>e?x()-1:e>=x()?0:e,o.settings.onSlideBefore(o.children.eq(o.active.index),o.oldIndex,o.active.index),"next"==i?o.settings.onSlideNext(o.children.eq(o.active.index),o.oldIndex,o.active.index):"prev"==i&&o.settings.onSlidePrev(o.children.eq(o.active.index),o.oldIndex,o.active.index),o.active.last=o.active.index>=x()-1,o.settings.pager&&q(o.active.index),o.settings.controls&&W(),"fade"==o.settings.mode)o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed),o.children.filter(":visible").fadeOut(o.settings.speed).css({zIndex:0}),o.children.eq(o.active.index).css("zIndex",o.settings.slideZIndex+1).fadeIn(o.settings.speed,function(){t(this).css("zIndex",o.settings.slideZIndex),D()});else{o.settings.adaptiveHeight&&o.viewport.height()!=v()&&o.viewport.animate({height:v()},o.settings.adaptiveHeightSpeed);var s=0,n={left:0,top:0};if(!o.settings.infiniteLoop&&o.carousel&&o.active.last)if("horizontal"==o.settings.mode){var a=o.children.eq(o.children.length-1);n=a.position(),s=o.viewport.width()-a.outerWidth()}else{var l=o.children.length-o.settings.minSlides;n=o.children.eq(l).position()}else if(o.carousel&&o.active.last&&"prev"==i){var d=1==o.settings.moveSlides?o.settings.maxSlides-m():(x()-1)*m()-(o.children.length-o.settings.maxSlides),a=r.children(".bx-clone").eq(d);n=a.position()}else if("next"==i&&0==o.active.index)n=r.find("> .bx-clone").eq(o.settings.maxSlides).position(),o.active.last=!1;else if(e>=0){var c=e*m();n=o.children.eq(c).position()}if("undefined"!=typeof n){var g="horizontal"==o.settings.mode?-(n.left-s):-n.top;b(g,"slide",o.settings.speed)}}},r.goToNextSlide=function(){if(o.settings.infiniteLoop||!o.active.last){var t=parseInt(o.active.index)+1;r.goToSlide(t,"next")}},r.goToPrevSlide=function(){if(o.settings.infiniteLoop||0!=o.active.index){var t=parseInt(o.active.index)-1;r.goToSlide(t,"prev")}},r.startAuto=function(t){o.interval||(o.interval=setInterval(function(){"next"==o.settings.autoDirection?r.goToNextSlide():r.goToPrevSlide()},o.settings.pause),o.settings.autoControls&&1!=t&&A("stop"))},r.stopAuto=function(t){o.interval&&(clearInterval(o.interval),o.interval=null,o.settings.autoControls&&1!=t&&A("start"))},r.getCurrentSlide=function(){return o.active.index},r.getCurrentSlideElement=function(){return o.children.eq(o.active.index)},r.getSlideCount=function(){return o.children.length},r.redrawSlider=function(){o.children.add(r.find(".bx-clone")).outerWidth(u()),o.viewport.css("height",v()),o.settings.ticker||S(),o.active.last&&(o.active.index=x()-1),o.active.index>=x()&&(o.active.last=!0),o.settings.pager&&!o.settings.pagerCustom&&(w(),q(o.active.index))},r.destroySlider=function(){o.initialized&&(o.initialized=!1,t(".bx-clone",this).remove(),o.children.each(function(){void 0!=t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!=t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),o.controls.el&&o.controls.el.remove(),o.controls.next&&o.controls.next.remove(),o.controls.prev&&o.controls.prev.remove(),o.pagerEl&&o.settings.controls&&o.pagerEl.remove(),t(".bx-caption",this).remove(),o.controls.autoEl&&o.controls.autoEl.remove(),clearInterval(o.interval),o.settings.responsive&&t(window).unbind("resize",Z))},r.reloadSlider=function(t){void 0!=t&&(n=t),r.destroySlider(),d()},d(),this}}(jQuery);
skin/frontend/base/default/js/madstack/madstack.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var track_parameter = {};
2
+ function commonTrackFun(PID,category,baseURL,event){
3
+
4
+ track_parameter['event'] = event;
5
+ track_parameter['sourceProdID'] = PID;
6
+ track_parameter['sourceCatgID'] = category;
7
+ track_parameter['vendor'] = baseURL;
8
+
9
+ return track_parameter;
10
+ }
11
+
12
+ function caltrackevent(PID,category,baseURL,media_name){
13
+
14
+ commonTrackFun(PID,category,baseURL,'socialShare');
15
+ track_parameter['socialMedium'] = media_name;
16
+
17
+ return track(track_parameter);
18
+ }
19
+
20
+ function carouselSwipe(PID,category,baseURL){
21
+ commonTrackFun(PID,category,baseURL,'carouselSwipe');
22
+ return track(track_parameter);
23
+ }
24
+
25
+ function carouselClick(sorcePID,sourceCategory,clickPID,clickCategory,baseURL,posOfRecord){
26
+
27
+ commonTrackFun(sorcePID,sourceCategory,baseURL,'carouselClick');
28
+ track_parameter['destProdID'] = clickPID;
29
+ track_parameter['destCatgID'] = clickCategory;
30
+ track_parameter['posOfReco'] = posOfRecord;
31
+
32
+ return track(track_parameter);
33
+ }
34
+
35
+ function cartOrWishlist(event,PID,category,country,productPrice,baseURL,posOfRecord){
36
+ commonTrackFun(PID,category,baseURL,event);
37
+ track_parameter['country'] = country;
38
+ track_parameter['prodPrice'] = productPrice;
39
+ track_parameter['posOfReco'] = posOfRecord;
40
+
41
+ return track(track_parameter);
42
+
43
+ }