LetsSyncroLLC_Oct8ne - Version 1.1.9

Version Notes

Notes

Download this release

Release Info

Developer Oct8ne
Extension LetsSyncroLLC_Oct8ne
Version 1.1.9
Comparing to
See all releases


Code changes from version 1.1.5 to 1.1.9

Files changed (24) hide show
  1. app/code/community/LetsSyncroLLC/Oct8ne/Block/Accountconfig.php +16 -2
  2. app/code/community/LetsSyncroLLC/Oct8ne/Block/Mage/Product/View.php +12 -0
  3. app/code/community/LetsSyncroLLC/Oct8ne/Helper/Data.php +171 -125
  4. app/code/community/LetsSyncroLLC/Oct8ne/Helper/Url.php +8 -2
  5. app/code/community/LetsSyncroLLC/Oct8ne/Model/Mage/Package.php +83 -0
  6. app/code/community/LetsSyncroLLC/Oct8ne/Model/Mage/Request.php +38 -0
  7. app/code/community/LetsSyncroLLC/Oct8ne/Model/Mage/Rewrite.php +19 -0
  8. app/code/community/LetsSyncroLLC/Oct8ne/Model/Mysql4/Quoteproducts.php +8 -0
  9. app/code/community/LetsSyncroLLC/Oct8ne/Model/Mysql4/Quoteproducts/Collection.php +9 -0
  10. app/code/community/LetsSyncroLLC/Oct8ne/Model/Observer.php +191 -125
  11. app/code/community/LetsSyncroLLC/Oct8ne/Model/Quoteproducts.php +9 -0
  12. app/code/community/LetsSyncroLLC/Oct8ne/controllers/AccountController.php +131 -122
  13. app/code/community/LetsSyncroLLC/Oct8ne/controllers/FrameController.php +829 -679
  14. app/code/community/LetsSyncroLLC/Oct8ne/etc/config.xml +263 -229
  15. app/code/community/LetsSyncroLLC/Oct8ne/sql/oct8ne_setup/mysql4-upgrade-1.1.6-1.1.7.php +37 -0
  16. app/design/frontend/base/default/layout/oct8ne.xml +223 -240
  17. app/design/frontend/base/default/template/oct8ne/frame/getreportdata.phtml +1 -0
  18. app/design/frontend/base/default/template/oct8ne/frame/json-page.phtml +1 -1
  19. app/design/frontend/base/default/template/oct8ne/frame/productrelated.phtml +49 -52
  20. app/design/frontend/base/default/template/oct8ne/letssyncro.phtml +7 -2
  21. app/design/frontend/default/oct8ne/layout/oct8ne.xml +246 -0
  22. app/etc/modules/LetsSyncroLLC_Oct8ne.xml +1 -1
  23. package.xml +28 -3
  24. skin/frontend/base/default/oct8ne.css +28 -0
app/code/community/LetsSyncroLLC/Oct8ne/Block/Accountconfig.php CHANGED
@@ -223,6 +223,12 @@ class LetsSyncroLLC_Oct8ne_Block_Accountconfig extends Mage_Core_Block_Template
223
 
224
  if($letssyncro_enabled == '1' && ($letssyncro_licenseid == '' || strlen($letssyncro_licenseid) != 32))
225
  return false;
 
 
 
 
 
 
226
 
227
  return $letssyncromodel->setEnabled($letssyncro_enabled);
228
  }
@@ -317,7 +323,7 @@ class LetsSyncroLLC_Oct8ne_Block_Accountconfig extends Mage_Core_Block_Template
317
  return $response;
318
  }
319
 
320
- public function createXML_Logon($letssyncro_useremail, $letssyncro_password)
321
  {
322
  $DOM = new DOMDocument('1.0','UTF-8');
323
  $XML = $DOM->createElement('User');
@@ -333,6 +339,9 @@ class LetsSyncroLLC_Oct8ne_Block_Accountconfig extends Mage_Core_Block_Template
333
  // $currency = $DOM->createElement('CheckoutUrl', Mage::helper('checkout/url')->getCheckoutUrl());
334
  $platform = $DOM->createElement('Platform', 'MAGENTO');
335
  $domain = $DOM->createElement('UrlDomain', str_replace("index.php/", "", Mage::getBaseUrl()));
 
 
 
336
 
337
  $XML->appendChild($baseurl);
338
  $XML->appendChild($checkouturl);
@@ -341,8 +350,13 @@ class LetsSyncroLLC_Oct8ne_Block_Accountconfig extends Mage_Core_Block_Template
341
  $XML->appendChild($loginurl);
342
  $XML->appendChild($Pass);
343
  $XML->appendChild($platform);
344
- $XML->appendChild($domain);
 
 
345
 
 
 
 
346
  return $DOM->saveXML($DOM->documentElement);
347
  }
348
 
223
 
224
  if($letssyncro_enabled == '1' && ($letssyncro_licenseid == '' || strlen($letssyncro_licenseid) != 32))
225
  return false;
226
+
227
+ $letssyncro_useremail = $letssyncrooptions['email'];
228
+ $letssyncro_password = $letssyncrooptions['password'];
229
+
230
+ $xmlData = $this->createXML_Logon($letssyncro_useremail, $letssyncro_password, $letssyncro_enabled ? 1: 0);
231
+ $this->sendRequest($xmlData, 'logon', $letssyncrooptions['urlapi']);
232
 
233
  return $letssyncromodel->setEnabled($letssyncro_enabled);
234
  }
323
  return $response;
324
  }
325
 
326
+ public function createXML_Logon($letssyncro_useremail, $letssyncro_password, $status_platform = null)
327
  {
328
  $DOM = new DOMDocument('1.0','UTF-8');
329
  $XML = $DOM->createElement('User');
339
  // $currency = $DOM->createElement('CheckoutUrl', Mage::helper('checkout/url')->getCheckoutUrl());
340
  $platform = $DOM->createElement('Platform', 'MAGENTO');
341
  $domain = $DOM->createElement('UrlDomain', str_replace("index.php/", "", Mage::getBaseUrl()));
342
+
343
+ if(!is_null($status_platform))
344
+ $StatusPlatform = $DOM->createElement('StatusPlatform', $status_platform);
345
 
346
  $XML->appendChild($baseurl);
347
  $XML->appendChild($checkouturl);
350
  $XML->appendChild($loginurl);
351
  $XML->appendChild($Pass);
352
  $XML->appendChild($platform);
353
+
354
+ if(!is_null($status_platform))
355
+ $XML->appendChild($StatusPlatform);
356
 
357
+
358
+ $XML->appendChild($domain);
359
+
360
  return $DOM->saveXML($DOM->documentElement);
361
  }
362
 
app/code/community/LetsSyncroLLC/Oct8ne/Block/Mage/Product/View.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class LetsSyncroLLC_Oct8ne_Block_Mage_Product_View extends Mage_Catalog_Block_Product_View
3
+ {
4
+ public function getAddToCartUrl($product, $additional = array())
5
+ {
6
+ if(Mage::registry('oct8ne') === 1)
7
+ {
8
+ return Mage::helper('oct8ne/url')->getAdd2CartUrl( $product );
9
+ }
10
+ return parent::getAddToCartUrl($product, $additional);
11
+ }
12
+ }
app/code/community/LetsSyncroLLC/Oct8ne/Helper/Data.php CHANGED
@@ -1,125 +1,171 @@
1
- <?php
2
- class LetsSyncroLLC_Oct8ne_Helper_Data extends Mage_Core_Helper_Abstract {
3
-
4
- static public function getProductFullUrl( $product ) {
5
- $categories = $product->getCategoryIds();
6
- $category = Mage::getModel('catalog/category')->load( $categories[0] );
7
- //$url = Mage::getUrl( $category->getUrlPath() ).basename( $product->getProductUrl() );
8
- $url = Mage::getUrl( basename( $product->getProductUrl() ) );
9
- return $url;
10
- }
11
-
12
- static public function getProductImagesUrl( $product ) {
13
- $v = array();
14
- $gallery_data = $product->getData( 'media_gallery' );
15
- foreach( $gallery_data['images'] as $image )
16
- $v[] = array(
17
- 'url' => Mage::getBaseUrl('media').'catalog/product'.$image['file']
18
- );
19
-
20
- return $v;
21
- }
22
-
23
- static protected $_productThumbnail = array();
24
- static public function getProductThumbnail($product, $width = null)
25
- {
26
- $id = $product->getId();
27
- if (array_key_exists($id, self::$_productThumbnail)) {
28
- return self::$_productThumbnail[$id];
29
- }
30
- $thumb = Mage::helper('catalog/image')->init($product, 'thumbnail');
31
-
32
- if(!is_null($width))
33
- $thumb->resize($width);
34
-
35
- $file = (string)$thumb;
36
-
37
- self::$_productThumbnail[$id] = $file;
38
-
39
- return $file;
40
- }
41
-
42
- static public function getProductInfo($product_id, $qty = null)
43
- {
44
- $product = Mage::getModel('catalog/product')->load( $product_id );
45
- // $description = str_replace( array("\r\n", "\n", "\r"), "\\n", htmlentities ($product->getDescription()) );
46
- $description = htmlspecialchars($product->getDescription(), ENT_QUOTES, "UTF-8");
47
- $description = trim($description, "\r\n\t ");
48
- $description = str_replace("\r", "", $description);
49
- $description = str_replace("\t", "", $description);
50
- $description = str_replace("\n", "<br/>", $description);
51
- $tmp = is_null($qty) ? array() : array('qty' => $qty);
52
- return array_merge($tmp, array(
53
- 'id' => $product->getId(),
54
- 'title' => htmlspecialchars($product->getName(), ENT_QUOTES, "UTF-8"), // htmlentities( $product->getName() ),
55
- // 'price' => sprintf( "%.02f$currency", is_numeric($product->getSpecialPrice()) ? $product->getSpecialPrice() : $product->getPrice() ),
56
- //'price' => Mage::helper('core')->currency(number_format($product->getFinalPrice(), '2', '.', ',')),
57
- 'original_price' => number_format(
58
- Mage::helper('core')->currency( $product->getPrice(), false, false ),
59
- '2', '.', ','
60
- ),
61
- 'price' => number_format( Mage::helper('core')->currency($product->getFinalPrice(), false, false), '2', '.', ',' ),
62
- 'description' => $description,
63
- 'url' => Mage::helper('oct8ne')->getProductFullUrl( $product ),
64
- 'imgs' => Mage::helper('oct8ne')->getProductImagesUrl( $product ),
65
- 'thumbnail' => Mage::helper('oct8ne')->getProductThumbnail( $product, 120 ),
66
- 'rating' => self::getProductRating($product_id)
67
- ));
68
- }
69
-
70
- static public function getProductRating($productId)
71
- {
72
- // Obtener la colección de reviews
73
- $reviews = Mage::getModel('review/review')
74
- ->getResourceCollection()
75
- ->addStoreFilter(Mage::app()->getStore()->getId())
76
- ->addEntityFilter('product', $productId)
77
- ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
78
- ->setDateOrder()
79
- ->addRateVotes();
80
- // Calcular la media de ratings/reviews
81
- $avg = 0;
82
- $ratings = array();
83
- if (count($reviews) > 0) {
84
- foreach ($reviews->getItems() as $review) {
85
- foreach( $review->getRatingVotes() as $vote ) {
86
- $ratings[] = $vote->getPercent();
87
- }
88
- }
89
- $avg = array_sum($ratings)/count($ratings);
90
- }
91
- else
92
- {
93
- return 'no-rating';
94
- }
95
- return $avg;
96
- }
97
-
98
- static public function getRelatedProducts($productId)
99
- {
100
- // obtener categorias del producto $productId
101
- $product = Mage::getModel('catalog/product')->load($productId);
102
- $cats = $product->getCategoryIds();
103
-
104
- // buscar todos los productos de las categorias obtenidas
105
- $productsInfo = array();
106
- $productIds = array();
107
- foreach ($cats as $category_id) {
108
- $cat = Mage::getModel('catalog/category')->load($category_id) ;
109
- //get all products in this category
110
- foreach ($cat->getProductCollection() as $product){
111
- if(!in_array($product->getId(), $productIds)){
112
- $productIds[$product->getId()] = $product->getId();
113
- $productsInfo[] = self::getProductInfo($product->getId());
114
- }
115
- }
116
- }
117
-
118
- // retornar array de getProductInfo();
119
- return $productsInfo;
120
- }
121
-
122
- public function getExtensionVersion() {
123
- return (string) Mage::getConfig()->getNode()->modules->LetsSyncroLLC_Oct8ne->version;
124
- }
125
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class LetsSyncroLLC_Oct8ne_Helper_Data extends Mage_Core_Helper_Abstract {
3
+
4
+ static public function getProductFullUrl( $product ) {
5
+ $categories = $product->getCategoryIds();
6
+ $category = Mage::getModel('catalog/category')->load( $categories[0] );
7
+ //$url = Mage::getUrl( $category->getUrlPath() ).basename( $product->getProductUrl() );
8
+ $url = Mage::getUrl( basename( $product->getProductUrl() ) );
9
+ return $url;
10
+ }
11
+
12
+ static public function getProductImagesUrl( $product ) {
13
+ $v = array();
14
+ $gallery_data = $product->getData( 'media_gallery' );
15
+
16
+ // $url = parse_url(self::_remove_http(Mage::getUrl('oct8ne/frame/image'));
17
+ // $url['query']['file'] = 'catalog/product'.$image['file'];
18
+ $url = Mage::getUrl('oct8ne/frame/image');
19
+ $join = (strstr($url, "?") === FALSE) ? '?' : '&';
20
+
21
+ foreach( $gallery_data['images'] as $image )
22
+ {
23
+ $file = $image['file'];
24
+ if(strpos($file, '/') !== 0)
25
+ $file = "/$file";
26
+
27
+ $v[] = array(
28
+ // 'url' => Mage::getBaseUrl('media').'catalog/product'.$image['file']
29
+ // 'url' => Mage::getUrl('oct8ne/frame/image', array('file' => 'catalog/product'.$image['file']))
30
+ 'url' => self::_remove_http($url) . $join . 'file=catalog/product' . $file
31
+ );
32
+ }
33
+
34
+ return $v;
35
+ }
36
+
37
+ static protected $_productThumbnail = array();
38
+ static public function getProductThumbnail($product, $width = null)
39
+ {
40
+ $id = $product->getId();
41
+ if (array_key_exists($id, self::$_productThumbnail)) {
42
+ return self::$_productThumbnail[$id];
43
+ }
44
+ $thumb = Mage::helper('catalog/image')->init($product, 'thumbnail');
45
+
46
+ if(!is_null($width))
47
+ $thumb->resize($width);
48
+
49
+ $file = (string)$thumb;
50
+
51
+ self::$_productThumbnail[$id] = $file;
52
+
53
+ return $file;
54
+ }
55
+
56
+ static public function getProductInfo($product_id, $qty = null)
57
+ {
58
+ $product = Mage::getModel('catalog/product')->load( $product_id );
59
+ // $description = str_replace( array("\r\n", "\n", "\r"), "\\n", htmlentities ($product->getDescription()) );
60
+ $description = htmlspecialchars($product->getDescription(), ENT_QUOTES, "UTF-8");
61
+ $description = trim($description, "\r\n\t ");
62
+ $description = str_replace("\r", "", $description);
63
+ $description = str_replace("\t", "", $description);
64
+ $description = str_replace("\n", "<br/>", $description);
65
+ $tmp = is_null($qty) ? array() : array('qty' => $qty);
66
+ return array_merge($tmp, array(
67
+ 'id' => $product->getId(),
68
+ 'title' => htmlspecialchars($product->getName(), ENT_QUOTES, "UTF-8"), // htmlentities( $product->getName() ),
69
+ // 'price' => sprintf( "%.02f$currency", is_numeric($product->getSpecialPrice()) ? $product->getSpecialPrice() : $product->getPrice() ),
70
+ //'price' => Mage::helper('core')->currency(number_format($product->getFinalPrice(), '2', '.', ',')),
71
+ 'original_price' => number_format(
72
+ Mage::helper('core')->currency( $product->getPrice(), false, false ),
73
+ '2', '.', ','
74
+ ),
75
+ 'price' => number_format( Mage::helper('core')->currency($product->getFinalPrice(), false, false), '2', '.', ',' ),
76
+ 'description' => $description,
77
+ 'url' => self::_remove_http(Mage::helper('oct8ne')->getProductFullUrl( $product )),
78
+ 'imgs' => Mage::helper('oct8ne')->getProductImagesUrl( $product ),
79
+ 'thumbnail' => self::_remove_http(Mage::helper('oct8ne')->getProductThumbnail( $product, 120 )),
80
+ 'rating' => self::getProductRating($product_id)
81
+ ));
82
+ }
83
+
84
+ static public function getProductRating($productId)
85
+ {
86
+ // Obtener la colección de reviews
87
+ $reviews = Mage::getModel('review/review')
88
+ ->getResourceCollection()
89
+ ->addStoreFilter(Mage::app()->getStore()->getId())
90
+ ->addEntityFilter('product', $productId)
91
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
92
+ ->setDateOrder()
93
+ ->addRateVotes();
94
+ // Calcular la media de ratings/reviews
95
+ $avg = 0;
96
+ $ratings = array();
97
+ if (count($reviews) > 0) {
98
+ foreach ($reviews->getItems() as $review) {
99
+ foreach( $review->getRatingVotes() as $vote ) {
100
+ $ratings[] = $vote->getPercent();
101
+ }
102
+ }
103
+ $avg = array_sum($ratings)/count($ratings);
104
+ }
105
+ else
106
+ {
107
+ return 'no-rating';
108
+ }
109
+ return $avg;
110
+ }
111
+
112
+ static public function getRelatedProducts($productId)
113
+ {
114
+ $start = Mage::registry("oct8ne_product_related_start");
115
+ $items = Mage::registry("oct8ne_product_related_num_items");
116
+
117
+ if($start < 0) $start = 0;
118
+ if($items < 1) $items = 1;
119
+
120
+ // obtener categorias del producto $productId
121
+ $product = Mage::getModel('catalog/product')->load($productId);
122
+ $cats = $product->getCategoryIds();
123
+
124
+ // buscar todos los productos de las categorias obtenidas
125
+ $productsInfo = array();
126
+ $productIds = array();
127
+ foreach ($cats as $category_id) {
128
+ $cat = Mage::getModel('catalog/category')->load($category_id) ;
129
+
130
+ $collection = $cat->getProductCollection();
131
+ $collection->addAttributeToFilter('visibility', 4);
132
+
133
+
134
+ //get all products in this category
135
+ $current = 0;
136
+ foreach ($collection as $product){
137
+ if($current > $start + $items)
138
+ return $productsInfo; // ya hemos terminado
139
+ if(!in_array($product->getId(), $productIds) && $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED){
140
+ if($current >= $start)
141
+ {
142
+ $productIds[$product->getId()] = $product->getId();
143
+ $productsInfo[] = self::getProductInfo($product->getId());
144
+ }
145
+ $current++;
146
+ }
147
+ }
148
+ }
149
+
150
+ // retornar array de getProductInfo();
151
+ return $productsInfo;
152
+ }
153
+
154
+ public function getExtensionVersion() {
155
+ return (string) Mage::getConfig()->getNode()->modules->LetsSyncroLLC_Oct8ne->version;
156
+ }
157
+
158
+ protected function _remove_http($str)
159
+ {
160
+ return preg_replace('#^https?:#', '', $str);
161
+ }
162
+
163
+ /*
164
+ static public function getOrderReport($from, $to)
165
+ {
166
+ // obtener categorias del producto $productId
167
+ $items = Mage::getModel('oct8ne/orderproducts')->getCollection();
168
+ return $productsInfo;
169
+ }
170
+ */
171
+ };
app/code/community/LetsSyncroLLC/Oct8ne/Helper/Url.php CHANGED
@@ -18,9 +18,15 @@
18
  }
19
 
20
 
21
- return
22
- $this->_getUrl( 'oct8ne/frame/add2cart', $route_params );
 
23
  }
 
 
 
 
 
24
 
25
  };
26
 
18
  }
19
 
20
 
21
+ return $this->_remove_http(
22
+ $this->_getUrl( 'oct8ne/frame/add2cart', $route_params )
23
+ );
24
  }
25
+
26
+ protected function _remove_http($str)
27
+ {
28
+ return preg_replace('#^https?:#', '', $str);
29
+ }
30
 
31
  };
32
 
app/code/community/LetsSyncroLLC/Oct8ne/Model/Mage/Package.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
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://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Core
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class LetsSyncroLLC_Oct8ne_Model_Mage_Package extends Mage_Core_Model_Design_Package
29
+ {
30
+ /**
31
+ * Declare design package theme params
32
+ * Polymorph method:
33
+ * 1) if 1 parameter specified, sets everything to this value
34
+ * 2) if 2 parameters, treats 1st as key and 2nd as value
35
+ *
36
+ * @return Mage_Core_Model_Design_Package
37
+ */
38
+ public function setTheme()
39
+ {
40
+ if(Mage::registry('oct8ne') === 1)
41
+ return $this;
42
+
43
+ switch (func_num_args()) {
44
+ case 1:
45
+ foreach (array('layout', 'template', 'skin', 'locale') as $type) {
46
+ $this->_theme[$type] = func_get_arg(0);
47
+ }
48
+ break;
49
+
50
+ case 2:
51
+ $this->_theme[func_get_arg(0)] = func_get_arg(1);
52
+ break;
53
+
54
+ default:
55
+ throw Mage::exception(Mage::helper('core')->__('Wrong number of arguments for %s', __METHOD__));
56
+ }
57
+ return $this;
58
+ }
59
+
60
+ /**
61
+ * Set package name
62
+ * In case of any problem, the default will be set.
63
+ *
64
+ * @param string $name
65
+ * @return Mage_Core_Model_Design_Package
66
+ */
67
+ public function setPackageName($name = '')
68
+ {
69
+ if(Mage::registry('oct8ne') === 1)
70
+ return $this;
71
+
72
+ return parent::setPackageName($name);
73
+ }
74
+
75
+
76
+ public function getFallbackTheme()
77
+ {
78
+ if(Mage::registry('oct8ne') === 1 && Mage::registry('oct8ne_defaultpackage') !== 1)
79
+ return '';
80
+
81
+ return parent::getFallbackTheme();
82
+ }
83
+ }
app/code/community/LetsSyncroLLC/Oct8ne/Model/Mage/Request.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class LetsSyncroLLC_Oct8ne_Model_Mage_Request extends Mage_Core_Model_Url_Rewrite_Request
3
+ {
4
+ /**
5
+ * Add location header and disable browser page caching
6
+ *
7
+ * @param string $url
8
+ * @param bool $isPermanent
9
+ */
10
+ /*
11
+ protected function _sendRedirectHeaders($url, $isPermanent = false)
12
+ {
13
+ / *
14
+ if ($isPermanent) {
15
+ header('HTTP/1.1 301 Moved Permanently');
16
+ }
17
+
18
+ header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
19
+ header('Pragma: no-cache');
20
+ header('Location: ' . $url);
21
+ exit;
22
+ * /
23
+
24
+ if(Mage::registry('oct8ne_rewrite') === 1)
25
+ return false;
26
+
27
+ return parent::_sendRedirectHeaders($url, $isPermanent);
28
+ }
29
+ */
30
+
31
+ public function rewrite(Zend_Controller_Request_Http $request=null, Zend_Controller_Response_Http $response=null)
32
+ {
33
+ if(Mage::registry('oct8ne_rewrite') === 1)
34
+ return false;
35
+
36
+ return parent::rewrite($request, $response);
37
+ }
38
+ }
app/code/community/LetsSyncroLLC/Oct8ne/Model/Mage/Rewrite.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class LetsSyncroLLC_Oct8ne_Model_Mage_Rewrite extends Mage_Core_Model_Url_Rewrite
4
+ {
5
+ /**
6
+ * Implement logic of custom rewrites
7
+ *
8
+ * @param Zend_Controller_Request_Http $request
9
+ * @param Zend_Controller_Response_Http $response
10
+ * @return Mage_Core_Model_Url
11
+ */
12
+ public function rewrite(Zend_Controller_Request_Http $request=null, Zend_Controller_Response_Http $response=null)
13
+ {
14
+ if(Mage::registry('oct8ne_rewrite') === 1)
15
+ return false;
16
+
17
+ return parent::rewrite($request, $response);
18
+ }
19
+ }
app/code/community/LetsSyncroLLC/Oct8ne/Model/Mysql4/Quoteproducts.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class LetsSyncroLLC_Oct8ne_Model_Mysql4_Quoteproducts extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('oct8ne/quoteproducts', 'quoteproducts_id');
7
+ }
8
+ }
app/code/community/LetsSyncroLLC/Oct8ne/Model/Mysql4/Quoteproducts/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class LetsSyncroLLC_Oct8ne_Model_Mysql4_Quoteproducts_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ //parent::__construct();
7
+ $this->_init('oct8ne/quoteproducts');
8
+ }
9
+ }
app/code/community/LetsSyncroLLC/Oct8ne/Model/Observer.php CHANGED
@@ -1,125 +1,191 @@
1
- <?php
2
-
3
- class LetsSyncroLLC_Oct8ne_Model_Observer
4
- {
5
- public function interceptMethod($observer)
6
- {
7
- $request = $observer->getEvent()->getData('front')->getRequest();
8
-
9
- if(isset($request->oct8ne))
10
- {
11
- $package = Mage::getStoreConfig('design/oct8nedesign/package');
12
- $theme = Mage::getStoreConfig('design/oct8nedesign/theme');
13
-
14
- if(empty($package))
15
- $package = "default";
16
-
17
- if(empty($theme))
18
- $theme = "oct8ne";
19
-
20
- Mage::getDesign()->setPackageName($package);
21
- Mage::getDesign()->setTheme($theme);
22
- Mage::register('oct8ne', 1);
23
- // Mage::getModel('core/url')->setRouteParam('oct8ne', 1);
24
- }
25
- }
26
-
27
- public function layoutRenderBefore($observer)
28
- {
29
- $session = Mage::getSingleton('core/session');
30
- $logged_in = $session->getData("notify_oct8ne", null);
31
- if(!is_null($logged_in))
32
- {
33
- $customer = Mage::getSingleton('customer/session')->getCustomer();
34
-
35
- $session->unsetData("notify_oct8ne");
36
- $layout = Mage::getSingleton('core/layout');
37
-
38
- $head = $layout->getBlock('root')->getChild('head');
39
- if (is_object($head)) {
40
- $head->addItem("script", "oct8ne-notify", <<<EOT
41
- function lookForOct8neIFrameLoaded() {
42
- var iframe = document.getElementById( 'oct8ne-iframe-return' );
43
- if ( iframe == null )
44
- setTimeout( 'lookForOct8neIFrameLoaded()', 500 );
45
- else {
46
- var post_data = {
47
- user: {
48
- id: {$customer->getId()},
49
- firstName: "{$customer->getFirstname()}",
50
- lastName: "{$customer->getLastname()}",
51
- email: "{$customer->getEmail()}"
52
- }
53
- };
54
- iframe.contentWindow.postMessage( JSON.stringify(post_data), '*' );
55
- }
56
- };
57
- lookForOct8neIFrameLoaded();
58
- EOT
59
- );
60
-
61
- }
62
- }
63
-
64
- $logged_out = $session->getData("notify_oct8ne_logout", null);
65
- if(!is_null($logged_out))
66
- {
67
- // $customer = Mage::getSingleton('customer/session')->getCustomer();
68
-
69
- $session->unsetData("notify_oct8ne_logout");
70
- $layout = Mage::getSingleton('core/layout');
71
-
72
- $head = $layout->getBlock('root')->getChild('head');
73
- if (is_object($head)) {
74
- $head->addItem("script", "oct8ne-notify", <<<EOT
75
- function lookForOct8neIFrameLoaded() {
76
- var iframe = document.getElementById( 'oct8ne-iframe-return' );
77
- if ( iframe == null )
78
- setTimeout( 'lookForOct8neIFrameLoaded()', 500 );
79
- else
80
- iframe.contentWindow.postMessage( 'logout', '*' );
81
- }
82
- lookForOct8neIFrameLoaded();
83
- EOT
84
- );
85
-
86
- }
87
- }
88
- }
89
-
90
- /**
91
- * Get checkout session model instance
92
- *
93
- * @return Mage_Checkout_Model_Session
94
- */
95
- protected function _getSession() { return Mage::getSingleton('checkout/session'); }
96
-
97
- public function placeOrderBefore($observer)
98
- {
99
- $order = $observer->getEvent()->getOrder();
100
- $oct8ne_products = $this->_getSession()->getOct8neProducts();
101
- if(!is_array($oct8ne_products))
102
- $oct8ne_products = array();
103
-
104
- $items = $order->getAllItems();
105
- foreach($items as $item)
106
- {
107
- $product = $item->getProduct();
108
- /*
109
- foreach($oct8ne_products as $op)
110
- {
111
- $found = false;
112
- if($op->getId() == $product->getId())
113
- $found = true;
114
- }
115
- */
116
- $found = in_array($product->getId(), $oct8ne_products);
117
-
118
- $model = Mage::getModel('oct8ne/orderproducts');
119
- $model->setOrderId($order->getId());
120
- $model->setProductId($product->getId());
121
- $model->setOct8ne($found?'Y':'N');
122
- $model->save();
123
- }
124
- }
125
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class LetsSyncroLLC_Oct8ne_Model_Observer
4
+ {
5
+ public function interceptMethod($observer)
6
+ {
7
+ $request = $observer->getEvent()->getData('front')->getRequest();
8
+
9
+ if(isset($request->oct8ne))
10
+ {
11
+ $theme = Mage::getStoreConfig('design/oct8nedesign/theme');
12
+
13
+ if($request->oct8ne != 'defaultpackage')
14
+ {
15
+ $package = Mage::getStoreConfig('design/oct8nedesign/package');
16
+ if(empty($package))
17
+ $package = "default";
18
+ } else {
19
+ Mage::register('oct8ne_defaultpackage', 1);
20
+ }
21
+
22
+ if(empty($theme))
23
+ $theme = "oct8ne";
24
+
25
+ // $th = Mage::getDesign()->getFallbackTheme();
26
+ Mage::getDesign()->setPackageName($package);
27
+ Mage::getDesign()->setTheme($theme);
28
+ Mage::register('oct8ne', 1);
29
+ // Mage::getModel('core/url')->setRouteParam('oct8ne', 1);
30
+ }
31
+
32
+ if(strpos($request->getPathInfo(), '/oct8ne/frame') !== FALSE)
33
+ {
34
+ Mage::register('oct8ne_rewrite', 1); // lo usamos para deshabilitar el redirect
35
+ }
36
+ }
37
+
38
+ public function layoutRenderBefore($observer)
39
+ {
40
+ $session = Mage::getSingleton('core/session');
41
+ $logged_in = $session->getData("notify_oct8ne", null);
42
+ if(!is_null($logged_in))
43
+ {
44
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
45
+
46
+ $session->unsetData("notify_oct8ne");
47
+ $layout = Mage::getSingleton('core/layout');
48
+
49
+ $head = $layout->getBlock('root')->getChild('head');
50
+ if (is_object($head)) {
51
+ $head->addItem("script", "oct8ne-notify", <<<EOT
52
+ function lookForOct8neIFrameLoaded() {
53
+ var iframe = document.getElementById( 'oct8ne-iframe-return' );
54
+ if ( iframe == null )
55
+ setTimeout( 'lookForOct8neIFrameLoaded()', 500 );
56
+ else {
57
+ var post_data = {
58
+ user: {
59
+ id: {$customer->getId()},
60
+ firstName: "{$customer->getFirstname()}",
61
+ lastName: "{$customer->getLastname()}",
62
+ email: "{$customer->getEmail()}"
63
+ }
64
+ };
65
+ iframe.contentWindow.postMessage( JSON.stringify(post_data), '*' );
66
+ }
67
+ };
68
+ lookForOct8neIFrameLoaded();
69
+ EOT
70
+ );
71
+
72
+ }
73
+ }
74
+
75
+ $logged_out = $session->getData("notify_oct8ne_logout", null);
76
+ if(!is_null($logged_out))
77
+ {
78
+ // $customer = Mage::getSingleton('customer/session')->getCustomer();
79
+
80
+ $session->unsetData("notify_oct8ne_logout");
81
+ $layout = Mage::getSingleton('core/layout');
82
+
83
+ $head = $layout->getBlock('root')->getChild('head');
84
+ if (is_object($head)) {
85
+ $head->addItem("script", "oct8ne-notify", <<<EOT
86
+ function lookForOct8neIFrameLoaded() {
87
+ var iframe = document.getElementById( 'oct8ne-iframe-return' );
88
+ if ( iframe == null )
89
+ setTimeout( 'lookForOct8neIFrameLoaded()', 500 );
90
+ else
91
+ iframe.contentWindow.postMessage( 'logout', '*' );
92
+ }
93
+ lookForOct8neIFrameLoaded();
94
+ EOT
95
+ );
96
+
97
+ }
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Get checkout session model instance
103
+ *
104
+ * @return Mage_Checkout_Model_Session
105
+ */
106
+ protected function _getSession() { return Mage::getSingleton('checkout/session'); }
107
+
108
+ public function placeOrderBefore($observer)
109
+ {
110
+ $order = $observer->getEvent()->getOrder();
111
+ $oct8ne_products = $this->_getSession()->getOct8neProducts();
112
+ if(!is_array($oct8ne_products))
113
+ $oct8ne_products = array();
114
+
115
+ $items = $order->getAllItems();
116
+ foreach($items as $item)
117
+ {
118
+ $product = $item->getProduct();
119
+ $qty = $item->getQtyOrdered();
120
+ /*
121
+ foreach($oct8ne_products as $op)
122
+ {
123
+ $found = false;
124
+ if($op->getId() == $product->getId())
125
+ $found = true;
126
+ }
127
+ */
128
+ $found = in_array($product->getId(), $oct8ne_products);
129
+ $session = Mage::getModel('core/cookie')->get('oct8ne-session');
130
+
131
+ $model = Mage::getModel('oct8ne/orderproducts');
132
+ $model->setOrderId($order->getId());
133
+ $model->setCustomerId($order->getCustomerId());
134
+ $model->setProductId($product->getId());
135
+ $model->setProductPrice($product->getPrice());
136
+ $model->setOrderPrice($order->getGrandTotal());
137
+ $model->setCreatedAt($order->getCreatedAt());
138
+ // $model->setOct8ne($found?'Y':'N');
139
+ $model->setOct8ne($session);
140
+ $model->setQty($qty);
141
+ $model->setCurrency($order->getOrderCurrency()->getCode());
142
+ $model->save();
143
+ }
144
+ }
145
+
146
+ public function saveQuoteAfter($observer)
147
+ {
148
+ $quote = $observer->getEvent()->getQuote();
149
+ // Eliminar los datos anteriores
150
+ foreach (Mage::getModel('oct8ne/quoteproducts')->getCollection()->addFilter('quote_id', $quote->getId()) as $ccitem) {
151
+ $ccitem->delete();
152
+ }
153
+
154
+ // Añadir los nuevos
155
+ $items = $quote->getAllItems();
156
+ foreach($items as $item)
157
+ {
158
+ $product = $item->getProduct();
159
+ $qty = $item->getQty();
160
+
161
+ $session = Mage::getModel('core/cookie')->get('oct8ne-session');
162
+
163
+ $model = Mage::getModel('oct8ne/quoteproducts');
164
+ $model->setQuoteId($quote->getId());
165
+ $model->setCustomerId($quote->getCustomerId());
166
+ $model->setProductId($product->getId());
167
+ $model->setProductPrice($product->getPrice());
168
+ $model->setQuotePrice($quote->getGrandTotal());
169
+ $model->setCreatedAt($quote->getCreatedAt());
170
+ $model->setOct8ne($session);
171
+ $model->setQty($qty);
172
+ $model->setCurrency($quote->getQuoteCurrencyCode());
173
+ $model->save();
174
+
175
+ // echo $order->getOrderCurrency()->getCode(); /* $item['oct8ne']; */
176
+ }
177
+ }
178
+
179
+ public function checkDomainPolicyHeader($observer)
180
+ {
181
+ if(Mage::registry('oct8ne') === 1 || Mage::registry('oct8ne_rewrite') === 1)
182
+ {
183
+ $action = $observer->getControllerAction();
184
+
185
+ $response = $action->getResponse();
186
+ $response->setHeader('X-Frame-Options', null, true);
187
+ }
188
+
189
+ return $this;
190
+ }
191
+ }
app/code/community/LetsSyncroLLC/Oct8ne/Model/Quoteproducts.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class LetsSyncroLLC_Oct8ne_Model_Quoteproducts extends Mage_Core_Model_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ parent::_construct();
7
+ $this->_init('oct8ne/quoteproducts');
8
+ }
9
+ }
app/code/community/LetsSyncroLLC/Oct8ne/controllers/AccountController.php CHANGED
@@ -1,122 +1,131 @@
1
- <?php
2
- require_once(Mage::getModuleDir('controllers','Mage_Customer').DS.'AccountController.php');
3
- class LetsSyncroLLC_Oct8ne_AccountController extends Mage_Customer_AccountController
4
- {
5
- /**
6
- * Define target URL and redirect customer after logging in
7
- */
8
- protected function _loginPostRedirect()
9
- {
10
- if(!is_null(Mage::registry('oct8ne')))
11
- {
12
- /*
13
- // die("login!!!");
14
-
15
- */
16
- if(Mage::getSingleton('customer/session')->isLoggedIn())
17
- {
18
- echo <<< EOT
19
- <h2 class="add2cart-msg">Logged in</h2>
20
-
21
- <script type="text/javascript">
22
- parent.postMessage("loginOK", "*");
23
- </script>
24
- EOT;
25
- die();
26
- }
27
-
28
- // en caso de que no se haga login
29
- $this->loadLayout();
30
- $this->renderLayout();
31
- }
32
- else
33
- {
34
- if(Mage::getSingleton('customer/session')->isLoggedIn()) {
35
-
36
- $session = Mage::getSingleton('core/session');
37
- $customerData = Mage::getSingleton('customer/session')->getCustomer();
38
- $url = $session->getBeforeAuthUrl();
39
- // if(substr($url, -24) == '/checkout/onepage/index/') <<------------------ activar esto para notificar sólamente en el checkout
40
- //Mage::register("notify_oct8ne", $customerData->getId());
41
- $session->setData("notify_oct8ne", $customerData->getId());
42
- }
43
-
44
-
45
- parent::_loginPostRedirect();
46
- }
47
- }
48
-
49
- /**
50
- * Add welcome message and send new account email.
51
- * Returns success URL
52
- *
53
- * @param Mage_Customer_Model_Customer $customer
54
- * @param bool $isJustConfirmed
55
- * @return string
56
- */
57
- protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
58
- {
59
- if(!is_null(Mage::registry('oct8ne')))
60
- {
61
- /*
62
- // die("login!!!");
63
-
64
- */
65
- if(Mage::getSingleton('customer/session')->isLoggedIn())
66
- {
67
- echo <<< EOT
68
- <h2 class="add2cart-msg">Logged in</h2>
69
-
70
- <script type="text/javascript">
71
- parent.postMessage("loginOK", "*");
72
- </script>
73
- EOT;
74
- die();
75
- }
76
-
77
- }
78
- else
79
- {
80
- if(Mage::getSingleton('customer/session')->isLoggedIn()) {
81
-
82
- $session = Mage::getSingleton('core/session');
83
- $customerData = Mage::getSingleton('customer/session')->getCustomer();
84
- $url = $session->getBeforeAuthUrl();
85
- // if(substr($url, -24) == '/checkout/onepage/index/') <<------------------ activar esto para notificar sólamente en el checkout
86
- //Mage::register("notify_oct8ne", $customerData->getId());
87
- $session->setData("notify_oct8ne", $customerData->getId());
88
- }
89
-
90
-
91
- // ent::_loginPostRedirect();
92
-
93
- }
94
-
95
- return parent::_welcomeCustomer($customer, $isJustConfirmed);
96
- }
97
-
98
- /**
99
- * Customer logout action
100
- */
101
- /*
102
- public function logoutAction()
103
- {
104
- $session = Mage::getSingleton('core/session');
105
- $customerData = Mage::getSingleton('customer/session')->getCustomer();
106
- $session->setData("notify_oct8ne_logout", $customerData->getId());
107
- parent::logoutAction();
108
- }
109
- */
110
-
111
- /**
112
- * Logout success page
113
- */
114
- public function logoutSuccessAction()
115
- {
116
- $session = Mage::getSingleton('core/session');
117
- $session->setData("notify_oct8ne_logout", TRUE);
118
- parent::logoutSuccessAction();
119
- // $this->loadLayout();
120
- // $this->renderLayout();
121
- }
122
- }
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(Mage::getModuleDir('controllers','Mage_Customer').DS.'AccountController.php');
3
+ class LetsSyncroLLC_Oct8ne_AccountController extends Mage_Customer_AccountController
4
+ {
5
+ /**
6
+ * Define target URL and redirect customer after logging in
7
+ */
8
+ protected function _loginPostRedirect()
9
+ {
10
+ if(!is_null(Mage::registry('oct8ne')))
11
+ {
12
+ /*
13
+ // die("login!!!");
14
+
15
+ */
16
+ if(Mage::getSingleton('customer/session')->isLoggedIn())
17
+ {
18
+ echo <<< EOT
19
+ <h2 class="add2cart-msg">Logged in</h2>
20
+
21
+ <script type="text/javascript">
22
+ parent.postMessage("loginOK", "*");
23
+ </script>
24
+ EOT;
25
+ die();
26
+ } else {
27
+ echo <<< EOT
28
+ <h2 class="add2cart-msg">Login failed</h2>
29
+
30
+ <script type="text/javascript">
31
+ parent.postMessage("loginFAIL", "*");
32
+ </script>
33
+ EOT;
34
+ die();
35
+ }
36
+
37
+ // en caso de que no se haga login
38
+ $this->loadLayout();
39
+ $this->renderLayout();
40
+ }
41
+ else
42
+ {
43
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
44
+
45
+ $session = Mage::getSingleton('core/session');
46
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
47
+ $url = $session->getBeforeAuthUrl();
48
+ // if(substr($url, -24) == '/checkout/onepage/index/') <<------------------ activar esto para notificar sólamente en el checkout
49
+ //Mage::register("notify_oct8ne", $customerData->getId());
50
+ $session->setData("notify_oct8ne", $customerData->getId());
51
+ }
52
+
53
+
54
+ parent::_loginPostRedirect();
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Add welcome message and send new account email.
60
+ * Returns success URL
61
+ *
62
+ * @param Mage_Customer_Model_Customer $customer
63
+ * @param bool $isJustConfirmed
64
+ * @return string
65
+ */
66
+ protected function _welcomeCustomer(Mage_Customer_Model_Customer $customer, $isJustConfirmed = false)
67
+ {
68
+ if(!is_null(Mage::registry('oct8ne')))
69
+ {
70
+ /*
71
+ // die("login!!!");
72
+
73
+ */
74
+ if(Mage::getSingleton('customer/session')->isLoggedIn())
75
+ {
76
+ echo <<< EOT
77
+ <h2 class="add2cart-msg">Logged in</h2>
78
+
79
+ <script type="text/javascript">
80
+ parent.postMessage("loginOK", "*");
81
+ </script>
82
+ EOT;
83
+ die();
84
+ }
85
+
86
+ }
87
+ else
88
+ {
89
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
90
+
91
+ $session = Mage::getSingleton('core/session');
92
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
93
+ $url = $session->getBeforeAuthUrl();
94
+ // if(substr($url, -24) == '/checkout/onepage/index/') <<------------------ activar esto para notificar sólamente en el checkout
95
+ //Mage::register("notify_oct8ne", $customerData->getId());
96
+ $session->setData("notify_oct8ne", $customerData->getId());
97
+ }
98
+
99
+
100
+ // ent::_loginPostRedirect();
101
+
102
+ }
103
+
104
+ return parent::_welcomeCustomer($customer, $isJustConfirmed);
105
+ }
106
+
107
+ /**
108
+ * Customer logout action
109
+ */
110
+ /*
111
+ public function logoutAction()
112
+ {
113
+ $session = Mage::getSingleton('core/session');
114
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
115
+ $session->setData("notify_oct8ne_logout", $customerData->getId());
116
+ parent::logoutAction();
117
+ }
118
+ */
119
+
120
+ /**
121
+ * Logout success page
122
+ */
123
+ public function logoutSuccessAction()
124
+ {
125
+ $session = Mage::getSingleton('core/session');
126
+ $session->setData("notify_oct8ne_logout", TRUE);
127
+ parent::logoutSuccessAction();
128
+ // $this->loadLayout();
129
+ // $this->renderLayout();
130
+ }
131
+ }
app/code/community/LetsSyncroLLC/Oct8ne/controllers/FrameController.php CHANGED
@@ -1,679 +1,829 @@
1
- <?php
2
-
3
- class LetsSyncroLLC_Oct8ne_FrameController extends Mage_Core_Controller_Front_Action {
4
-
5
- public function indexAction() {
6
- $this->loadLayout();
7
- $this->renderLayout();
8
- }
9
-
10
- public function customerdataAction() {
11
- $callback = $this->getRequest()->getParam('callback', null);
12
- Mage::register( 'callback', $callback );
13
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
14
- $this->loadLayout();
15
- $this->renderLayout();
16
- }
17
-
18
- public function productviewAction() {
19
- // Get initial data from request
20
- $categoryId = (int) $this->getRequest()->getParam('category', false);
21
- $productId = (int) $this->getRequest()->getParam('id');
22
- $specifyOptions = $this->getRequest()->getParam('options');
23
-
24
- // Prepare helper and params
25
- $viewHelper = Mage::helper('catalog/product_view');
26
-
27
- $params = new Varien_Object();
28
- $params->setCategoryId($categoryId);
29
- $params->setSpecifyOptions($specifyOptions);
30
-
31
- // Render page
32
- try {
33
- $viewHelper->prepareAndRender($productId, $this, $params);
34
- } catch (Exception $e) {
35
- if ($e->getCode() == $viewHelper->ERR_NO_PRODUCT_LOADED) {
36
- if (isset($_GET['store']) && !$this->getResponse()->isRedirect()) {
37
- $this->_redirect('');
38
- } elseif (!$this->getResponse()->isRedirect()) {
39
- $this->_forward('noRoute');
40
- }
41
- } else {
42
- Mage::logException($e);
43
- $this->_forward('noRoute');
44
- }
45
- }
46
-
47
- }
48
-
49
- /**
50
- * Initialize product instance from request data
51
- *
52
- * @return Mage_Catalog_Model_Product || false
53
- */
54
- protected function _initProduct() {
55
- $productId = (int) $this->getRequest()->getParam('product');
56
-
57
- if ($productId) {
58
- $product = Mage::getModel('catalog/product')
59
- ->setStoreId(Mage::app()->getStore()->getId())
60
- ->load($productId);
61
- if ($product->getId())
62
- return $product;
63
- }
64
-
65
- return false;
66
- }
67
-
68
- public function add2cartAction() {
69
-
70
-
71
-
72
- $cart = $this->_getCart();
73
- $params = $this->getRequest()->getParams();
74
- try {
75
- if (isset($params['qty'])) {
76
- $filter = new Zend_Filter_LocalizedToNormalized(
77
- array('locale' => Mage::app()->getLocale()->getLocaleCode())
78
- );
79
- $params['qty'] = $filter->filter($params['qty']);
80
- }
81
-
82
- $product = $this->_initProduct();
83
- $related = $this->getRequest()->getParam('related_product');
84
-
85
- /**
86
- * Check product availability
87
- */
88
- if ( !$product ) {
89
- $this->_goBack();
90
- return;
91
- }
92
-
93
- $cart->addProduct($product, $params);
94
-
95
- if (!empty($related)) {
96
- $cart->addProductsByIds(explode(',', $related));
97
- }
98
-
99
- $cart->save();
100
-
101
- $this->_getSession()->setCartWasUpdated(true);
102
-
103
- /**
104
- * @todo remove wishlist observer processAddToCart
105
- */
106
- Mage::dispatchEvent('checkout_cart_add_product_complete',
107
- array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
108
- );
109
-
110
- if (!$cart->getQuote()->getHasError()){
111
- $products = $this->_getSession()->getOct8neProducts();
112
- if(!is_array($products))
113
- $products = array();
114
- $products[] = $product->getId();
115
- $this->_getSession()->setOct8neProducts($products);
116
-
117
- // Este mensaje se deshabilita porque sale a destiempo, cuando el parámetro no sea oct8ne
118
- // $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
119
- // $this->_getSession()->addSuccess($message);
120
- }
121
-
122
-
123
- $this->loadLayout();
124
- $this->renderLayout();
125
-
126
- } catch (Mage_Core_Exception $e) {
127
- if ($this->_getSession()->getUseNotice(true)) {
128
- $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml($e->getMessage()));
129
- } else {
130
- $messages = array_unique(explode("\n", $e->getMessage()));
131
- foreach ($messages as $message)
132
- $this->_getSession()->addError(Mage::helper('core')->escapeHtml($message));
133
- }
134
-
135
- } catch (Exception $e) {
136
- // $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));
137
- Mage::logException($e);
138
- $this->_goBack();
139
- }
140
-
141
- }
142
-
143
- /**
144
- * Retrieve child categories of current category
145
- *
146
- * @return Varien_Data_Tree_Node_Collection
147
- */
148
- public function getCurrentChildCategories()
149
- {
150
- $layer = Mage::getSingleton('catalog/layer');
151
- $category = $layer->getCurrentCategory();
152
- /* @var $category Mage_Catalog_Model_Category */
153
- $categories = $category->getChildrenCategories();
154
- $productCollection = Mage::getResourceModel('catalog/product_collection');
155
- $layer->prepareProductCollection($productCollection);
156
- $productCollection->addCountToCategories($categories);
157
- return $categories;
158
- }
159
-
160
-
161
- /**
162
- * Retrieve request object
163
- *
164
- * @return Mage_Core_Controller_Request_Http
165
- * @throws Exception
166
- */
167
- public function getRequest()
168
- {
169
- $controller = Mage::app()->getFrontController();
170
- if ($controller) {
171
- $this->_request = $controller->getRequest();
172
- } else {
173
- throw new Exception(Mage::helper('core')->__("Can't retrieve request object"));
174
- }
175
- return $this->_request;
176
- }
177
-
178
- protected function searchAction()
179
- {
180
- $search_criteria = $this->getRequest()->getParam('search', null);
181
- $search_order = $this->getRequest()->getParam('orderby', null);
182
- $search_dir = $this->getRequest()->getParam('dir', null);
183
-
184
- $storeId = $this->getRequest()->getParam('store', null);
185
- $currency = $this->getRequest()->getParam('currency', null);
186
-
187
- if(is_null($storeId))
188
- {
189
- $storeId = Mage::app()->getStore()->getId();
190
- $initialEnvironmentInfo = null;
191
- }
192
- else
193
- {
194
- $appEmulation = Mage::getSingleton('core/app_emulation');
195
- // Start environment emulation of the specified store
196
- $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
197
- }
198
-
199
- $currentCurrency = Mage::app()->getStore()->getCurrentCurrencyCode();
200
- if(!is_null($currency))
201
- Mage::app()->getStore()->setCurrentCurrencyCode($currency);
202
-
203
- $callback = $this->getRequest()->getParam('callback', null);
204
- $this->getRequest()->setParam('q', $search_criteria);
205
-
206
- if(is_null($search_criteria) || strlen($search_criteria)==0){
207
- //passem totes les dades buides per tal que no mostri resultats
208
- Mage::register('total_search_results', 0);
209
- Mage::register('search_result_collection', array());
210
- Mage::register('partial_search', false);
211
- Mage::register('callback', $callback);
212
- Mage::register('search_result_attrs', array());
213
- Mage::register('search_result_attrs_applied', array());
214
- Mage::register('search_result_attrs_available', array());
215
-
216
- Mage::app()->getStore()->setCurrentCurrencyCode($currentCurrency);
217
-
218
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
219
-
220
- $this->loadLayout();
221
- $this->renderLayout();
222
- return ;
223
-
224
- }
225
- // $this->getRequest()->setParam('order', $search_sort);
226
- // $this->getRequest()->setParam('dir', $search_order);
227
-
228
- // de esto se encarga Magento $search_criteria = Mage::helper('core/string')->cleanString( $search_criteria );
229
- //die(Mage::app()->getStore()->getId());
230
- $query = Mage::helper('catalogsearch')->getQuery();
231
- $query->setStoreId($storeId);
232
- if ($query->getId()) {
233
- $query->setPopularity($query->getPopularity()+1);
234
- }
235
- else {
236
- $query->setPopularity(1);
237
- }
238
- $query->prepare();
239
- Mage::helper('catalogsearch')->checkNotes();
240
-
241
- $query = Mage::getModel('catalogsearch/layer');
242
-
243
-
244
-
245
- $filterableAttributes = $query->getFilterableAttributes();
246
- $attrs = array();
247
-
248
- if(!empty($filterableAttributes))
249
- {
250
- $tmp = new Mage_Catalog_Model_Resource_Eav_Attribute();
251
- $tmp->SetAttributeCode('category');
252
- $tmp->setFrontendLabel('Category');
253
- $filterableAttributes->addItem($tmp);
254
- }
255
- // $filterableAttributes[] =
256
- // category
257
-
258
- foreach ($filterableAttributes as $attribute)
259
- {
260
- $code = $attribute->getAttributeCode();
261
- $name = $attribute->getFrontendLabel();
262
-
263
- // INIT
264
- $items = array();
265
- switch($code)
266
- {
267
- case 'price':
268
- $_filterModelName = "catalog/layer_filter_price";
269
- break;
270
- case 'decimal':
271
- $_filterModelName = "catalog/layer_filter_decimal";
272
- break;
273
- case 'category':
274
- $_filterModelName = "catalog/layer_filter_category";
275
- break;
276
- default:
277
- $_filterModelName = "catalog/layer_filter_attribute";
278
- break;
279
- }
280
-
281
- $filter = Mage::getModel($_filterModelName)
282
- ->setLayer($query)
283
- ->setAttributeModel($attribute);
284
- $filter->apply($this->getRequest(), $this);
285
- $items = $filter->getItems();
286
- // INIT
287
-
288
- // En los filtros aplicados no nos viene el nombre, solo el id, lo obtenemos aqui
289
- $optionId = $this->getRequest()->getParam($filter->getRequestVar());
290
- $featurename = "";
291
- if(!is_null($optionId)) {
292
- switch($code)
293
- {
294
- case 'price':
295
- $featurename = $this->getRequest()->get($code);
296
- break;
297
- case 'decimal':
298
- $featurename = $this->getRequest()->get($code);
299
- break;
300
- case 'category':
301
- $featurename = $filter->getCategory()->getName();
302
- break;
303
- default:
304
- $featurename = $filter->getAttributeModel()->getFrontend()->getOption($optionId);
305
- break;
306
- }
307
-
308
- }
309
-
310
- $options = array();
311
- foreach($items as $item)
312
- {
313
- if($item->getCount() > 0)
314
- $options[] = array("label" => $item->getLabel(), "value" => $item->getValue(), "qty" => $item->getCount());
315
- }
316
-
317
- $attrs[] = array(
318
- 'code' => $code,
319
- 'name' => $name,
320
- 'options' => $options,
321
- 'featurename' => $featurename
322
- );
323
- }
324
-
325
- $attrs_applied = array();
326
- $attrs_available = array();
327
- foreach($attrs as $attr)
328
- {
329
- if(!is_null($this->getRequest()->getParam($attr['code'])))
330
- {
331
- $attr['value'] = $this->getRequest()->getParam($attr['code']);
332
- $attrs_applied[] = $attr;
333
- }
334
- else
335
- {
336
- $attrs_available[] = $attr;
337
- }
338
- /*
339
- if($this->getRequest()
340
- $attrs[] = array(
341
- 'code' => $code,
342
- 'name' => $name,
343
- 'options' => $options
344
- );
345
- */
346
- }
347
-
348
-
349
- $result_collection = $query->getProductCollection();
350
-
351
-
352
- $order = Mage::getSingleton('catalog/session')->getSortOrder();
353
- $dir = Mage::getSingleton('catalog/session')->getSortDirection();
354
-
355
- if(!$order)
356
- $order = "relevance"; // Mage::getStoreConfig( Mage_Catalog_Model_Config::XML_PATH_LIST_DEFAULT_SORT_BY );
357
- if(!$dir)
358
- $dir = "asc";
359
-
360
-
361
- if($search_order)
362
- {
363
- if(!$search_dir)
364
- $search_dir = "asc";
365
- $result_collection->setOrder($search_order, $search_dir);
366
- } else if ($order) {
367
- $result_collection->setOrder($order, $dir);
368
- }
369
-
370
- Mage::register( 'total_search_results', $result_collection->count() );
371
-
372
-
373
- /*
374
- $_categories = $this->getCurrentChildCategories();
375
- foreach ($_categories as $_category)
376
- {
377
- if($_category->getIsActive())
378
- {
379
-
380
- }
381
- }
382
- */
383
-
384
- $currency = Mage::helper('oct8ne/customer_data')->getCurrency();
385
- $v = array();
386
- if ( is_numeric( $this->getRequest()->getParam('start') ) )
387
- $start = $this->getRequest()->getParam('start');
388
- else
389
- $start = 0;
390
- if ( is_numeric( $this->getRequest()->getParam('items') ) )
391
- $items = $this->getRequest()->getParam('items');
392
- else
393
- $items = 10;
394
-
395
- $new_collection = array();
396
- $i0 = $start;
397
- $i1 = $i0 + $items;
398
- $i = 0;
399
- foreach( $result_collection as $item ) {
400
- if ( $i >= $i0 && $i < $i1 )
401
- $new_collection[] = $item;
402
- $i++;
403
- }
404
- $result_collection = $new_collection;
405
-
406
- foreach( $result_collection as $item ) {
407
- $id = $item->getId();
408
- /*
409
- $product = Mage::getModel('catalog/product')->load( $id );
410
- $description = str_replace( array("\r\n", "\n", "\r"), "\\n", htmlentities ($product->getDescription()) );
411
- $vi = array(
412
- 'id' => $product->getId(),
413
- 'title' => htmlentities( $product->getName() ),
414
- // 'price' => sprintf( "%.02f$currency", is_numeric($product->getSpecialPrice()) ? $product->getSpecialPrice() : $product->getPrice() ),
415
- 'price' => number_format($product->getFinalPrice(), '2', '.', ','),
416
- 'description' => $description,
417
- 'url' => Mage::helper('oct8ne')->getProductFullUrl( $product ),
418
- 'imgs' => Mage::helper('oct8ne')->getProductImagesUrl( $product ),
419
- 'thumbnail' => Mage::helper('oct8ne')->getProductThumbnail( $product, 120 )
420
- );
421
- $v[] = $vi;
422
- */
423
- $v[] = Mage::helper('oct8ne')->getProductInfo($id);
424
- }
425
-
426
- Mage::register( 'search_result_collection', $v );
427
- Mage::register( 'partial_search', false );
428
- Mage::register( 'callback', $callback );
429
- Mage::register( 'search_result_attrs', $attrs );
430
- Mage::register( 'search_result_attrs_applied', $attrs_applied );
431
- Mage::register( 'search_result_attrs_available', $attrs_available );
432
-
433
- if(!is_null($initialEnvironmentInfo))
434
- {
435
- //Stop environment emulation and restore original store
436
- $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
437
- }
438
-
439
- Mage::app()->getStore()->setCurrentCurrencyCode($currentCurrency);
440
-
441
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
442
-
443
- $this->loadLayout();
444
- $this->renderLayout();
445
- }
446
-
447
- /**
448
- * Get checkout session model instance
449
- *
450
- * @return Mage_Checkout_Model_Session
451
- */
452
- protected function _getSession() { return Mage::getSingleton('checkout/session'); }
453
-
454
- /**
455
- * Set back redirect url to response
456
- *
457
- * @return Mage_Checkout_CartController
458
- */
459
- protected function _goBack() {
460
- $returnUrl = $this->getRequest()->getParam('return_url');
461
- if ( $returnUrl ) {
462
-
463
- if (!$this->_isUrlInternal($returnUrl))
464
- throw new Mage_Exception('External urls redirect to "' . $returnUrl . '" denied!');
465
-
466
- $this->_getSession()->getMessages(true);
467
- $this->getResponse()->setRedirect($returnUrl);
468
-
469
- } elseif ( $backUrl = $this->_getRefererUrl() )
470
- $this->getResponse()->setRedirect($backUrl);
471
-
472
- return $this;
473
- }
474
-
475
- /**
476
- * Retrieve shopping cart model object
477
- *
478
- * @return Mage_Checkout_Model_Cart
479
- */
480
- protected function _getCart() { return Mage::getSingleton('checkout/cart'); }
481
-
482
- public function search2Action() {
483
- $query = Mage::helper('oct8ne/search')->getQuery();
484
- /* @var $query Mage_CatalogSearch_Model_Query */
485
-
486
- $query->setStoreId(Mage::app()->getStore()->getId());
487
-
488
- if ($query->getQueryText() != '') {
489
- if (Mage::helper('catalogsearch')->isMinQueryLength())
490
- $query->setId(0)
491
- ->setIsActive(1)
492
- ->setIsProcessed(1);
493
- else {
494
- if ($query->getId())
495
- $query->setPopularity($query->getPopularity()+1);
496
- else
497
- $query->setPopularity(1);
498
-
499
- if ($query->getRedirect()) {
500
- $query->save();
501
- $this->getResponse()->setRedirect($query->getRedirect());
502
- return;
503
- } else
504
- $query->prepare();
505
- }
506
-
507
- Mage::helper('catalogsearch')->checkNotes();
508
-
509
- $this->loadLayout();
510
- $this->_initLayoutMessages('catalog/session');
511
- $this->_initLayoutMessages('checkout/session');
512
- $this->renderLayout();
513
-
514
- if (!Mage::helper('catalogsearch')->isMinQueryLength())
515
- $query->save();
516
- }
517
-
518
- }
519
-
520
- public function getcartAction()
521
- {
522
- $callback = $this->getRequest()->getParam('callback', null);
523
-
524
- $result = array();
525
- $cart = $this->_getCart();
526
- foreach($cart->getItems() as $item)
527
- {
528
- $product = $item->getProduct();
529
- $qty = $item->getQty();
530
- $type = $product->getTypeId();
531
-
532
- if($type == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE
533
- || $type == Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL
534
- ) {
535
- $result[] = Mage::helper('oct8ne')->getProductInfo($product->getId(), $qty); /*array(
536
- 'id' => $product->getId(),
537
- 'title' => $product->getName(),
538
- 'price' => number_format($product->getFinalPrice(), '2', '.', ','),
539
- 'qty' => $qty);*/
540
- }
541
- }
542
-
543
-
544
- Mage::register( 'cart', $result );
545
- Mage::register( 'callback', $callback );
546
-
547
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
548
-
549
- $this->loadLayout();
550
- $this->renderLayout();
551
- }
552
-
553
-
554
- public function getwishlistAction()
555
- {
556
- Mage::register(
557
- 'callback',
558
- $this->getRequest()->getParam('callback', null)
559
- );
560
-
561
- Mage::register(
562
- 'oct8ne_customer_id',
563
- $this->getRequest()->getParam('customer', null)
564
- );
565
-
566
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
567
-
568
- $this->loadLayout();
569
- $this->renderLayout();
570
- }
571
-
572
- public function addtowishlistAction()
573
- {
574
- Mage::register(
575
- 'callback',
576
- $this->getRequest()->getParam('callback', null)
577
- );
578
-
579
- $api = Mage::helper( 'oct8ne/wishlist' );
580
-
581
- $result = $api->addToWishlist(
582
- $this->getRequest()->getParam('product', null),
583
- $this->getRequest()->getParam('customer', null)
584
- );
585
-
586
- Mage::register(
587
- 'oct8ne_result',
588
- $result
589
- );
590
-
591
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
592
-
593
- $this->loadLayout();
594
- $this->renderLayout();
595
- }
596
-
597
- public function removefromwishlistAction()
598
- {
599
- Mage::register(
600
- 'callback',
601
- $this->getRequest()->getParam('callback', null)
602
- );
603
-
604
- $api = Mage::helper( 'oct8ne/wishlist' );
605
-
606
- $result = $api->removeFromWishlist(
607
- $this->getRequest()->getParam('product', null),
608
- $this->getRequest()->getParam('customer', null)
609
- );
610
-
611
- Mage::register(
612
- 'oct8ne_result',
613
- $result
614
- );
615
-
616
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
617
-
618
- $this->loadLayout();
619
- $this->renderLayout();
620
- }
621
-
622
- public function productInfoAction()
623
- {
624
- Mage::register(
625
- 'callback',
626
- $this->getRequest()->getParam('callback', null)
627
- );
628
-
629
- Mage::register(
630
- 'oct8ne_product_id',
631
- $this->getRequest()->getParam('id', null)
632
- );
633
-
634
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
635
-
636
- $this->loadLayout();
637
- $this->renderLayout();
638
- }
639
-
640
- public function productRelatedAction()
641
- {
642
- Mage::register(
643
- 'callback',
644
- $this->getRequest()->getParam('callback', null)
645
- );
646
-
647
- Mage::register(
648
- 'oct8ne_product_id',
649
- $this->getRequest()->getParam('id', null)
650
- );
651
-
652
-
653
- if ( is_numeric( $this->getRequest()->getParam('start') ) )
654
- $start = $this->getRequest()->getParam('start',0);
655
- else
656
- $start = 0;
657
-
658
- if ( is_numeric( $this->getRequest()->getParam('items') ) )
659
- $items = $this->getRequest()->getParam('items',10);
660
- else
661
- $items = 10;
662
-
663
-
664
- Mage::register(
665
- 'oct8ne_product_related_num_items',
666
- $items
667
- );
668
-
669
- Mage::register(
670
- 'oct8ne_product_related_start',
671
- $start
672
- );
673
-
674
- $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
675
-
676
- $this->loadLayout();
677
- $this->renderLayout();
678
- }
679
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class LetsSyncroLLC_Oct8ne_FrameController extends Mage_Core_Controller_Front_Action {
4
+
5
+ protected function _checkApitoken()
6
+ {
7
+ $letssyncromodel = Mage::getModel('oct8ne/letssyncro')->load(1);
8
+
9
+ $token = $letssyncromodel->getApitoken();
10
+
11
+ $apitoken = $this->getRequest()->getParam('apitoken', null);
12
+ if($apitoken != $token)
13
+ die("Access denied.");
14
+ }
15
+
16
+ public function indexAction() {
17
+ // $this->_checkApitoken();
18
+
19
+ $this->loadLayout();
20
+ $this->renderLayout();
21
+ }
22
+
23
+ public function customerdataAction() {
24
+ // $this->_checkApitoken();
25
+
26
+ $callback = $this->getRequest()->getParam('callback', null);
27
+ Mage::register( 'callback', $callback );
28
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
29
+ $this->loadLayout();
30
+ $this->renderLayout();
31
+ }
32
+
33
+ public function productviewAction() {
34
+ Mage::register('oct8ne_rewrite', 1, true); // lo usamos para deshabilitar el redirect
35
+ // $this->_checkApitoken();
36
+
37
+ // Get initial data from request
38
+ $categoryId = (int) $this->getRequest()->getParam('category', false);
39
+ $productId = (int) $this->getRequest()->getParam('id');
40
+ $specifyOptions = $this->getRequest()->getParam('options');
41
+
42
+ // Prepare helper and params
43
+ $viewHelper = Mage::helper('catalog/product_view');
44
+
45
+ $params = new Varien_Object();
46
+ $params->setCategoryId($categoryId);
47
+ $params->setSpecifyOptions($specifyOptions);
48
+
49
+ // Render page
50
+ try {
51
+ $viewHelper->prepareAndRender($productId, $this, $params);
52
+ } catch (Exception $e) {
53
+ if ($e->getCode() == $viewHelper->ERR_NO_PRODUCT_LOADED) {
54
+ if (isset($_GET['store']) && !$this->getResponse()->isRedirect()) {
55
+ $this->_redirect('');
56
+ } elseif (!$this->getResponse()->isRedirect()) {
57
+ $this->_forward('noRoute');
58
+ }
59
+ } else {
60
+ Mage::logException($e);
61
+ $this->_forward('noRoute');
62
+ }
63
+ }
64
+
65
+ }
66
+
67
+ /**
68
+ * Initialize product instance from request data
69
+ *
70
+ * @return Mage_Catalog_Model_Product || false
71
+ */
72
+ protected function _initProduct() {
73
+ $productId = (int) $this->getRequest()->getParam('product');
74
+
75
+ if ($productId) {
76
+ $product = Mage::getModel('catalog/product')
77
+ ->setStoreId(Mage::app()->getStore()->getId())
78
+ ->load($productId);
79
+ if ($product->getId())
80
+ return $product;
81
+ }
82
+
83
+ return false;
84
+ }
85
+
86
+ public function add2cartAction() {
87
+ // $this->_checkApitoken();
88
+
89
+
90
+ $cart = $this->_getCart();
91
+ $params = $this->getRequest()->getParams();
92
+ try {
93
+ if (isset($params['qty'])) {
94
+ $filter = new Zend_Filter_LocalizedToNormalized(
95
+ array('locale' => Mage::app()->getLocale()->getLocaleCode())
96
+ );
97
+ $params['qty'] = $filter->filter($params['qty']);
98
+ }
99
+
100
+ $product = $this->_initProduct();
101
+ $related = $this->getRequest()->getParam('related_product');
102
+
103
+ /**
104
+ * Check product availability
105
+ */
106
+ if ( !$product ) {
107
+ $this->_goBack();
108
+ return;
109
+ }
110
+
111
+ $cart->addProduct($product, $params);
112
+
113
+ if (!empty($related)) {
114
+ $cart->addProductsByIds(explode(',', $related));
115
+ }
116
+
117
+ $cart->save();
118
+
119
+ $this->_getSession()->setCartWasUpdated(true);
120
+
121
+ /**
122
+ * @todo remove wishlist observer processAddToCart
123
+ */
124
+ Mage::dispatchEvent('checkout_cart_add_product_complete',
125
+ array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
126
+ );
127
+
128
+ if (!$cart->getQuote()->getHasError()){
129
+ $products = $this->_getSession()->getOct8neProducts();
130
+ if(!is_array($products))
131
+ $products = array();
132
+ $products[] = $product->getId();
133
+ $this->_getSession()->setOct8neProducts($products);
134
+
135
+ // Este mensaje se deshabilita porque sale a destiempo, cuando el parámetro no sea oct8ne
136
+ // $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
137
+ // $this->_getSession()->addSuccess($message);
138
+ }
139
+
140
+
141
+ $this->loadLayout();
142
+ $this->renderLayout();
143
+
144
+ } catch (Mage_Core_Exception $e) {
145
+ if ($this->_getSession()->getUseNotice(true)) {
146
+ $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml($e->getMessage()));
147
+ } else {
148
+ $messages = array_unique(explode("\n", $e->getMessage()));
149
+ foreach ($messages as $message)
150
+ $this->_getSession()->addError(Mage::helper('core')->escapeHtml($message));
151
+ }
152
+
153
+ } catch (Exception $e) {
154
+ // $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));
155
+ Mage::logException($e);
156
+ $this->_goBack();
157
+ }
158
+
159
+ }
160
+
161
+ /**
162
+ * Retrieve child categories of current category
163
+ *
164
+ * @return Varien_Data_Tree_Node_Collection
165
+ */
166
+ public function getCurrentChildCategories()
167
+ {
168
+ $layer = Mage::getSingleton('catalog/layer');
169
+ $category = $layer->getCurrentCategory();
170
+ /* @var $category Mage_Catalog_Model_Category */
171
+ $categories = $category->getChildrenCategories();
172
+ $productCollection = Mage::getResourceModel('catalog/product_collection');
173
+ $layer->prepareProductCollection($productCollection);
174
+ $productCollection->addCountToCategories($categories);
175
+ return $categories;
176
+ }
177
+
178
+
179
+ /**
180
+ * Retrieve request object
181
+ *
182
+ * @return Mage_Core_Controller_Request_Http
183
+ * @throws Exception
184
+ */
185
+ public function getRequest()
186
+ {
187
+ $controller = Mage::app()->getFrontController();
188
+ if ($controller) {
189
+ $this->_request = $controller->getRequest();
190
+ } else {
191
+ throw new Exception(Mage::helper('core')->__("Can't retrieve request object"));
192
+ }
193
+ return $this->_request;
194
+ }
195
+
196
+ protected function searchAction()
197
+ {
198
+ // $this->_checkApitoken();
199
+
200
+ $search_criteria = $this->getRequest()->getParam('search', null);
201
+ $search_order = $this->getRequest()->getParam('orderby', null);
202
+ $search_dir = $this->getRequest()->getParam('dir', null);
203
+
204
+ $storeId = $this->getRequest()->getParam('store', null);
205
+ $currency = $this->getRequest()->getParam('currency', null);
206
+
207
+ if(is_null($storeId))
208
+ {
209
+ $storeId = Mage::app()->getStore()->getId();
210
+ $initialEnvironmentInfo = null;
211
+ }
212
+ else
213
+ {
214
+ $appEmulation = Mage::getSingleton('core/app_emulation');
215
+ // Start environment emulation of the specified store
216
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
217
+ }
218
+
219
+ $currentCurrency = Mage::app()->getStore()->getCurrentCurrencyCode();
220
+ if(!is_null($currency))
221
+ Mage::app()->getStore()->setCurrentCurrencyCode($currency);
222
+
223
+ $callback = $this->getRequest()->getParam('callback', null);
224
+ $this->getRequest()->setParam('q', $search_criteria);
225
+
226
+ if(is_null($search_criteria) || strlen($search_criteria)==0){
227
+ //passem totes les dades buides per tal que no mostri resultats
228
+ Mage::register('total_search_results', 0);
229
+ Mage::register('search_result_collection', array());
230
+ Mage::register('partial_search', false);
231
+ Mage::register('callback', $callback);
232
+ Mage::register('search_result_attrs', array());
233
+ Mage::register('search_result_attrs_applied', array());
234
+ Mage::register('search_result_attrs_available', array());
235
+
236
+ Mage::app()->getStore()->setCurrentCurrencyCode($currentCurrency);
237
+
238
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
239
+
240
+ $this->loadLayout();
241
+ $this->renderLayout();
242
+ return ;
243
+
244
+ }
245
+ // $this->getRequest()->setParam('order', $search_sort);
246
+ // $this->getRequest()->setParam('dir', $search_order);
247
+
248
+ // de esto se encarga Magento $search_criteria = Mage::helper('core/string')->cleanString( $search_criteria );
249
+ //die(Mage::app()->getStore()->getId());
250
+ $query = Mage::helper('catalogsearch')->getQuery();
251
+ $query->setStoreId($storeId);
252
+ if ($query->getId()) {
253
+ $query->setPopularity($query->getPopularity()+1);
254
+ }
255
+ else {
256
+ $query->setPopularity(1);
257
+ }
258
+ $query->prepare();
259
+ Mage::helper('catalogsearch')->checkNotes();
260
+
261
+ $query = Mage::getModel('catalogsearch/layer');
262
+
263
+
264
+
265
+ $filterableAttributes = $query->getFilterableAttributes();
266
+ $attrs = array();
267
+
268
+ if(!empty($filterableAttributes))
269
+ {
270
+ $tmp = new Mage_Catalog_Model_Resource_Eav_Attribute();
271
+ $tmp->SetAttributeCode('category');
272
+ $tmp->setFrontendLabel('Category');
273
+ $filterableAttributes->addItem($tmp);
274
+ }
275
+ // $filterableAttributes[] =
276
+ // category
277
+
278
+ foreach ($filterableAttributes as $attribute)
279
+ {
280
+ $code = $attribute->getAttributeCode();
281
+ $name = $attribute->getFrontendLabel();
282
+
283
+ // INIT
284
+ $items = array();
285
+ switch($code)
286
+ {
287
+ case 'price':
288
+ $_filterModelName = "catalog/layer_filter_price";
289
+ break;
290
+ case 'decimal':
291
+ $_filterModelName = "catalog/layer_filter_decimal";
292
+ break;
293
+ case 'category':
294
+ $_filterModelName = "catalog/layer_filter_category";
295
+ break;
296
+ default:
297
+ $_filterModelName = "catalog/layer_filter_attribute";
298
+ break;
299
+ }
300
+
301
+ $filter = Mage::getModel($_filterModelName)
302
+ ->setLayer($query)
303
+ ->setAttributeModel($attribute);
304
+ $filter->apply($this->getRequest(), $this);
305
+ $items = $filter->getItems();
306
+ // INIT
307
+
308
+ // En los filtros aplicados no nos viene el nombre, solo el id, lo obtenemos aqui
309
+ $optionId = $this->getRequest()->getParam($filter->getRequestVar());
310
+ $featurename = "";
311
+ if(!is_null($optionId)) {
312
+ switch($code)
313
+ {
314
+ case 'price':
315
+ $featurename = $this->getRequest()->get($code);
316
+ break;
317
+ case 'decimal':
318
+ $featurename = $this->getRequest()->get($code);
319
+ break;
320
+ case 'category':
321
+ $featurename = $filter->getCategory()->getName();
322
+ break;
323
+ default:
324
+ $featurename = $filter->getAttributeModel()->getFrontend()->getOption($optionId);
325
+ break;
326
+ }
327
+
328
+ }
329
+
330
+ $options = array();
331
+ foreach($items as $item)
332
+ {
333
+ if($item->getCount() > 0)
334
+ $options[] = array("label" => $item->getLabel(), "value" => $item->getValue(), "qty" => $item->getCount());
335
+ }
336
+
337
+ $attrs[] = array(
338
+ 'code' => $code,
339
+ 'name' => $name,
340
+ 'options' => $options,
341
+ 'featurename' => $featurename
342
+ );
343
+ }
344
+
345
+ $attrs_applied = array();
346
+ $attrs_available = array();
347
+ foreach($attrs as $attr)
348
+ {
349
+ if(!is_null($this->getRequest()->getParam($attr['code'])))
350
+ {
351
+ $attr['value'] = $this->getRequest()->getParam($attr['code']);
352
+ $attrs_applied[] = $attr;
353
+ }
354
+ else
355
+ {
356
+ $attrs_available[] = $attr;
357
+ }
358
+ /*
359
+ if($this->getRequest()
360
+ $attrs[] = array(
361
+ 'code' => $code,
362
+ 'name' => $name,
363
+ 'options' => $options
364
+ );
365
+ */
366
+ }
367
+
368
+
369
+ $result_collection = $query->getProductCollection();
370
+
371
+ $order = Mage::getSingleton('catalog/session')->getSortOrder();
372
+ $dir = Mage::getSingleton('catalog/session')->getSortDirection();
373
+
374
+ if(!$order)
375
+ $order = "relevance"; // Mage::getStoreConfig( Mage_Catalog_Model_Config::XML_PATH_LIST_DEFAULT_SORT_BY );
376
+ if(!$dir)
377
+ $dir = "asc";
378
+
379
+
380
+ if($search_order)
381
+ {
382
+ if(!$search_dir)
383
+ $search_dir = "asc";
384
+ $result_collection->setOrder($search_order, $search_dir);
385
+ } else if ($order) {
386
+ $result_collection->setOrder($order, $dir);
387
+ }
388
+
389
+ Mage::register( 'total_search_results', $result_collection->count() );
390
+
391
+
392
+ /*
393
+ $_categories = $this->getCurrentChildCategories();
394
+ foreach ($_categories as $_category)
395
+ {
396
+ if($_category->getIsActive())
397
+ {
398
+
399
+ }
400
+ }
401
+ */
402
+
403
+ $currency = Mage::helper('oct8ne/customer_data')->getCurrency();
404
+ $v = array();
405
+ if ( is_numeric( $this->getRequest()->getParam('start') ) )
406
+ $start = $this->getRequest()->getParam('start');
407
+ else
408
+ $start = 0;
409
+ if ( is_numeric( $this->getRequest()->getParam('items') ) )
410
+ $items = $this->getRequest()->getParam('items');
411
+ else
412
+ $items = 10;
413
+
414
+ $new_collection = array();
415
+ $i0 = $start;
416
+ $i1 = $i0 + $items;
417
+ $i = 0;
418
+ foreach( $result_collection as $item ) {
419
+ if ( $i >= $i0 && $i < $i1 )
420
+ $new_collection[] = $item;
421
+ $i++;
422
+ }
423
+ $result_collection = $new_collection;
424
+
425
+ foreach( $result_collection as $item ) {
426
+ $id = $item->getId();
427
+ /*
428
+ $product = Mage::getModel('catalog/product')->load( $id );
429
+ $description = str_replace( array("\r\n", "\n", "\r"), "\\n", htmlentities ($product->getDescription()) );
430
+ $vi = array(
431
+ 'id' => $product->getId(),
432
+ 'title' => htmlentities( $product->getName() ),
433
+ // 'price' => sprintf( "%.02f$currency", is_numeric($product->getSpecialPrice()) ? $product->getSpecialPrice() : $product->getPrice() ),
434
+ 'price' => number_format($product->getFinalPrice(), '2', '.', ','),
435
+ 'description' => $description,
436
+ 'url' => Mage::helper('oct8ne')->getProductFullUrl( $product ),
437
+ 'imgs' => Mage::helper('oct8ne')->getProductImagesUrl( $product ),
438
+ 'thumbnail' => Mage::helper('oct8ne')->getProductThumbnail( $product, 120 )
439
+ );
440
+ $v[] = $vi;
441
+ */
442
+ $v[] = Mage::helper('oct8ne')->getProductInfo($id);
443
+ }
444
+
445
+ Mage::register( 'search_result_collection', $v );
446
+ Mage::register( 'partial_search', false );
447
+ Mage::register( 'callback', $callback );
448
+ Mage::register( 'search_result_attrs', $attrs );
449
+ Mage::register( 'search_result_attrs_applied', $attrs_applied );
450
+ Mage::register( 'search_result_attrs_available', $attrs_available );
451
+
452
+ if(!is_null($initialEnvironmentInfo))
453
+ {
454
+ //Stop environment emulation and restore original store
455
+ $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
456
+ }
457
+
458
+ Mage::app()->getStore()->setCurrentCurrencyCode($currentCurrency);
459
+
460
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
461
+
462
+ $this->loadLayout();
463
+ $this->renderLayout();
464
+ }
465
+
466
+ /**
467
+ * Get checkout session model instance
468
+ *
469
+ * @return Mage_Checkout_Model_Session
470
+ */
471
+ protected function _getSession() { return Mage::getSingleton('checkout/session'); }
472
+
473
+ /**
474
+ * Set back redirect url to response
475
+ *
476
+ * @return Mage_Checkout_CartController
477
+ */
478
+ protected function _goBack() {
479
+ $returnUrl = $this->getRequest()->getParam('return_url');
480
+ if ( $returnUrl ) {
481
+
482
+ if (!$this->_isUrlInternal($returnUrl))
483
+ throw new Mage_Exception('External urls redirect to "' . $returnUrl . '" denied!');
484
+
485
+ $this->_getSession()->getMessages(true);
486
+ $this->getResponse()->setRedirect($returnUrl);
487
+
488
+ } elseif ( $backUrl = $this->_getRefererUrl() )
489
+ $this->getResponse()->setRedirect($backUrl);
490
+
491
+ return $this;
492
+ }
493
+
494
+ /**
495
+ * Retrieve shopping cart model object
496
+ *
497
+ * @return Mage_Checkout_Model_Cart
498
+ */
499
+ protected function _getCart() { return Mage::getSingleton('checkout/cart'); }
500
+
501
+ public function search2Action() {
502
+ // $this->_checkApitoken();
503
+
504
+ $query = Mage::helper('oct8ne/search')->getQuery();
505
+ /* @var $query Mage_CatalogSearch_Model_Query */
506
+
507
+ $query->setStoreId(Mage::app()->getStore()->getId());
508
+
509
+ if ($query->getQueryText() != '') {
510
+ if (Mage::helper('catalogsearch')->isMinQueryLength())
511
+ $query->setId(0)
512
+ ->setIsActive(1)
513
+ ->setIsProcessed(1);
514
+ else {
515
+ if ($query->getId())
516
+ $query->setPopularity($query->getPopularity()+1);
517
+ else
518
+ $query->setPopularity(1);
519
+
520
+ if ($query->getRedirect()) {
521
+ $query->save();
522
+ $this->getResponse()->setRedirect($query->getRedirect());
523
+ return;
524
+ } else
525
+ $query->prepare();
526
+ }
527
+
528
+ Mage::helper('catalogsearch')->checkNotes();
529
+
530
+ $this->loadLayout();
531
+ $this->_initLayoutMessages('catalog/session');
532
+ $this->_initLayoutMessages('checkout/session');
533
+ $this->renderLayout();
534
+
535
+ if (!Mage::helper('catalogsearch')->isMinQueryLength())
536
+ $query->save();
537
+ }
538
+
539
+ }
540
+
541
+ public function getcartAction()
542
+ {
543
+ // $this->_checkApitoken();
544
+
545
+ $callback = $this->getRequest()->getParam('callback', null);
546
+
547
+ $result = array();
548
+ $cart = $this->_getCart();
549
+ foreach($cart->getItems() as $item)
550
+ {
551
+ $product = $item->getProduct();
552
+ $qty = $item->getQty();
553
+ $type = $product->getTypeId();
554
+
555
+ if($type == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE
556
+ || $type == Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL
557
+ ) {
558
+ $result[] = Mage::helper('oct8ne')->getProductInfo($product->getId(), $qty); /*array(
559
+ 'id' => $product->getId(),
560
+ 'title' => $product->getName(),
561
+ 'price' => number_format($product->getFinalPrice(), '2', '.', ','),
562
+ 'qty' => $qty);*/
563
+ }
564
+ }
565
+
566
+
567
+ Mage::register( 'cart', $result );
568
+ Mage::register( 'callback', $callback );
569
+
570
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
571
+
572
+ $this->loadLayout();
573
+ $this->renderLayout();
574
+ }
575
+
576
+
577
+ public function getwishlistAction()
578
+ {
579
+ // $this->_checkApitoken();
580
+
581
+ Mage::register(
582
+ 'callback',
583
+ $this->getRequest()->getParam('callback', null)
584
+ );
585
+
586
+ Mage::register(
587
+ 'oct8ne_customer_id',
588
+ $this->getRequest()->getParam('customer', null)
589
+ );
590
+
591
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
592
+
593
+ $this->loadLayout();
594
+ $this->renderLayout();
595
+ }
596
+
597
+ public function addtowishlistAction()
598
+ {
599
+ // $this->_checkApitoken();
600
+
601
+ Mage::register(
602
+ 'callback',
603
+ $this->getRequest()->getParam('callback', null)
604
+ );
605
+
606
+ $api = Mage::helper( 'oct8ne/wishlist' );
607
+
608
+ $result = $api->addToWishlist(
609
+ $this->getRequest()->getParam('product', null),
610
+ $this->getRequest()->getParam('customer', null)
611
+ );
612
+
613
+ Mage::register(
614
+ 'oct8ne_result',
615
+ $result
616
+ );
617
+
618
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
619
+
620
+ $this->loadLayout();
621
+ $this->renderLayout();
622
+ }
623
+
624
+ public function removefromwishlistAction()
625
+ {
626
+ // $this->_checkApitoken();
627
+
628
+ Mage::register(
629
+ 'callback',
630
+ $this->getRequest()->getParam('callback', null)
631
+ );
632
+
633
+ $api = Mage::helper( 'oct8ne/wishlist' );
634
+
635
+ $result = $api->removeFromWishlist(
636
+ $this->getRequest()->getParam('product', null),
637
+ $this->getRequest()->getParam('customer', null)
638
+ );
639
+
640
+ Mage::register(
641
+ 'oct8ne_result',
642
+ $result
643
+ );
644
+
645
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
646
+
647
+ $this->loadLayout();
648
+ $this->renderLayout();
649
+ }
650
+
651
+ public function productInfoAction()
652
+ {
653
+ // $this->_checkApitoken();
654
+
655
+ Mage::register(
656
+ 'callback',
657
+ $this->getRequest()->getParam('callback', null)
658
+ );
659
+
660
+ Mage::register(
661
+ 'oct8ne_product_id',
662
+ $this->getRequest()->getParam('id', null)
663
+ );
664
+
665
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
666
+
667
+ $this->loadLayout();
668
+ $this->renderLayout();
669
+ }
670
+
671
+ public function productRelatedAction()
672
+ {
673
+ // $this->_checkApitoken();
674
+
675
+ Mage::register(
676
+ 'callback',
677
+ $this->getRequest()->getParam('callback', null)
678
+ );
679
+
680
+ Mage::register(
681
+ 'oct8ne_product_id',
682
+ $this->getRequest()->getParam('id', null)
683
+ );
684
+
685
+
686
+ if ( is_numeric( $this->getRequest()->getParam('start') ) )
687
+ $start = $this->getRequest()->getParam('start',0);
688
+ else
689
+ $start = 0;
690
+
691
+ if ( is_numeric( $this->getRequest()->getParam('items') ) )
692
+ $items = $this->getRequest()->getParam('items',10);
693
+ else
694
+ $items = 10;
695
+
696
+
697
+ Mage::register(
698
+ 'oct8ne_product_related_num_items',
699
+ $items
700
+ );
701
+
702
+ Mage::register(
703
+ 'oct8ne_product_related_start',
704
+ $start
705
+ );
706
+
707
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
708
+
709
+ $this->loadLayout();
710
+ $this->renderLayout();
711
+ }
712
+
713
+
714
+
715
+ protected function resizeImg($fileName, $width, $height = null)
716
+ {
717
+ $folderURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
718
+ $imageURL = $folderURL . $fileName;
719
+
720
+ $basePath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . $fileName;
721
+ $newPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . "resized" . DS . $width . DS . $fileName;
722
+ //if width empty then return original size image's URL
723
+ if ($width != '') {
724
+ //if image has already resized then just return URL
725
+ if (file_exists($basePath) && is_file($basePath) && !file_exists($newPath)) {
726
+ $imageObj = new Varien_Image($basePath);
727
+ if($imageObj->getOriginalWidth() <= $width)
728
+ return $basePath;
729
+ $imageObj->constrainOnly(TRUE);
730
+ $imageObj->keepAspectRatio(FALSE);
731
+ $imageObj->keepFrame(FALSE);
732
+ $imageObj->resize($width, $height);
733
+ $imageObj->save($newPath);
734
+ }
735
+ $resizedURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . "resized" . DS . $fileName;
736
+ } else {
737
+ $resizedURL = $imageURL;
738
+ }
739
+ return $newPath; // $resizedURL;
740
+ }
741
+
742
+ public function imageAction()
743
+ {
744
+ // $this->_checkApitoken();
745
+
746
+ $base = Mage::getBaseDir('media');
747
+ $file = $this->getRequest()->getParam('file', null);
748
+ $width = $this->getRequest()->getParam('width', null);
749
+
750
+ if($width == null)
751
+ $newfile = "$base/$file";
752
+ else
753
+ $newfile = $this->resizeImg($file, $width);
754
+
755
+ $mime_types = array(
756
+ 'png' => 'image/png',
757
+ 'jpe' => 'image/jpeg',
758
+ 'jpeg' => 'image/jpeg',
759
+ 'jpg' => 'image/jpeg',
760
+ 'gif' => 'image/gif',
761
+ 'bmp' => 'image/bmp',
762
+ 'ico' => 'image/vnd.microsoft.icon',
763
+ 'tiff' => 'image/tiff',
764
+ 'tif' => 'image/tiff',
765
+ 'svg' => 'image/svg+xml',
766
+ 'svgz' => 'image/svg+xml',
767
+ );
768
+ $path_parts = pathinfo($newfile);
769
+ $mime = $mime_types[strtolower($path_parts['extension'])];
770
+
771
+ $this->getResponse()->clearHeaders();
772
+ $this->getResponse()->setHeader('Content-Type', $mime, true);
773
+ $this->getResponse()->setHeader('Cache-Control', 'max-age: 300', true);
774
+ $this->getResponse()->setHeader('Expires', gmdate('D, d M Y H:i:s \G\M\T', time() + 86400), true);
775
+ $this->getResponse()->setHeader('Pragma', 'cache', true);
776
+ $this->getResponse()->setHeader('Age', '0', true);
777
+
778
+ $this->getResponse()->setBody(file_get_contents($newfile));
779
+ }
780
+
781
+ public function getReportDataAction()
782
+ {
783
+ $this->_checkApitoken();
784
+
785
+ Mage::register(
786
+ 'callback',
787
+ $this->getRequest()->getParam('callback', null)
788
+ );
789
+
790
+ Mage::register(
791
+ 'oct8ne_from',
792
+ $this->getRequest()->getParam('from', null)
793
+ );
794
+
795
+ Mage::register(
796
+ 'oct8ne_to',
797
+ $this->getRequest()->getParam('to', null)
798
+ );
799
+
800
+ Mage::register(
801
+ 'oct8ne_report',
802
+ $this->getRequest()->getParam('report', null)
803
+ );
804
+
805
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
806
+
807
+ $this->loadLayout();
808
+ $this->renderLayout();
809
+ }
810
+
811
+ public function systemcheckAction()
812
+ {
813
+ $text = array();
814
+ $text[] = get_class( Mage::getModel('core/url') );
815
+ $text[] = get_class( Mage::getModel('core/url_rewrite') );
816
+ // $text[] = get_class( Mage::getModel('core/url_rewrite_request') );
817
+ $text[] = get_class( Mage::getModel('core/design_package') );
818
+ $text[] = get_class( Mage::getModel('checkout/type_onepage') );
819
+ // $text[] = get_class( Mage::getModel('core/domainpolicy') );
820
+ // $text[] = get_class( Mage::getBlock('catalog/product_view') );
821
+ $text[] = get_class( $this->getLayout()->createBlock('catalog/product_view') );
822
+ $text[] = get_class( $this->getLayout()->createBlock('page/html_head') );
823
+
824
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
825
+ $this->getResponse()->setBody(implode("\n", $text));
826
+ //echo get_class( Mage::getModel('Mage_Core_Model_Url') );
827
+ //die;
828
+ }
829
+ };
app/code/community/LetsSyncroLLC/Oct8ne/etc/config.xml CHANGED
@@ -1,229 +1,263 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <LetsSyncroLLC_Oct8ne>
5
- <version>1.1.5</version>
6
- </LetsSyncroLLC_Oct8ne>
7
- </modules>
8
- <global>
9
- <models>
10
- <oct8ne>
11
- <class>LetsSyncroLLC_Oct8ne_Model</class>
12
- <resourceModel>oct8ne_mysql4</resourceModel>
13
- </oct8ne>
14
- <oct8ne_mysql4>
15
- <class>LetsSyncroLLC_Oct8ne_Model_Mysql4</class>
16
- <entities>
17
- <letssyncro>
18
- <table>letssyncro</table>
19
- </letssyncro>
20
-
21
- <orderproducts>
22
- <table>orderproducts</table>
23
- </orderproducts>
24
- </entities>
25
- </oct8ne_mysql4>
26
-
27
-
28
- <core>
29
- <rewrite>
30
- <url>LetsSyncroLLC_Oct8ne_Model_Mage_Url</url>
31
- </rewrite>
32
- </core>
33
-
34
- <checkout>
35
- <rewrite>
36
- <type_onepage>LetsSyncroLLC_Oct8ne_Model_Mage_Onepage</type_onepage>
37
- </rewrite>
38
- </checkout>
39
-
40
- </models>
41
- <blocks>
42
- <oct8ne>
43
- <class>LetsSyncroLLC_Oct8ne_Block</class>
44
- </oct8ne>
45
-
46
- <page>
47
- <rewrite>
48
- <html_head>LetsSyncroLLC_Oct8ne_Block_Html_Head</html_head>
49
- </rewrite>
50
- </page>
51
-
52
- </blocks>
53
- <helpers>
54
- <oct8ne>
55
- <class>LetsSyncroLLC_Oct8ne_Helper</class>
56
- </oct8ne>
57
- </helpers>
58
- <resources>
59
- <oct8ne_setup>
60
- <setup>
61
- <module>LetsSyncroLLC_Oct8ne</module>
62
- </setup>
63
- <connection>
64
- <use>core_setup</use>
65
- </connection>
66
- </oct8ne_setup>
67
- <oct8ne_write>
68
- <connection>
69
- <use>core_write</use>
70
- </connection>
71
- </oct8ne_write>
72
- <oct8ne_read>
73
- <connection>
74
- <use>core_read</use>
75
- </connection>
76
- </oct8ne_read>
77
- </resources>
78
-
79
-
80
- <events>
81
- <controller_front_init_routers>
82
- <observers>
83
- <LetsSyncroLLC_Oct8ne_Intercept>
84
- <type>singleton</type>
85
- <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
86
- <method>interceptMethod</method>
87
- </LetsSyncroLLC_Oct8ne_Intercept>
88
- </observers>
89
- </controller_front_init_routers>
90
-
91
- <controller_action_layout_render_before>
92
- <observers>
93
- <LetsSyncroLLC_Oct8ne_Layout>
94
- <type>singleton</type>
95
- <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
96
- <method>layoutRenderBefore</method>
97
- </LetsSyncroLLC_Oct8ne_Layout>
98
- </observers>
99
- </controller_action_layout_render_before>
100
-
101
- <sales_order_place_after>
102
- <observers>
103
- <LetsSyncroLLC_Oct8ne_Order>
104
- <type>singleton</type>
105
- <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
106
- <method>placeOrderBefore</method>
107
- </LetsSyncroLLC_Oct8ne_Order>
108
- </observers>
109
- </sales_order_place_after>
110
- </events>
111
- </global>
112
- <frontend>
113
- <routers>
114
- <oct8ne>
115
- <!-- <LetsSyncroLLC_LetsSyncro> -->
116
- <use>standard</use>
117
- <args>
118
- <module>LetsSyncroLLC_Oct8ne</module>
119
- <frontName>oct8ne</frontName>
120
- </args>
121
- <!-- </LetsSyncroLLC_LetsSyncro> -->
122
- </oct8ne>
123
-
124
- <customer>
125
- <args>
126
- <modules>
127
- <oct8ne before="Mage_Customer">LetsSyncroLLC_Oct8ne</oct8ne>
128
- </modules>
129
- </args>
130
- </customer>
131
- </routers>
132
- <layout>
133
- <updates>
134
- <LetsSyncroLLC_Oct8ne>
135
- <file>oct8ne.xml</file>
136
- </LetsSyncroLLC_Oct8ne>
137
- </updates>
138
- </layout>
139
- </frontend>
140
- <admin>
141
- <routers>
142
- <!-- <LetsSyncroLLC_LetsSyncro> -->
143
- <oct8ne>
144
- <use>admin</use>
145
- <args>
146
- <module>LetsSyncroLLC_Oct8ne</module>
147
- <frontName>oct8ne</frontName>
148
- </args>
149
- </oct8ne>
150
- <!-- </LetsSyncroLLC_LetsSyncro> -->
151
- </routers>
152
- </admin>
153
- <adminhtml>
154
- <translate>
155
- <modules>
156
- <LetsSyncroLLC_Oct8ne>
157
- <files>
158
- <default>LetsSyncroLLC_Oct8ne.csv</default>
159
- </files>
160
- </LetsSyncroLLC_Oct8ne>
161
- </modules>
162
- </translate>
163
- <menu>
164
- <oct8ne translate="title" module="oct8ne">
165
- <title>Oct8ne</title>
166
- <sort_order>1000</sort_order>
167
- <children>
168
- <accountconfig translate="title" module="oct8ne">
169
- <title>Account Setup</title>
170
- <action>oct8ne/admin/accountconfig</action>
171
- <sort_order>0</sort_order>
172
- </accountconfig>
173
- <!--<dashboard translate="title" module="oct8ne">
174
- <title>Dashboard</title>
175
- <action>oct8ne/admin/dashboard</action>
176
- <sort_order>20</sort_order>
177
- </dashboard>
178
- <syncrodata translate="title" module="oct8ne">
179
- <title>Syncro Data</title>
180
- <action>oct8ne/admin/syncrodata</action>
181
- <sort_order>40</sort_order>
182
- </syncrodata>-->
183
- </children>
184
- </oct8ne>
185
- </menu>
186
- <acl>
187
- <resources>
188
- <admin>
189
- <children>
190
- <oct8ne translate="title" module="oct8ne">
191
- <title>Oct8ne</title>
192
- <sort_order>1000</sort_order>
193
- <children>
194
- <accountconfig translate="title" module="oct8ne">
195
- <title>Account Setup</title>
196
- <action>oct8ne/admin/accountconfig</action>
197
- <sort_order>0</sort_order>
198
- </accountconfig>
199
- <!--<dashboard translate="title" module="oct8ne">
200
- <title>Dashboard</title>
201
- <action>oct8ne/admin/dashboard</action>
202
- <sort_order>20</sort_order>
203
- </dashboard>
204
- <syncrodata translate="title" module="oct8ne">
205
- <title>Syncro Data</title>
206
- <action>oct8ne/admin/syncrodata</action>
207
- <sort_order>40</sort_order>
208
- </syncrodata>-->
209
- </children>
210
- </oct8ne>
211
- </children>
212
- </admin>
213
-
214
- </resources>
215
-
216
-
217
- </acl>
218
- </adminhtml>
219
-
220
- <default>
221
- <design>
222
- <oct8nedesign>
223
- <package>default</package>
224
- <theme>oct8ne</theme>
225
- </oct8nedesign>
226
- </design>
227
- </default>
228
- </config>
229
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <LetsSyncroLLC_Oct8ne>
5
+ <version>1.1.9</version>
6
+ </LetsSyncroLLC_Oct8ne>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <oct8ne>
11
+ <class>LetsSyncroLLC_Oct8ne_Model</class>
12
+ <resourceModel>oct8ne_mysql4</resourceModel>
13
+ </oct8ne>
14
+ <oct8ne_mysql4>
15
+ <class>LetsSyncroLLC_Oct8ne_Model_Mysql4</class>
16
+ <entities>
17
+ <letssyncro>
18
+ <table>letssyncro</table>
19
+ </letssyncro>
20
+
21
+ <orderproducts>
22
+ <table>orderproducts</table>
23
+ </orderproducts>
24
+
25
+ <quoteproducts>
26
+ <table>quoteproducts</table>
27
+ </quoteproducts>
28
+ </entities>
29
+ </oct8ne_mysql4>
30
+
31
+
32
+ <core>
33
+ <rewrite>
34
+ <url>LetsSyncroLLC_Oct8ne_Model_Mage_Url</url>
35
+ <url_rewrite>LetsSyncroLLC_Oct8ne_Model_Mage_Rewrite</url_rewrite>
36
+ <url_rewrite_request>LetsSyncroLLC_Oct8ne_Model_Mage_Request</url_rewrite_request>
37
+ <design_package>LetsSyncroLLC_Oct8ne_Model_Mage_Package</design_package>
38
+ <!-- domainpolicy>LetsSyncroLLC_Oct8ne_Model_Mage_Domainpolicy</domainpolicy -->
39
+ </rewrite>
40
+ </core>
41
+
42
+ <checkout>
43
+ <rewrite>
44
+ <type_onepage>LetsSyncroLLC_Oct8ne_Model_Mage_Onepage</type_onepage>
45
+ </rewrite>
46
+ </checkout>
47
+
48
+ </models>
49
+ <blocks>
50
+ <oct8ne>
51
+ <class>LetsSyncroLLC_Oct8ne_Block</class>
52
+ </oct8ne>
53
+
54
+ <page>
55
+ <rewrite>
56
+ <html_head>LetsSyncroLLC_Oct8ne_Block_Html_Head</html_head>
57
+ </rewrite>
58
+ </page>
59
+
60
+ <catalog>
61
+ <rewrite>
62
+ <product_view>LetsSyncroLLC_Oct8ne_Block_Mage_Product_View</product_view>
63
+ </rewrite>
64
+ </catalog>
65
+
66
+ </blocks>
67
+ <helpers>
68
+ <oct8ne>
69
+ <class>LetsSyncroLLC_Oct8ne_Helper</class>
70
+ </oct8ne>
71
+ </helpers>
72
+ <resources>
73
+ <oct8ne_setup>
74
+ <setup>
75
+ <module>LetsSyncroLLC_Oct8ne</module>
76
+ </setup>
77
+ <connection>
78
+ <use>core_setup</use>
79
+ </connection>
80
+ </oct8ne_setup>
81
+ <oct8ne_write>
82
+ <connection>
83
+ <use>core_write</use>
84
+ </connection>
85
+ </oct8ne_write>
86
+ <oct8ne_read>
87
+ <connection>
88
+ <use>core_read</use>
89
+ </connection>
90
+ </oct8ne_read>
91
+ </resources>
92
+
93
+
94
+ <events>
95
+ <controller_front_init_routers>
96
+ <observers>
97
+ <LetsSyncroLLC_Oct8ne_Intercept>
98
+ <type>singleton</type>
99
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
100
+ <method>interceptMethod</method>
101
+ </LetsSyncroLLC_Oct8ne_Intercept>
102
+ </observers>
103
+ </controller_front_init_routers>
104
+
105
+ <controller_action_layout_render_before>
106
+ <observers>
107
+ <LetsSyncroLLC_Oct8ne_Layout>
108
+ <type>singleton</type>
109
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
110
+ <method>layoutRenderBefore</method>
111
+ </LetsSyncroLLC_Oct8ne_Layout>
112
+ </observers>
113
+ </controller_action_layout_render_before>
114
+
115
+ <sales_order_place_after>
116
+ <observers>
117
+ <LetsSyncroLLC_Oct8ne_Order>
118
+ <type>singleton</type>
119
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
120
+ <method>placeOrderBefore</method>
121
+ </LetsSyncroLLC_Oct8ne_Order>
122
+ </observers>
123
+ </sales_order_place_after>
124
+
125
+ <sales_quote_save_after>
126
+ <observers>
127
+ <LetsSyncroLLC_Oct8ne_Quote>
128
+ <type>singleton</type>
129
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
130
+ <method>saveQuoteAfter</method>
131
+ </LetsSyncroLLC_Oct8ne_Quote>
132
+ </observers>
133
+ </sales_quote_save_after>
134
+
135
+ <controller_action_predispatch>
136
+ <observers>
137
+ <LetsSyncroLLC_Oct8ne_Quote_security_domain_policy>
138
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
139
+ <method>checkDomainPolicyHeader</method>
140
+ </LetsSyncroLLC_Oct8ne_Quote_security_domain_policy>
141
+ </observers>
142
+ </controller_action_predispatch>
143
+
144
+ </events>
145
+ </global>
146
+ <frontend>
147
+ <routers>
148
+ <oct8ne>
149
+ <!-- <LetsSyncroLLC_LetsSyncro> -->
150
+ <use>standard</use>
151
+ <args>
152
+ <module>LetsSyncroLLC_Oct8ne</module>
153
+ <frontName>oct8ne</frontName>
154
+ </args>
155
+ <!-- </LetsSyncroLLC_LetsSyncro> -->
156
+ </oct8ne>
157
+
158
+ <customer>
159
+ <args>
160
+ <modules>
161
+ <oct8ne before="Mage_Customer">LetsSyncroLLC_Oct8ne</oct8ne>
162
+ </modules>
163
+ </args>
164
+ </customer>
165
+ </routers>
166
+ <layout>
167
+ <updates>
168
+ <LetsSyncroLLC_Oct8ne>
169
+ <file>oct8ne.xml</file>
170
+ </LetsSyncroLLC_Oct8ne>
171
+ </updates>
172
+ </layout>
173
+ </frontend>
174
+ <admin>
175
+ <routers>
176
+ <!-- <LetsSyncroLLC_LetsSyncro> -->
177
+ <oct8ne>
178
+ <use>admin</use>
179
+ <args>
180
+ <module>LetsSyncroLLC_Oct8ne</module>
181
+ <frontName>oct8ne</frontName>
182
+ </args>
183
+ </oct8ne>
184
+ <!-- </LetsSyncroLLC_LetsSyncro> -->
185
+ </routers>
186
+ </admin>
187
+ <adminhtml>
188
+ <translate>
189
+ <modules>
190
+ <LetsSyncroLLC_Oct8ne>
191
+ <files>
192
+ <default>LetsSyncroLLC_Oct8ne.csv</default>
193
+ </files>
194
+ </LetsSyncroLLC_Oct8ne>
195
+ </modules>
196
+ </translate>
197
+ <menu>
198
+ <oct8ne translate="title" module="oct8ne">
199
+ <title>Oct8ne</title>
200
+ <sort_order>1000</sort_order>
201
+ <children>
202
+ <accountconfig translate="title" module="oct8ne">
203
+ <title>Account Setup</title>
204
+ <action>oct8ne/admin/accountconfig</action>
205
+ <sort_order>0</sort_order>
206
+ </accountconfig>
207
+ <!--<dashboard translate="title" module="oct8ne">
208
+ <title>Dashboard</title>
209
+ <action>oct8ne/admin/dashboard</action>
210
+ <sort_order>20</sort_order>
211
+ </dashboard>
212
+ <syncrodata translate="title" module="oct8ne">
213
+ <title>Syncro Data</title>
214
+ <action>oct8ne/admin/syncrodata</action>
215
+ <sort_order>40</sort_order>
216
+ </syncrodata>-->
217
+ </children>
218
+ </oct8ne>
219
+ </menu>
220
+ <acl>
221
+ <resources>
222
+ <admin>
223
+ <children>
224
+ <oct8ne translate="title" module="oct8ne">
225
+ <title>Oct8ne</title>
226
+ <sort_order>1000</sort_order>
227
+ <children>
228
+ <accountconfig translate="title" module="oct8ne">
229
+ <title>Account Setup</title>
230
+ <action>oct8ne/admin/accountconfig</action>
231
+ <sort_order>0</sort_order>
232
+ </accountconfig>
233
+ <!--<dashboard translate="title" module="oct8ne">
234
+ <title>Dashboard</title>
235
+ <action>oct8ne/admin/dashboard</action>
236
+ <sort_order>20</sort_order>
237
+ </dashboard>
238
+ <syncrodata translate="title" module="oct8ne">
239
+ <title>Syncro Data</title>
240
+ <action>oct8ne/admin/syncrodata</action>
241
+ <sort_order>40</sort_order>
242
+ </syncrodata>-->
243
+ </children>
244
+ </oct8ne>
245
+ </children>
246
+ </admin>
247
+
248
+ </resources>
249
+
250
+
251
+ </acl>
252
+ </adminhtml>
253
+
254
+ <default>
255
+ <design>
256
+ <oct8nedesign>
257
+ <package>default</package>
258
+ <theme>oct8ne</theme>
259
+ </oct8nedesign>
260
+ </design>
261
+ </default>
262
+ </config>
263
+
app/code/community/LetsSyncroLLC/Oct8ne/sql/oct8ne_setup/mysql4-upgrade-1.1.6-1.1.7.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+ ALTER TABLE {$this->getTable('orderproducts')}
9
+ ADD `qty` int(11) unsigned NOT NULL,
10
+ ADD `customer_id` int(11) unsigned NOT NULL,
11
+ ADD `product_price` decimal(12,4) NOT NULL default '0.0000',
12
+ ADD `order_price` decimal(12,4) NOT NULL default '0.0000',
13
+ ADD `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
14
+ ADD `currency` varchar(3) NOT NULL default 'EUR',
15
+ MODIFY `oct8ne` varchar(128)
16
+ ");
17
+
18
+ $installer->run("
19
+
20
+ -- DROP TABLE IF EXISTS {$this->getTable('quoteproducts')};
21
+ CREATE TABLE {$this->getTable('quoteproducts')} (
22
+ `quoteproducts_id` int(11) unsigned NOT NULL auto_increment,
23
+ `quote_id` int(11) unsigned NOT NULL,
24
+ `product_id` int(11) unsigned NOT NULL,
25
+ `product_price` decimal(12,4) NOT NULL default '0.0000',
26
+ `quote_price` decimal(12,4) NOT NULL default '0.0000',
27
+ `oct8ne` varchar(128),
28
+ `qty` int(11) unsigned NOT NULL,
29
+ `customer_id` int(11) unsigned NOT NULL,
30
+ `created_at` datetime NOT NULL default '0000-00-00 00:00:00',
31
+ `currency` varchar(3) NOT NULL default 'EUR',
32
+ PRIMARY KEY (`quoteproducts_id`)
33
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
34
+
35
+ ");
36
+
37
+ $installer->endSetup();
app/design/frontend/base/default/layout/oct8ne.xml CHANGED
@@ -1,240 +1,223 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
-
4
- <default>
5
- <!-- fem que la crida es faci al final de la pàgina per tal que no afecti a elements pendents de càrrega-->
6
- <reference name="before_body_end">
7
- <block type="core/template" name="oct8ne_script" template="oct8ne/letssyncro.phtml">
8
- </block>
9
- </reference>
10
- </default>
11
-
12
-
13
- <oct8ne_frame_customerdata>
14
- <reference name="root">
15
- <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
16
- </reference>
17
-
18
- <reference name="content">
19
- <block type="core/template" template="oct8ne/frame/customer/data.phtml" />
20
- </reference>
21
- </oct8ne_frame_customerdata>
22
-
23
-
24
-
25
- <oct8ne_frame_add2cart>
26
- <reference name="root">
27
- <action method="setTemplate"><template>oct8ne/frame/naked-page.phtml</template></action>
28
- </reference>
29
-
30
- <reference name="content">
31
- <block type="core/template" template="oct8ne/frame/add2cart.phtml" />
32
- </reference>
33
- </oct8ne_frame_add2cart>
34
-
35
-
36
- <oct8ne_frame_search>
37
- <reference name="root">
38
- <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
39
- </reference>
40
-
41
- <reference name="content">
42
- <block type="core/template" template="oct8ne/frame/search.phtml" />
43
- </reference>
44
- </oct8ne_frame_search>
45
-
46
-
47
- <oct8ne_frame_productview>
48
-
49
- <reference name="head">
50
- <action method="addJs"><script>varien/product.js</script></action>
51
- </reference>
52
-
53
- <!-- <block type="core/template_facade" name="root" template="oct8ne/frame/productview.phtml"/> -->
54
-
55
- <label>Catalog Product View (Any)</label>
56
- <!-- Mage_Catalog -->
57
- <reference name="head">
58
- <remove name="oct8ne_script" />
59
- </reference>
60
- <reference name="root">
61
- <!-- <action method="setTemplate"><template>page/2columns-right.phtml</template></action> -->
62
- <action method="setTemplate"><template>oct8ne/frame/clean-page.phtml</template></action>
63
- </reference>
64
- <reference name="head">
65
- <action method="addJs"><script>varien/product.js</script></action>
66
- <action method="addJs"><script>varien/configurable.js</script></action>
67
-
68
- <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
69
- <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
70
- <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
71
- </reference>
72
- <reference name="content">
73
- <block type="catalog/product_view" name="product.info" template="oct8ne/frame/productview.phtml">
74
-
75
- <block type="catalog/product_view_media" name="product.info.media" as="media" template="oct8ne/frame/productview/media.phtml"/>
76
- <block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
77
- <label>Alert Urls</label>
78
- </block>
79
-
80
- <action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
81
-
82
- <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="oct8ne/frame/productview/list/upsell.phtml">
83
- <action method="setColumnCount"><columns>4</columns></action>
84
- <action method="setItemLimit"><type>upsell</type><limit>4</limit></action>
85
- </block>
86
-
87
- <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
88
- <block type="catalog/product_view_description" name="product.description" as="description" template="oct8ne/frame/productview/description.phtml">
89
- <action method="addToParentGroup"><group>detailed_info</group></action>
90
- </block>
91
- <block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="oct8ne/frame/productview/attributes.phtml">
92
- <action method="addToParentGroup"><group>detailed_info</group></action>
93
- </block>
94
- <block type="catalog/product_view" name="product.info.addto" as="addto" template="oct8ne/frame/productview/addto.phtml"/>
95
- <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="oct8ne/frame/productview/addtocart.phtml"/>
96
-
97
- <block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
98
- <label>Product View Extra Hint</label>
99
- </block>
100
-
101
- <block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="oct8ne/frame/productview/options/wrapper.phtml" translate="label">
102
- <label>Info Column Options Wrapper</label>
103
- <block type="core/template" name="options_js" template="oct8ne/frame/productview/options/js.phtml"/>
104
- <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="oct8ne/frame/productview/options.phtml">
105
- <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
106
- <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
107
- <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
108
- <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
109
- </block>
110
- <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
111
- </block>
112
- <block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="oct8ne/frame/productview/options/wrapper/bottom.phtml" translate="label">
113
- <label>Bottom Block Options Wrapper</label>
114
- <action method="insert"><block>product.tierprices</block></action>
115
- <block type="catalog/product_view" name="product.clone_prices" as="prices" template="oct8ne/frame/productview/price_clone.phtml"/>
116
- <action method="append"><block>product.info.addtocart</block></action>
117
- <action method="append"><block>product.info.addto</block></action>
118
- </block>
119
-
120
- <block type="core/template_facade" name="product.info.container1" as="container1">
121
- <action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
122
- <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
123
- <action method="append"><block>product.info.options.wrapper</block></action>
124
- <action method="append"><block>product.info.options.wrapper.bottom</block></action>
125
- </block>
126
- <block type="core/template_facade" name="product.info.container2" as="container2">
127
- <action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
128
- <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
129
- <action method="append"><block>product.info.options.wrapper</block></action>
130
- <action method="append"><block>product.info.options.wrapper.bottom</block></action>
131
- </block>
132
- <action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
133
- <action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
134
- </block>
135
- </reference>
136
- <reference name="right">
137
- <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="oct8ne/frame/productview/list/related.phtml"/>
138
- </reference>
139
-
140
- </oct8ne_frame_productview>
141
-
142
-
143
- <oct8ne_frame_search2 translate="label">
144
- <label>Oct8ne Search</label>
145
- <reference name="root">
146
- <action method="setTemplate"><template>page/3columns.phtml</template></action>
147
- </reference>
148
- <reference name="left">
149
- <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
150
- </reference>
151
- <reference name="content">
152
- <block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
153
- <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
154
- <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
155
- <block type="page/html_pager" name="product_list_toolbar_pager"/>
156
- </block>
157
- <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
158
- <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
159
- <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
160
- <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
161
- <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
162
- <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
163
- </block>
164
- <action method="setListOrders"/>
165
- <action method="setListModes"/>
166
- <action method="setListCollection"/>
167
- </block>
168
- </reference>
169
- </oct8ne_frame_search2>
170
-
171
- <customer_account_loginpost>
172
- <reference name="root">
173
- <action method="setTemplate"><template>oct8ne/frame/naked-page.phtml</template></action>
174
- </reference>
175
-
176
- <reference name="content">
177
- <block type="core/template" template="oct8ne/frame/loginpost.phtml" />
178
- </reference>
179
- </customer_account_loginpost>
180
-
181
- <oct8ne_frame_getcart>
182
- <reference name="root">
183
- <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
184
- </reference>
185
-
186
- <reference name="content">
187
- <block type="core/template" template="oct8ne/frame/getcart.phtml" />
188
- </reference>
189
- </oct8ne_frame_getcart>
190
-
191
- <oct8ne_frame_getwishlist>
192
- <reference name="root">
193
- <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
194
- </reference>
195
-
196
- <reference name="content">
197
- <block type="core/template" template="oct8ne/frame/getwishlist.phtml" />
198
- </reference>
199
- </oct8ne_frame_getwishlist>
200
-
201
- <oct8ne_frame_addtowishlist>
202
- <reference name="root">
203
- <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
204
- </reference>
205
-
206
- <reference name="content">
207
- <block type="core/template" template="oct8ne/frame/addtowishlist.phtml" />
208
- </reference>
209
- </oct8ne_frame_addtowishlist>
210
-
211
- <oct8ne_frame_removefromwishlist>
212
- <reference name="root">
213
- <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
214
- </reference>
215
-
216
- <reference name="content">
217
- <block type="core/template" template="oct8ne/frame/removefromwishlist.phtml" />
218
- </reference>
219
- </oct8ne_frame_removefromwishlist>
220
-
221
- <oct8ne_frame_productinfo>
222
- <reference name="root">
223
- <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
224
- </reference>
225
-
226
- <reference name="content">
227
- <block type="core/template" template="oct8ne/frame/productinfo.phtml" />
228
- </reference>
229
- </oct8ne_frame_productinfo>
230
-
231
- <oct8ne_frame_productrelated>
232
- <reference name="root">
233
- <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
234
- </reference>
235
-
236
- <reference name="content">
237
- <block type="core/template" template="oct8ne/frame/productrelated.phtml" />
238
- </reference>
239
- </oct8ne_frame_productrelated>
240
- </layout>
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+
4
+ <default>
5
+ <!-- fem que la crida es faci al final de la pàgina per tal que no afecti a elements pendents de càrrega-->
6
+ <reference name="before_body_end">
7
+ <block type="core/template" name="oct8ne_script" template="oct8ne/letssyncro.phtml">
8
+ </block>
9
+ </reference>
10
+ </default>
11
+
12
+
13
+ <oct8ne_frame_customerdata>
14
+ <reference name="root">
15
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
16
+ <block type="core/template" template="oct8ne/frame/customer/data.phtml" name="jsoncontent" />
17
+ </reference>
18
+ </oct8ne_frame_customerdata>
19
+
20
+
21
+
22
+ <oct8ne_frame_add2cart>
23
+ <reference name="root">
24
+ <action method="setTemplate"><template>oct8ne/frame/naked-page.phtml</template></action>
25
+ </reference>
26
+
27
+ <reference name="content">
28
+ <block type="core/template" template="oct8ne/frame/add2cart.phtml" />
29
+ </reference>
30
+ </oct8ne_frame_add2cart>
31
+
32
+
33
+ <oct8ne_frame_search>
34
+ <reference name="root">
35
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
36
+ <block type="core/template" template="oct8ne/frame/search.phtml" name="jsoncontent" />
37
+ </reference>
38
+ </oct8ne_frame_search>
39
+
40
+
41
+ <oct8ne_frame_productview>
42
+
43
+ <reference name="head">
44
+ <action method="addJs"><script>varien/product.js</script></action>
45
+ </reference>
46
+
47
+ <!-- <block type="core/template_facade" name="root" template="oct8ne/frame/productview.phtml"/> -->
48
+
49
+ <label>Catalog Product View (Any)</label>
50
+ <!-- Mage_Catalog -->
51
+ <reference name="head">
52
+ <remove name="oct8ne_script" />
53
+ </reference>
54
+ <reference name="root">
55
+ <!-- <action method="setTemplate"><template>page/2columns-right.phtml</template></action> -->
56
+ <action method="setTemplate"><template>oct8ne/frame/clean-page.phtml</template></action>
57
+ </reference>
58
+ <reference name="head">
59
+ <action method="addJs"><script>varien/product.js</script></action>
60
+ <action method="addJs"><script>varien/configurable.js</script></action>
61
+
62
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
63
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
64
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
65
+ </reference>
66
+ <reference name="content">
67
+ <block type="catalog/product_view" name="product.info" template="oct8ne/frame/productview.phtml">
68
+
69
+ <block type="catalog/product_view_media" name="product.info.media" as="media" template="oct8ne/frame/productview/media.phtml"/>
70
+ <block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
71
+ <label>Alert Urls</label>
72
+ </block>
73
+
74
+ <action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
75
+
76
+ <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="oct8ne/frame/productview/list/upsell.phtml">
77
+ <action method="setColumnCount"><columns>4</columns></action>
78
+ <action method="setItemLimit"><type>upsell</type><limit>4</limit></action>
79
+ </block>
80
+
81
+ <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
82
+ <block type="catalog/product_view_description" name="product.description" as="description" template="oct8ne/frame/productview/description.phtml">
83
+ <action method="addToParentGroup"><group>detailed_info</group></action>
84
+ </block>
85
+ <block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="oct8ne/frame/productview/attributes.phtml">
86
+ <action method="addToParentGroup"><group>detailed_info</group></action>
87
+ </block>
88
+ <block type="catalog/product_view" name="product.info.addto" as="addto" template="oct8ne/frame/productview/addto.phtml"/>
89
+ <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="oct8ne/frame/productview/addtocart.phtml"/>
90
+
91
+ <block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
92
+ <label>Product View Extra Hint</label>
93
+ </block>
94
+
95
+ <block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="oct8ne/frame/productview/options/wrapper.phtml" translate="label">
96
+ <label>Info Column Options Wrapper</label>
97
+ <block type="core/template" name="options_js" template="oct8ne/frame/productview/options/js.phtml"/>
98
+ <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="oct8ne/frame/productview/options.phtml">
99
+ <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
100
+ <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
101
+ <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
102
+ <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
103
+ </block>
104
+ <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
105
+ </block>
106
+ <block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="oct8ne/frame/productview/options/wrapper/bottom.phtml" translate="label">
107
+ <label>Bottom Block Options Wrapper</label>
108
+ <action method="insert"><block>product.tierprices</block></action>
109
+ <block type="catalog/product_view" name="product.clone_prices" as="prices" template="oct8ne/frame/productview/price_clone.phtml"/>
110
+ <action method="append"><block>product.info.addtocart</block></action>
111
+ <action method="append"><block>product.info.addto</block></action>
112
+ </block>
113
+
114
+ <block type="core/template_facade" name="product.info.container1" as="container1">
115
+ <action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
116
+ <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
117
+ <action method="append"><block>product.info.options.wrapper</block></action>
118
+ <action method="append"><block>product.info.options.wrapper.bottom</block></action>
119
+ </block>
120
+ <block type="core/template_facade" name="product.info.container2" as="container2">
121
+ <action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
122
+ <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
123
+ <action method="append"><block>product.info.options.wrapper</block></action>
124
+ <action method="append"><block>product.info.options.wrapper.bottom</block></action>
125
+ </block>
126
+ <action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
127
+ <action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
128
+ </block>
129
+ </reference>
130
+ <reference name="right">
131
+ <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="oct8ne/frame/productview/list/related.phtml"/>
132
+ </reference>
133
+
134
+ </oct8ne_frame_productview>
135
+
136
+
137
+ <oct8ne_frame_search2 translate="label">
138
+ <label>Oct8ne Search</label>
139
+ <reference name="root">
140
+ <action method="setTemplate"><template>page/3columns.phtml</template></action>
141
+ </reference>
142
+ <reference name="left">
143
+ <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
144
+ </reference>
145
+ <reference name="content">
146
+ <block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
147
+ <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
148
+ <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
149
+ <block type="page/html_pager" name="product_list_toolbar_pager"/>
150
+ </block>
151
+ <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
152
+ <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
153
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
154
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
155
+ <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
156
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
157
+ </block>
158
+ <action method="setListOrders"/>
159
+ <action method="setListModes"/>
160
+ <action method="setListCollection"/>
161
+ </block>
162
+ </reference>
163
+ </oct8ne_frame_search2>
164
+
165
+ <customer_account_loginpost>
166
+ <reference name="root">
167
+ <action method="setTemplate"><template>oct8ne/frame/naked-page.phtml</template></action>
168
+ </reference>
169
+
170
+ <reference name="content">
171
+ <block type="core/template" template="oct8ne/frame/loginpost.phtml" />
172
+ </reference>
173
+ </customer_account_loginpost>
174
+
175
+ <oct8ne_frame_getcart>
176
+ <reference name="root">
177
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
178
+ <block type="core/template" template="oct8ne/frame/getcart.phtml" name="jsoncontent" />
179
+ </reference>
180
+ </oct8ne_frame_getcart>
181
+
182
+ <oct8ne_frame_getwishlist>
183
+ <reference name="root">
184
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
185
+ <block type="core/template" template="oct8ne/frame/getwishlist.phtml" name="jsoncontent" />
186
+ </reference>
187
+ </oct8ne_frame_getwishlist>
188
+
189
+ <oct8ne_frame_addtowishlist>
190
+ <reference name="root">
191
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
192
+ <block type="core/template" template="oct8ne/frame/addtowishlist.phtml" name="jsoncontent" />
193
+ </reference>
194
+ </oct8ne_frame_addtowishlist>
195
+
196
+ <oct8ne_frame_removefromwishlist>
197
+ <reference name="root">
198
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
199
+ <block type="core/template" template="oct8ne/frame/removefromwishlist.phtml" name="jsoncontent" />
200
+ </reference>
201
+ </oct8ne_frame_removefromwishlist>
202
+
203
+ <oct8ne_frame_productinfo>
204
+ <reference name="root">
205
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
206
+ <block type="core/template" template="oct8ne/frame/productinfo.phtml" name="jsoncontent" />
207
+ </reference>
208
+ </oct8ne_frame_productinfo>
209
+
210
+ <oct8ne_frame_productrelated>
211
+ <reference name="root">
212
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
213
+ <block type="core/template" template="oct8ne/frame/productrelated.phtml" name="jsoncontent"/>
214
+ </reference>
215
+ </oct8ne_frame_productrelated>
216
+
217
+ <oct8ne_frame_getreportdata>
218
+ <reference name="root">
219
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
220
+ <block type="core/template" template="oct8ne/frame/getreportdata.phtml" name="jsoncontent"/>
221
+ </reference>
222
+ </oct8ne_frame_getreportdata>
223
+ </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/oct8ne/frame/getreportdata.phtml ADDED
@@ -0,0 +1 @@
 
0
  // $result_collection = Mage::registry( 'search_result_collection' );
1
  $report = Mage::registry('oct8ne_report');
2
  switch($report)
3
  {
4
  case 'order':
5
  $result_collection = Mage::getModel('oct8ne/orderproducts')->getCollection();
6
  break;
7
  case 'quote':
8
  $result_collection = Mage::getModel('oct8ne/quoteproducts')->getCollection();
9
  break;
10
  }
11
  $from = Mage::registry('oct8ne_from');
12
  $to = Mage::registry('oct8ne_to');
13
 
14
  if(!empty($from)) {
15
  $result_collection->getSelect()->where("created_at >= CAST(? AS DATETIME)", $from);
16
  }
17
  if(!empty($to)) {
18
  $result_collection->getSelect()->where("CAST(? AS DATETIME) > created_at", $to);
19
  }
20
 
21
  //if ( !Mage::registry( 'partial_search' ) )
22
  echo " \"total\": \"".$result_collection->getSize()."\",\n";
23
  "results": [
24
  $values = array(
25
  'ProductId' => $item['product_id'],
26
  'Qty' => $item['qty'],
27
  'UserId' => $item['customer_id'],
28
  'Oct8neSession' => $item['oct8ne'],
29
  'Date' => $item['created_at'],
30
  'ProductPrice' => $item['product_price'],
31
  'Currency' => $item['currency'],
32
  );
33
 
34
  if($report == 'order')
35
  {
36
  $order = Mage::getModel('sales/order')->load($item['order_id']);
37
  if($order != null)
38
  {
39
  $orderValid = 1;
40
  $incrementId = $order->getIncrementId();
41
  $status = $order->getStatus();
42
  }
43
  else
44
  {
45
  $orderValid = 0;
46
  }
47
 
48
  $values += array(
49
  'InternalId' => $item['orderproducts_id'],
50
  'OrderId' => $item['order_id'],
51
  'OrderValid' => $orderValid,
52
  'IncrementId' => $incrementId,
53
  'OrderPrice' => $item[$report . '_price'],
54
  'Status' => $status
55
  );
56
  }
57
  else if($report == 'quote')
58
  {
59
  $quote = Mage::getModel('sales/order')->load($item['quoteproducts_id']);
60
  if($quote != null)
61
  {
62
  $quoteValid = 1;
63
  }
64
  else
65
  {
66
  $quoteValid = 0;
67
  }
68
 
69
  $values += array(
70
  'InternalId' => $item['quoteproducts_id'],
71
  'QuoteId' => $item['quote_id'],
72
  'QuoteValid' => $quoteValid,
73
  'QuotePrice' => $item[$report . '_price'],
74
  );
75
  }
76
  // $d = $order->getCreatedAtStoreDate();
77
  {
78
  <?php $n = 0; foreach($values as $key=>$val) { ?>
79
  "<?php $n++; echo $key ?>": "<?php echo $val ?>"<?php if ( $n < count( $values ) ) echo ",\n"; else echo "\n"; ?>
80
  <?php } ?>
81
 
82
  <?php $k++; if ( $k < count( $result_collection ) ) echo "},\n"; else echo "}\n"; ?>
83
  ]
1
+ <?php
2
  // $result_collection = Mage::registry( 'search_result_collection' );
3
  $report = Mage::registry('oct8ne_report');
4
  switch($report)
5
  {
6
  case 'order':
7
  $result_collection = Mage::getModel('oct8ne/orderproducts')->getCollection();
8
  break;
9
  case 'quote':
10
  $result_collection = Mage::getModel('oct8ne/quoteproducts')->getCollection();
11
  break;
12
  }
13
  $from = Mage::registry('oct8ne_from');
14
  $to = Mage::registry('oct8ne_to');
15
 
16
  if(!empty($from)) {
17
  $result_collection->getSelect()->where("created_at >= CAST(? AS DATETIME)", $from);
18
  }
19
  if(!empty($to)) {
20
  $result_collection->getSelect()->where("CAST(? AS DATETIME) > created_at", $to);
21
  }
22
 
23
  //if ( !Mage::registry( 'partial_search' ) )
24
  echo " \"total\": \"".$result_collection->getSize()."\",\n";
25
  "results": [
26
  $values = array(
27
  'ProductId' => $item['product_id'],
28
  'Qty' => $item['qty'],
29
  'UserId' => $item['customer_id'],
30
  'Oct8neSession' => $item['oct8ne'],
31
  'Date' => $item['created_at'],
32
  'ProductPrice' => $item['product_price'],
33
  'Currency' => $item['currency'],
34
  );
35
 
36
  if($report == 'order')
37
  {
38
  $order = Mage::getModel('sales/order')->load($item['order_id']);
39
  if($order != null)
40
  {
41
  $orderValid = 1;
42
  $incrementId = $order->getIncrementId();
43
  $status = $order->getStatus();
44
  }
45
  else
46
  {
47
  $orderValid = 0;
48
  }
49
 
50
  $values += array(
51
  'InternalId' => $item['orderproducts_id'],
52
  'OrderId' => $item['order_id'],
53
  'OrderValid' => $orderValid,
54
  'IncrementId' => $incrementId,
55
  'OrderPrice' => $item[$report . '_price'],
56
  'Status' => $status
57
  );
58
  }
59
  else if($report == 'quote')
60
  {
61
  $quote = Mage::getModel('sales/order')->load($item['quoteproducts_id']);
62
  if($quote != null)
63
  {
64
  $quoteValid = 1;
65
  }
66
  else
67
  {
68
  $quoteValid = 0;
69
  }
70
 
71
  $values += array(
72
  'InternalId' => $item['quoteproducts_id'],
73
  'QuoteId' => $item['quote_id'],
74
  'QuoteValid' => $quoteValid,
75
  'QuotePrice' => $item[$report . '_price'],
76
  );
77
  }
78
  // $d = $order->getCreatedAtStoreDate();
79
  {
80
  <?php $n = 0; foreach($values as $key=>$val) { ?>
81
  "<?php $n++; echo $key ?>": "<?php echo $val ?>"<?php if ( $n < count( $values ) ) echo ",\n"; else echo "\n"; ?>
82
  <?php } ?>
83
 
84
  <?php $k++; if ( $k < count( $result_collection ) ) echo "},\n"; else echo "}\n"; ?>
85
  ]
app/design/frontend/base/default/template/oct8ne/frame/json-page.phtml CHANGED
@@ -1 +1 @@
1
- <?php echo $this->getChildHtml('content') ?>
1
+ <?php echo $this->getChildHtml('jsoncontent') ?>
app/design/frontend/base/default/template/oct8ne/frame/productrelated.phtml CHANGED
@@ -1,53 +1,50 @@
1
- <?php
2
-
3
- $productId = Mage::registry( 'oct8ne_product_id' );
4
- $numItems = Mage::registry( 'oct8ne_product_related_num_items');
5
- $start = Mage::registry('oct8ne_product_related_start');
6
-
7
- if($start < 0) $start = 0;
8
- if($numItems < 1) $numItems = 1;
9
- //if($page < 1) $page = 1;
10
-
11
- $result_collection = Mage::helper('oct8ne')->getRelatedProducts($productId);
12
-
13
- //$total = 10;
14
- //$start = $total * ($page -1);
15
-
16
- $callback = Mage::registry( 'callback' );
17
-
18
- echo $callback;
19
- ?>({
20
- <?php
21
- if ( !Mage::registry( 'partial_search' ) )
22
- echo " total: \"".count( $result_collection )."\",\n";
23
- ?>
24
- results: [
25
- <?php $i=0;?>
26
- <?php foreach( $result_collection as $item): ?>
27
- <?php if($start <= $i && $i <($start + $numItems)):?>
28
- {
29
- InternalId: "<?php echo $item['id']; ?>",
30
- Title: "<?php echo $item['title']; ?>",
31
- PrevPrice: "<?php echo $item['original_price']; ?>",
32
- Price: "<?php echo $item['price']; ?>",
33
- Description: "<?php echo trim($item['description'], "\r\n\t "); ?>",
34
- Rating: "<?php echo $item['rating']; ?>",
35
- Qty: "<?php echo $item['qty']; ?>",
36
- RouteTo: "<?php echo $item['url']; ?>",
37
- Medias: [
38
- <?php foreach( $item['imgs'] as $j => $image ): ?>
39
- {Id: "<?php echo $j; ?>", FileName: <?php echo '"'.$image['url'].'"'; ?>}<?php if ( $j == count($item['imgs'])-1 ) echo "\n"; else echo ",\n"; ?>
40
- <?php endforeach; ?>
41
- ],
42
- Thumbnail: "<?php echo $item['thumbnail']; ?>"
43
- <?php
44
- if ( $i < count( $result_collection )-1 )
45
- echo "},\n";
46
- else
47
- echo "}\n";
48
- ?>
49
- <?php endif;?>
50
- <?php $i++;?>
51
- <?php endforeach; ?>
52
- ]
53
  });
1
+ <?php
2
+ $productId = Mage::registry( 'oct8ne_product_id' );
3
+ $numItems = Mage::registry( 'oct8ne_product_related_num_items');
4
+ $start = Mage::registry('oct8ne_product_related_start');
5
+
6
+ //if($start < 0) $start = 0;
7
+ //if($numItems < 1) $numItems = 1;
8
+ //if($page < 1) $page = 1;
9
+
10
+ $result_collection = Mage::helper('oct8ne')->getRelatedProducts($productId);
11
+
12
+ //$total = 10;
13
+ //$start = $total * ($page -1);
14
+
15
+ $callback = Mage::registry( 'callback' );
16
+
17
+ echo $callback;
18
+ ?>({
19
+ <?php
20
+ if ( !Mage::registry( 'partial_search' ) )
21
+ echo " total: \"".count( $result_collection )."\",\n";
22
+ ?>
23
+ results: [
24
+ <?php $i=0;?>
25
+ <?php foreach( $result_collection as $item): ?>
26
+ {
27
+ InternalId: "<?php echo $item['id']; ?>",
28
+ Title: "<?php echo $item['title']; ?>",
29
+ PrevPrice: "<?php echo $item['original_price']; ?>",
30
+ Price: "<?php echo $item['price']; ?>",
31
+ Description: "<?php echo trim($item['description'], "\r\n\t "); ?>",
32
+ Rating: "<?php echo $item['rating']; ?>",
33
+ Qty: "<?php echo $item['qty']; ?>",
34
+ RouteTo: "<?php echo $item['url']; ?>",
35
+ Medias: [
36
+ <?php foreach( $item['imgs'] as $j => $image ): ?>
37
+ {Id: "<?php echo $j; ?>", FileName: <?php echo '"'.$image['url'].'"'; ?>}<?php if ( $j == count($item['imgs'])-1 ) echo "\n"; else echo ",\n"; ?>
38
+ <?php endforeach; ?>
39
+ ],
40
+ Thumbnail: "<?php echo $item['thumbnail']; ?>"
41
+ <?php
42
+ if ( $i < count( $result_collection )-1 )
43
+ echo "},\n";
44
+ else
45
+ echo "}\n";
46
+ ?>
47
+ <?php $i++;?>
48
+ <?php endforeach; ?>
49
+ ]
 
 
 
50
  });
app/design/frontend/base/default/template/oct8ne/letssyncro.phtml CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  global $letssyncro;
3
 
 
 
4
  $req = Mage::app()->getRequest();
5
  // Deshabilitar iframe al ver imágenes de productos
6
  $disable = ($req->getModuleName() == 'catalog' && $req->getActionName() == 'gallery');
@@ -29,8 +31,8 @@ if (!isset($letssyncro)) {
29
  <!-- LetsSyncro block (idnovate.com for LetsSyncro LLC)-->
30
  ";
31
  */
32
- $baseurl = Mage::getBaseUrl();
33
- $checkouturl = Mage::helper('checkout/url')->getCheckoutUrl();
34
  $loginurl = Mage::helper('customer')->getLoginUrl();
35
  $currency = Mage::app()->getStore()->getCurrentCurrencyCode();
36
  $store = Mage::app()->getStore()->getId();
@@ -66,6 +68,8 @@ if (!isset($letssyncro)) {
66
 
67
  $plugin = Mage::helper('oct8ne')->getExtensionVersion();
68
 
 
 
69
  echo <<<EOT
70
  <script type= "text/javascript">
71
  var oct8ne = document.createElement("script");
@@ -82,6 +86,7 @@ if (!isset($letssyncro)) {
82
  oct8ne.store = "$store";
83
  oct8ne.searchTerm = "$searchterm";
84
  oct8ne.productList = $productlist;
 
85
  var s = document.getElementsByTagName("script")[0];
86
  s.parentNode.insertBefore(oct8ne, s);
87
  </script>
1
  <?php
2
  global $letssyncro;
3
 
4
+ function _letsyncro_remove_http($str) { return preg_replace('#^https?:#', '', $str); }
5
+
6
  $req = Mage::app()->getRequest();
7
  // Deshabilitar iframe al ver imágenes de productos
8
  $disable = ($req->getModuleName() == 'catalog' && $req->getActionName() == 'gallery');
31
  <!-- LetsSyncro block (idnovate.com for LetsSyncro LLC)-->
32
  ";
33
  */
34
+ $baseurl = _letsyncro_remove_http(Mage::getBaseUrl());
35
+ $checkouturl = _letsyncro_remove_http(Mage::helper('checkout/url')->getCheckoutUrl());
36
  $loginurl = Mage::helper('customer')->getLoginUrl();
37
  $currency = Mage::app()->getStore()->getCurrentCurrencyCode();
38
  $store = Mage::app()->getStore()->getId();
68
 
69
  $plugin = Mage::helper('oct8ne')->getExtensionVersion();
70
 
71
+ $locale = str_replace('_', '-', Mage::app()->getLocale()->getLocaleCode());
72
+
73
  echo <<<EOT
74
  <script type= "text/javascript">
75
  var oct8ne = document.createElement("script");
86
  oct8ne.store = "$store";
87
  oct8ne.searchTerm = "$searchterm";
88
  oct8ne.productList = $productlist;
89
+ oct8ne.locale = "$locale";
90
  var s = document.getElementsByTagName("script")[0];
91
  s.parentNode.insertBefore(oct8ne, s);
92
  </script>
app/design/frontend/default/oct8ne/layout/oct8ne.xml ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <layout version="0.1.0">
3
+
4
+ <default>
5
+ <reference name="head">
6
+ <action method="addCss"><script>oct8ne.css</script></action>
7
+ </reference>
8
+ </default>
9
+
10
+ <default>
11
+ <!-- fem que la crida es faci al final de la pàgina per tal que no afecti a elements pendents de càrrega-->
12
+ <reference name="before_body_end">
13
+ <block type="core/template" name="oct8ne_script" template="oct8ne/letssyncro.phtml">
14
+ </block>
15
+ </reference>
16
+ </default>
17
+
18
+
19
+ <oct8ne_frame_customerdata>
20
+ <reference name="root">
21
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
22
+ </reference>
23
+
24
+ <reference name="content">
25
+ <block type="core/template" template="oct8ne/frame/customer/data.phtml" />
26
+ </reference>
27
+ </oct8ne_frame_customerdata>
28
+
29
+
30
+
31
+ <oct8ne_frame_add2cart>
32
+ <reference name="root">
33
+ <action method="setTemplate"><template>oct8ne/frame/naked-page.phtml</template></action>
34
+ </reference>
35
+
36
+ <reference name="content">
37
+ <block type="core/template" template="oct8ne/frame/add2cart.phtml" />
38
+ </reference>
39
+ </oct8ne_frame_add2cart>
40
+
41
+
42
+ <oct8ne_frame_search>
43
+ <reference name="root">
44
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
45
+ </reference>
46
+
47
+ <reference name="content">
48
+ <block type="core/template" template="oct8ne/frame/search.phtml" />
49
+ </reference>
50
+ </oct8ne_frame_search>
51
+
52
+
53
+ <oct8ne_frame_productview>
54
+
55
+ <reference name="head">
56
+ <action method="addJs"><script>varien/product.js</script></action>
57
+ </reference>
58
+
59
+ <!-- <block type="core/template_facade" name="root" template="oct8ne/frame/productview.phtml"/> -->
60
+
61
+ <label>Catalog Product View (Any)</label>
62
+ <!-- Mage_Catalog -->
63
+ <reference name="head">
64
+ <remove name="oct8ne_script" />
65
+ </reference>
66
+ <reference name="root">
67
+ <!-- <action method="setTemplate"><template>page/2columns-right.phtml</template></action> -->
68
+ <action method="setTemplate"><template>oct8ne/frame/clean-page.phtml</template></action>
69
+ </reference>
70
+ <reference name="head">
71
+ <action method="addJs"><script>varien/product.js</script></action>
72
+ <action method="addJs"><script>varien/configurable.js</script></action>
73
+
74
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
75
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
76
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
77
+ </reference>
78
+ <reference name="content">
79
+ <block type="catalog/product_view" name="product.info" template="oct8ne/frame/productview.phtml">
80
+
81
+ <block type="catalog/product_view_media" name="product.info.media" as="media" template="oct8ne/frame/productview/media.phtml"/>
82
+ <block type="core/text_list" name="alert.urls" as="alert_urls" translate="label">
83
+ <label>Alert Urls</label>
84
+ </block>
85
+
86
+ <action method="setTierPriceTemplate"><template>catalog/product/view/tierprices.phtml</template></action>
87
+
88
+ <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="oct8ne/frame/productview/list/upsell.phtml">
89
+ <action method="setColumnCount"><columns>4</columns></action>
90
+ <action method="setItemLimit"><type>upsell</type><limit>4</limit></action>
91
+ </block>
92
+
93
+ <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
94
+ <block type="catalog/product_view_description" name="product.description" as="description" template="oct8ne/frame/productview/description.phtml">
95
+ <action method="addToParentGroup"><group>detailed_info</group></action>
96
+ </block>
97
+ <block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="oct8ne/frame/productview/attributes.phtml">
98
+ <action method="addToParentGroup"><group>detailed_info</group></action>
99
+ </block>
100
+ <block type="catalog/product_view" name="product.info.addto" as="addto" template="oct8ne/frame/productview/addto.phtml"/>
101
+ <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="oct8ne/frame/productview/addtocart.phtml"/>
102
+
103
+ <block type="core/text_list" name="product.info.extrahint" as="extrahint" translate="label">
104
+ <label>Product View Extra Hint</label>
105
+ </block>
106
+
107
+ <block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="oct8ne/frame/productview/options/wrapper.phtml" translate="label">
108
+ <label>Info Column Options Wrapper</label>
109
+ <block type="core/template" name="options_js" template="oct8ne/frame/productview/options/js.phtml"/>
110
+ <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="oct8ne/frame/productview/options.phtml">
111
+ <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action>
112
+ <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action>
113
+ <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action>
114
+ <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action>
115
+ </block>
116
+ <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
117
+ </block>
118
+ <block type="catalog/product_view" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="oct8ne/frame/productview/options/wrapper/bottom.phtml" translate="label">
119
+ <label>Bottom Block Options Wrapper</label>
120
+ <action method="insert"><block>product.tierprices</block></action>
121
+ <block type="catalog/product_view" name="product.clone_prices" as="prices" template="oct8ne/frame/productview/price_clone.phtml"/>
122
+ <action method="append"><block>product.info.addtocart</block></action>
123
+ <action method="append"><block>product.info.addto</block></action>
124
+ </block>
125
+
126
+ <block type="core/template_facade" name="product.info.container1" as="container1">
127
+ <action method="setDataByKey"><key>alias_in_layout</key><value>container1</value></action>
128
+ <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
129
+ <action method="append"><block>product.info.options.wrapper</block></action>
130
+ <action method="append"><block>product.info.options.wrapper.bottom</block></action>
131
+ </block>
132
+ <block type="core/template_facade" name="product.info.container2" as="container2">
133
+ <action method="setDataByKey"><key>alias_in_layout</key><value>container2</value></action>
134
+ <action method="setDataByKeyFromRegistry"><key>options_container</key><key_in_registry>product</key_in_registry></action>
135
+ <action method="append"><block>product.info.options.wrapper</block></action>
136
+ <action method="append"><block>product.info.options.wrapper.bottom</block></action>
137
+ </block>
138
+ <action method="unsetCallChild"><child>container1</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
139
+ <action method="unsetCallChild"><child>container2</child><call>ifEquals</call><if>0</if><key>alias_in_layout</key><key>options_container</key></action>
140
+ </block>
141
+ </reference>
142
+ <reference name="right">
143
+ <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="oct8ne/frame/productview/list/related.phtml"/>
144
+ </reference>
145
+
146
+ </oct8ne_frame_productview>
147
+
148
+
149
+ <oct8ne_frame_search2 translate="label">
150
+ <label>Oct8ne Search</label>
151
+ <reference name="root">
152
+ <action method="setTemplate"><template>page/3columns.phtml</template></action>
153
+ </reference>
154
+ <reference name="left">
155
+ <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
156
+ </reference>
157
+ <reference name="content">
158
+ <block type="catalogsearch/result" name="search.result" template="catalogsearch/result.phtml">
159
+ <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml">
160
+ <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
161
+ <block type="page/html_pager" name="product_list_toolbar_pager"/>
162
+ </block>
163
+ <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
164
+ <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
165
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
166
+ <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
167
+ <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
168
+ <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
169
+ </block>
170
+ <action method="setListOrders"/>
171
+ <action method="setListModes"/>
172
+ <action method="setListCollection"/>
173
+ </block>
174
+ </reference>
175
+ </oct8ne_frame_search2>
176
+
177
+ <customer_account_loginpost>
178
+ <reference name="root">
179
+ <action method="setTemplate"><template>oct8ne/frame/naked-page.phtml</template></action>
180
+ </reference>
181
+
182
+ <reference name="content">
183
+ <block type="core/template" template="oct8ne/frame/loginpost.phtml" />
184
+ </reference>
185
+ </customer_account_loginpost>
186
+
187
+ <oct8ne_frame_getcart>
188
+ <reference name="root">
189
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
190
+ </reference>
191
+
192
+ <reference name="content">
193
+ <block type="core/template" template="oct8ne/frame/getcart.phtml" />
194
+ </reference>
195
+ </oct8ne_frame_getcart>
196
+
197
+ <oct8ne_frame_getwishlist>
198
+ <reference name="root">
199
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
200
+ </reference>
201
+
202
+ <reference name="content">
203
+ <block type="core/template" template="oct8ne/frame/getwishlist.phtml" />
204
+ </reference>
205
+ </oct8ne_frame_getwishlist>
206
+
207
+ <oct8ne_frame_addtowishlist>
208
+ <reference name="root">
209
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
210
+ </reference>
211
+
212
+ <reference name="content">
213
+ <block type="core/template" template="oct8ne/frame/addtowishlist.phtml" />
214
+ </reference>
215
+ </oct8ne_frame_addtowishlist>
216
+
217
+ <oct8ne_frame_removefromwishlist>
218
+ <reference name="root">
219
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
220
+ </reference>
221
+
222
+ <reference name="content">
223
+ <block type="core/template" template="oct8ne/frame/removefromwishlist.phtml" />
224
+ </reference>
225
+ </oct8ne_frame_removefromwishlist>
226
+
227
+ <oct8ne_frame_productinfo>
228
+ <reference name="root">
229
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
230
+ </reference>
231
+
232
+ <reference name="content">
233
+ <block type="core/template" template="oct8ne/frame/productinfo.phtml" />
234
+ </reference>
235
+ </oct8ne_frame_productinfo>
236
+
237
+ <oct8ne_frame_productrelated>
238
+ <reference name="root">
239
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
240
+ </reference>
241
+
242
+ <reference name="content">
243
+ <block type="core/template" template="oct8ne/frame/productrelated.phtml" />
244
+ </reference>
245
+ </oct8ne_frame_productrelated>
246
+ </layout>
app/etc/modules/LetsSyncroLLC_Oct8ne.xml CHANGED
@@ -4,7 +4,7 @@
4
  <LetsSyncroLLC_Oct8ne>
5
  <active>true</active>
6
  <codePool>community</codePool>
7
- <version>1.1.5</version>
8
  <depends>
9
  <Mage_Eav/>
10
  <Mage_Dataflow/>
4
  <LetsSyncroLLC_Oct8ne>
5
  <active>true</active>
6
  <codePool>community</codePool>
7
+ <version>1.1.8</version>
8
  <depends>
9
  <Mage_Eav/>
10
  <Mage_Dataflow/>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>LetsSyncroLLC_Oct8ne</name>
4
- <version>1.1.5</version>
5
  <stability>stable</stability>
6
  <license>license</license>
7
  <channel>community</channel>
@@ -10,8 +10,8 @@
10
  <description>Oct8ne extension description</description>
11
  <notes>Notes</notes>
12
  <authors><author><name>Oct8ne</name><user>Oct8ne</user><email>xavier.gonzalez@oct8ne.com</email></author></authors>
13
- <date>2014-03-21</date>
14
- <time>10:39:11</time>
15
  <contents>
16
  <target name="magecommunity">
17
  <dir name="LetsSyncroLLC">
@@ -23,6 +23,11 @@
23
  </dir>
24
  <dir name="Html">
25
  <file name="Head.php" hash="3052f7a7e9d8adfe0eb0f4484f789b36"/>
 
 
 
 
 
26
  </dir>
27
  <file name="Index.php" hash="d4cc07e7e6412cb9f3cedf2508f56461"/>
28
  </dir>
@@ -41,6 +46,9 @@
41
  <dir name="Mage">
42
  <file name="Onepage.php" hash="09bdc97f5328062520758798a2b5545c"/>
43
  <file name="Url.php" hash="9811f73a73b5f1bd216442150f854a70"/>
 
 
 
44
  </dir>
45
  <dir name="Mysql4">
46
  <dir name="LetsSyncro">
@@ -49,11 +57,16 @@
49
  <file name="Letssyncro.php" hash="81b49a4f7770d408eacd230a41434cbf"/>
50
  <dir name="Orderproducts">
51
  <file name="Collection.php" hash="d41809333ca198109c3e0511790a333b"/>
 
 
 
52
  </dir>
53
  <file name="Orderproducts.php" hash="4c05fe63b71bbc669d7053915969ea0c"/>
 
54
  </dir>
55
  <file name="Observer.php" hash="35c7a2608b071457d02ef3d0bc31f542"/>
56
  <file name="Orderproducts.php" hash="96432b6c3a3abdd58d9f9657a6432e18"/>
 
57
  </dir>
58
  <dir name="controllers">
59
  <file name="AccountController.php" hash="492f053985eca9a14bc1abf698966d77"/>
@@ -71,6 +84,7 @@
71
  <file name="mysql4-install-0.5.0.php" hash="51668af264bb01c6607c68964ac6bdb7"/>
72
  <file name="mysql4-install-1.0.0.php" hash="51668af264bb01c6607c68964ac6bdb7"/>
73
  <file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="0de801ad4896defa9491391754ee7229"/>
 
74
  </dir>
75
  </dir>
76
  </dir>
@@ -85,6 +99,9 @@
85
  <dir name="frontend">
86
  <dir name="default">
87
  <dir name="oct8ne">
 
 
 
88
  <dir name="template">
89
  <dir name="page">
90
  <file name="1column.phtml" hash="c5e128243cfdf8b6b4abe2f297ec8335"/>
@@ -112,6 +129,7 @@
112
  </dir>
113
  <file name="getcart.phtml" hash="f67bacfaf225c8972a52de542cac1d69"/>
114
  <file name="getwishlist.phtml" hash="4e00716786afcebad70c7f72000b998e"/>
 
115
  <file name="json-page.phtml" hash="509893c584213ad7d78e17a1a53249d1"/>
116
  <file name="loginpost.phtml" hash="ea57cb60b282d1fc60186503f6909176"/>
117
  <file name="naked-page.phtml" hash="6b9275b9ba11e9c79610b52e423e5dda"/>
@@ -177,6 +195,13 @@
177
  </dir>
178
  </target>
179
  <target name="mageskin">
 
 
 
 
 
 
 
180
  <dir name="adminhtml">
181
  <dir name="default">
182
  <dir name="default">
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>LetsSyncroLLC_Oct8ne</name>
4
+ <version>1.1.9</version>
5
  <stability>stable</stability>
6
  <license>license</license>
7
  <channel>community</channel>
10
  <description>Oct8ne extension description</description>
11
  <notes>Notes</notes>
12
  <authors><author><name>Oct8ne</name><user>Oct8ne</user><email>xavier.gonzalez@oct8ne.com</email></author></authors>
13
+ <date>2014-05-15</date>
14
+ <time>16:34:43</time>
15
  <contents>
16
  <target name="magecommunity">
17
  <dir name="LetsSyncroLLC">
23
  </dir>
24
  <dir name="Html">
25
  <file name="Head.php" hash="3052f7a7e9d8adfe0eb0f4484f789b36"/>
26
+ </dir>
27
+ <dir name="Mage">
28
+ <dir name="Product">
29
+ <file name="View.php" hash="3052f7a7e9d8adfe0eb0f4484f789b36"/>
30
+ </dir>
31
  </dir>
32
  <file name="Index.php" hash="d4cc07e7e6412cb9f3cedf2508f56461"/>
33
  </dir>
46
  <dir name="Mage">
47
  <file name="Onepage.php" hash="09bdc97f5328062520758798a2b5545c"/>
48
  <file name="Url.php" hash="9811f73a73b5f1bd216442150f854a70"/>
49
+ <file name="Package.php" hash="9811f73a73b5f1bd216442150f854a70"/>
50
+ <file name="Rewrite.php" hash="9811f73a73b5f1bd216442150f854a70"/>
51
+ <file name="Request.php" hash="9811f73a73b5f1bd216442150f854a70"/>
52
  </dir>
53
  <dir name="Mysql4">
54
  <dir name="LetsSyncro">
57
  <file name="Letssyncro.php" hash="81b49a4f7770d408eacd230a41434cbf"/>
58
  <dir name="Orderproducts">
59
  <file name="Collection.php" hash="d41809333ca198109c3e0511790a333b"/>
60
+ </dir>
61
+ <dir name="Quoteproducts">
62
+ <file name="Collection.php" hash="d41809333ca198109c3e0511790a333b"/>
63
  </dir>
64
  <file name="Orderproducts.php" hash="4c05fe63b71bbc669d7053915969ea0c"/>
65
+ <file name="Quoteproducts.php" hash="4c05fe63b71bbc669d7053915969ea0c"/>
66
  </dir>
67
  <file name="Observer.php" hash="35c7a2608b071457d02ef3d0bc31f542"/>
68
  <file name="Orderproducts.php" hash="96432b6c3a3abdd58d9f9657a6432e18"/>
69
+ <file name="Quoteproducts.php" hash="96432b6c3a3abdd58d9f9657a6432e18"/>
70
  </dir>
71
  <dir name="controllers">
72
  <file name="AccountController.php" hash="492f053985eca9a14bc1abf698966d77"/>
84
  <file name="mysql4-install-0.5.0.php" hash="51668af264bb01c6607c68964ac6bdb7"/>
85
  <file name="mysql4-install-1.0.0.php" hash="51668af264bb01c6607c68964ac6bdb7"/>
86
  <file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="0de801ad4896defa9491391754ee7229"/>
87
+ <file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="0de801ad4896defa9491391754ee7229"/>
88
  </dir>
89
  </dir>
90
  </dir>
99
  <dir name="frontend">
100
  <dir name="default">
101
  <dir name="oct8ne">
102
+ <dir name="layout">
103
+ <file name="oct8ne.xml" hash="c5e128243cfdf8b6b4abe2f297ec8335"/>
104
+ </dir>
105
  <dir name="template">
106
  <dir name="page">
107
  <file name="1column.phtml" hash="c5e128243cfdf8b6b4abe2f297ec8335"/>
129
  </dir>
130
  <file name="getcart.phtml" hash="f67bacfaf225c8972a52de542cac1d69"/>
131
  <file name="getwishlist.phtml" hash="4e00716786afcebad70c7f72000b998e"/>
132
+ <file name="getreportdata.phtml" hash="4e00716786afcebad70c7f72000b998e"/>
133
  <file name="json-page.phtml" hash="509893c584213ad7d78e17a1a53249d1"/>
134
  <file name="loginpost.phtml" hash="ea57cb60b282d1fc60186503f6909176"/>
135
  <file name="naked-page.phtml" hash="6b9275b9ba11e9c79610b52e423e5dda"/>
195
  </dir>
196
  </target>
197
  <target name="mageskin">
198
+ <dir name="frontend">
199
+ <dir name="base">
200
+ <dir name="default">
201
+ <file name="oct8ne.css" hash="2104af20cc380d0c745531e1dca2f97c"/>
202
+ </dir>
203
+ </dir>
204
+ </dir>
205
  <dir name="adminhtml">
206
  <dir name="default">
207
  <dir name="default">
skin/frontend/base/default/oct8ne.css ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .page-empty {
2
+ padding: 0;
3
+ }
4
+
5
+ .add-to-box .add-to-links, .add-to-box .or
6
+ {
7
+ display: none;
8
+ }
9
+
10
+ .product-shop .email-friend
11
+ {
12
+ display: none;
13
+ }
14
+
15
+ .rating-links a, .rating-links span
16
+ {
17
+ display: none;
18
+ }
19
+
20
+ .product-collateral .box-tags
21
+ {
22
+ display: none;
23
+ }
24
+
25
+ .paypal-logo
26
+ {
27
+ display: none;
28
+ }