LetsSyncroLLC_Oct8ne - Version 1.1.7

Version Notes

Notes

Download this release

Release Info

Developer Oct8ne
Extension LetsSyncroLLC_Oct8ne
Version 1.1.7
Comparing to
See all releases


Code changes from version 1.1.5 to 1.1.7

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/Helper/Data.php CHANGED
@@ -1,125 +1,144 @@
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
+ foreach( $gallery_data['images'] as $image )
16
+ $v[] = array(
17
+ // 'url' => Mage::getBaseUrl('media').'catalog/product'.$image['file']
18
+ // 'url' => Mage::getUrl('oct8ne/frame/image', array('file' => 'catalog/product'.$image['file']))
19
+ 'url' => self::_remove_http(Mage::getUrl('oct8ne/frame/image') . '?file=' . 'catalog/product'.$image['file'])
20
+ );
21
+
22
+ return $v;
23
+ }
24
+
25
+ static protected $_productThumbnail = array();
26
+ static public function getProductThumbnail($product, $width = null)
27
+ {
28
+ $id = $product->getId();
29
+ if (array_key_exists($id, self::$_productThumbnail)) {
30
+ return self::$_productThumbnail[$id];
31
+ }
32
+ $thumb = Mage::helper('catalog/image')->init($product, 'thumbnail');
33
+
34
+ if(!is_null($width))
35
+ $thumb->resize($width);
36
+
37
+ $file = (string)$thumb;
38
+
39
+ self::$_productThumbnail[$id] = $file;
40
+
41
+ return $file;
42
+ }
43
+
44
+ static public function getProductInfo($product_id, $qty = null)
45
+ {
46
+ $product = Mage::getModel('catalog/product')->load( $product_id );
47
+ // $description = str_replace( array("\r\n", "\n", "\r"), "\\n", htmlentities ($product->getDescription()) );
48
+ $description = htmlspecialchars($product->getDescription(), ENT_QUOTES, "UTF-8");
49
+ $description = trim($description, "\r\n\t ");
50
+ $description = str_replace("\r", "", $description);
51
+ $description = str_replace("\t", "", $description);
52
+ $description = str_replace("\n", "<br/>", $description);
53
+ $tmp = is_null($qty) ? array() : array('qty' => $qty);
54
+ return array_merge($tmp, array(
55
+ 'id' => $product->getId(),
56
+ 'title' => htmlspecialchars($product->getName(), ENT_QUOTES, "UTF-8"), // htmlentities( $product->getName() ),
57
+ // 'price' => sprintf( "%.02f$currency", is_numeric($product->getSpecialPrice()) ? $product->getSpecialPrice() : $product->getPrice() ),
58
+ //'price' => Mage::helper('core')->currency(number_format($product->getFinalPrice(), '2', '.', ',')),
59
+ 'original_price' => number_format(
60
+ Mage::helper('core')->currency( $product->getPrice(), false, false ),
61
+ '2', '.', ','
62
+ ),
63
+ 'price' => number_format( Mage::helper('core')->currency($product->getFinalPrice(), false, false), '2', '.', ',' ),
64
+ 'description' => $description,
65
+ 'url' => self::_remove_http(Mage::helper('oct8ne')->getProductFullUrl( $product )),
66
+ 'imgs' => Mage::helper('oct8ne')->getProductImagesUrl( $product ),
67
+ 'thumbnail' => self::_remove_http(Mage::helper('oct8ne')->getProductThumbnail( $product, 120 )),
68
+ 'rating' => self::getProductRating($product_id)
69
+ ));
70
+ }
71
+
72
+ static public function getProductRating($productId)
73
+ {
74
+ // Obtener la colección de reviews
75
+ $reviews = Mage::getModel('review/review')
76
+ ->getResourceCollection()
77
+ ->addStoreFilter(Mage::app()->getStore()->getId())
78
+ ->addEntityFilter('product', $productId)
79
+ ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
80
+ ->setDateOrder()
81
+ ->addRateVotes();
82
+ // Calcular la media de ratings/reviews
83
+ $avg = 0;
84
+ $ratings = array();
85
+ if (count($reviews) > 0) {
86
+ foreach ($reviews->getItems() as $review) {
87
+ foreach( $review->getRatingVotes() as $vote ) {
88
+ $ratings[] = $vote->getPercent();
89
+ }
90
+ }
91
+ $avg = array_sum($ratings)/count($ratings);
92
+ }
93
+ else
94
+ {
95
+ return 'no-rating';
96
+ }
97
+ return $avg;
98
+ }
99
+
100
+ static public function getRelatedProducts($productId)
101
+ {
102
+ // obtener categorias del producto $productId
103
+ $product = Mage::getModel('catalog/product')->load($productId);
104
+ $cats = $product->getCategoryIds();
105
+
106
+ // buscar todos los productos de las categorias obtenidas
107
+ $productsInfo = array();
108
+ $productIds = array();
109
+ foreach ($cats as $category_id) {
110
+ $cat = Mage::getModel('catalog/category')->load($category_id) ;
111
+
112
+ $collection = $cat->getProductCollection();
113
+ $collection->addAttributeToFilter('visibility', 4);
114
+ //get all products in this category
115
+ foreach ($collection as $product){
116
+ if(!in_array($product->getId(), $productIds) && $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED){
117
+ $productIds[$product->getId()] = $product->getId();
118
+ $productsInfo[] = self::getProductInfo($product->getId());
119
+ }
120
+ }
121
+ }
122
+
123
+ // retornar array de getProductInfo();
124
+ return $productsInfo;
125
+ }
126
+
127
+ public function getExtensionVersion() {
128
+ return (string) Mage::getConfig()->getNode()->modules->LetsSyncroLLC_Oct8ne->version;
129
+ }
130
+
131
+ protected function _remove_http($str)
132
+ {
133
+ return preg_replace('#^https?:#', '', $str);
134
+ }
135
+
136
+ /*
137
+ static public function getOrderReport($from, $to)
138
+ {
139
+ // obtener categorias del producto $productId
140
+ $items = Mage::getModel('oct8ne/orderproducts')->getCollection();
141
+ return $productsInfo;
142
+ }
143
+ */
144
+ };
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,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
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,167 @@
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
+ $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
+ $qty = $item->getQtyOrdered();
109
+ /*
110
+ foreach($oct8ne_products as $op)
111
+ {
112
+ $found = false;
113
+ if($op->getId() == $product->getId())
114
+ $found = true;
115
+ }
116
+ */
117
+ $found = in_array($product->getId(), $oct8ne_products);
118
+ $session = Mage::getModel('core/cookie')->get('oct8ne-session');
119
+
120
+ $model = Mage::getModel('oct8ne/orderproducts');
121
+ $model->setOrderId($order->getId());
122
+ $model->setCustomerId($order->getCustomerId());
123
+ $model->setProductId($product->getId());
124
+ $model->setProductPrice($product->getPrice());
125
+ $model->setOrderPrice($order->getGrandTotal());
126
+ $model->setCreatedAt($order->getCreatedAt());
127
+ // $model->setOct8ne($found?'Y':'N');
128
+ $model->setOct8ne($session);
129
+ $model->setQty($qty);
130
+ $model->setCurrency($order->getOrderCurrency()->getCode());
131
+ $model->save();
132
+ }
133
+ }
134
+
135
+ public function saveQuoteAfter($observer)
136
+ {
137
+ $quote = $observer->getEvent()->getQuote();
138
+ // Eliminar los datos anteriores
139
+ foreach (Mage::getModel('oct8ne/quoteproducts')->getCollection()->addFilter('quote_id', $quote->getId()) as $ccitem) {
140
+ $ccitem->delete();
141
+ }
142
+
143
+ // Añadir los nuevos
144
+ $items = $quote->getAllItems();
145
+ foreach($items as $item)
146
+ {
147
+ $product = $item->getProduct();
148
+ $qty = $item->getQty();
149
+
150
+ $session = Mage::getModel('core/cookie')->get('oct8ne-session');
151
+
152
+ $model = Mage::getModel('oct8ne/quoteproducts');
153
+ $model->setQuoteId($quote->getId());
154
+ $model->setCustomerId($quote->getCustomerId());
155
+ $model->setProductId($product->getId());
156
+ $model->setProductPrice($product->getPrice());
157
+ $model->setQuotePrice($quote->getGrandTotal());
158
+ $model->setCreatedAt($quote->getCreatedAt());
159
+ $model->setOct8ne($session);
160
+ $model->setQty($qty);
161
+ $model->setCurrency($quote->getQuoteCurrencyCode());
162
+ $model->save();
163
+
164
+ // echo $order->getOrderCurrency()->getCode(); /* $item['oct8ne']; */
165
+ }
166
+ }
167
+ }
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,810 @@
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
+ // $this->_checkApitoken();
35
+
36
+ // Get initial data from request
37
+ $categoryId = (int) $this->getRequest()->getParam('category', false);
38
+ $productId = (int) $this->getRequest()->getParam('id');
39
+ $specifyOptions = $this->getRequest()->getParam('options');
40
+
41
+ // Prepare helper and params
42
+ $viewHelper = Mage::helper('catalog/product_view');
43
+
44
+ $params = new Varien_Object();
45
+ $params->setCategoryId($categoryId);
46
+ $params->setSpecifyOptions($specifyOptions);
47
+
48
+ // Render page
49
+ try {
50
+ $viewHelper->prepareAndRender($productId, $this, $params);
51
+ } catch (Exception $e) {
52
+ if ($e->getCode() == $viewHelper->ERR_NO_PRODUCT_LOADED) {
53
+ if (isset($_GET['store']) && !$this->getResponse()->isRedirect()) {
54
+ $this->_redirect('');
55
+ } elseif (!$this->getResponse()->isRedirect()) {
56
+ $this->_forward('noRoute');
57
+ }
58
+ } else {
59
+ Mage::logException($e);
60
+ $this->_forward('noRoute');
61
+ }
62
+ }
63
+
64
+ }
65
+
66
+ /**
67
+ * Initialize product instance from request data
68
+ *
69
+ * @return Mage_Catalog_Model_Product || false
70
+ */
71
+ protected function _initProduct() {
72
+ $productId = (int) $this->getRequest()->getParam('product');
73
+
74
+ if ($productId) {
75
+ $product = Mage::getModel('catalog/product')
76
+ ->setStoreId(Mage::app()->getStore()->getId())
77
+ ->load($productId);
78
+ if ($product->getId())
79
+ return $product;
80
+ }
81
+
82
+ return false;
83
+ }
84
+
85
+ public function add2cartAction() {
86
+ // $this->_checkApitoken();
87
+
88
+
89
+ $cart = $this->_getCart();
90
+ $params = $this->getRequest()->getParams();
91
+ try {
92
+ if (isset($params['qty'])) {
93
+ $filter = new Zend_Filter_LocalizedToNormalized(
94
+ array('locale' => Mage::app()->getLocale()->getLocaleCode())
95
+ );
96
+ $params['qty'] = $filter->filter($params['qty']);
97
+ }
98
+
99
+ $product = $this->_initProduct();
100
+ $related = $this->getRequest()->getParam('related_product');
101
+
102
+ /**
103
+ * Check product availability
104
+ */
105
+ if ( !$product ) {
106
+ $this->_goBack();
107
+ return;
108
+ }
109
+
110
+ $cart->addProduct($product, $params);
111
+
112
+ if (!empty($related)) {
113
+ $cart->addProductsByIds(explode(',', $related));
114
+ }
115
+
116
+ $cart->save();
117
+
118
+ $this->_getSession()->setCartWasUpdated(true);
119
+
120
+ /**
121
+ * @todo remove wishlist observer processAddToCart
122
+ */
123
+ Mage::dispatchEvent('checkout_cart_add_product_complete',
124
+ array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
125
+ );
126
+
127
+ if (!$cart->getQuote()->getHasError()){
128
+ $products = $this->_getSession()->getOct8neProducts();
129
+ if(!is_array($products))
130
+ $products = array();
131
+ $products[] = $product->getId();
132
+ $this->_getSession()->setOct8neProducts($products);
133
+
134
+ // Este mensaje se deshabilita porque sale a destiempo, cuando el parámetro no sea oct8ne
135
+ // $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));
136
+ // $this->_getSession()->addSuccess($message);
137
+ }
138
+
139
+
140
+ $this->loadLayout();
141
+ $this->renderLayout();
142
+
143
+ } catch (Mage_Core_Exception $e) {
144
+ if ($this->_getSession()->getUseNotice(true)) {
145
+ $this->_getSession()->addNotice(Mage::helper('core')->escapeHtml($e->getMessage()));
146
+ } else {
147
+ $messages = array_unique(explode("\n", $e->getMessage()));
148
+ foreach ($messages as $message)
149
+ $this->_getSession()->addError(Mage::helper('core')->escapeHtml($message));
150
+ }
151
+
152
+ } catch (Exception $e) {
153
+ // $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));
154
+ Mage::logException($e);
155
+ $this->_goBack();
156
+ }
157
+
158
+ }
159
+
160
+ /**
161
+ * Retrieve child categories of current category
162
+ *
163
+ * @return Varien_Data_Tree_Node_Collection
164
+ */
165
+ public function getCurrentChildCategories()
166
+ {
167
+ $layer = Mage::getSingleton('catalog/layer');
168
+ $category = $layer->getCurrentCategory();
169
+ /* @var $category Mage_Catalog_Model_Category */
170
+ $categories = $category->getChildrenCategories();
171
+ $productCollection = Mage::getResourceModel('catalog/product_collection');
172
+ $layer->prepareProductCollection($productCollection);
173
+ $productCollection->addCountToCategories($categories);
174
+ return $categories;
175
+ }
176
+
177
+
178
+ /**
179
+ * Retrieve request object
180
+ *
181
+ * @return Mage_Core_Controller_Request_Http
182
+ * @throws Exception
183
+ */
184
+ public function getRequest()
185
+ {
186
+ $controller = Mage::app()->getFrontController();
187
+ if ($controller) {
188
+ $this->_request = $controller->getRequest();
189
+ } else {
190
+ throw new Exception(Mage::helper('core')->__("Can't retrieve request object"));
191
+ }
192
+ return $this->_request;
193
+ }
194
+
195
+ protected function searchAction()
196
+ {
197
+ // $this->_checkApitoken();
198
+
199
+ $search_criteria = $this->getRequest()->getParam('search', null);
200
+ $search_order = $this->getRequest()->getParam('orderby', null);
201
+ $search_dir = $this->getRequest()->getParam('dir', null);
202
+
203
+ $storeId = $this->getRequest()->getParam('store', null);
204
+ $currency = $this->getRequest()->getParam('currency', null);
205
+
206
+ if(is_null($storeId))
207
+ {
208
+ $storeId = Mage::app()->getStore()->getId();
209
+ $initialEnvironmentInfo = null;
210
+ }
211
+ else
212
+ {
213
+ $appEmulation = Mage::getSingleton('core/app_emulation');
214
+ // Start environment emulation of the specified store
215
+ $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
216
+ }
217
+
218
+ $currentCurrency = Mage::app()->getStore()->getCurrentCurrencyCode();
219
+ if(!is_null($currency))
220
+ Mage::app()->getStore()->setCurrentCurrencyCode($currency);
221
+
222
+ $callback = $this->getRequest()->getParam('callback', null);
223
+ $this->getRequest()->setParam('q', $search_criteria);
224
+
225
+ if(is_null($search_criteria) || strlen($search_criteria)==0){
226
+ //passem totes les dades buides per tal que no mostri resultats
227
+ Mage::register('total_search_results', 0);
228
+ Mage::register('search_result_collection', array());
229
+ Mage::register('partial_search', false);
230
+ Mage::register('callback', $callback);
231
+ Mage::register('search_result_attrs', array());
232
+ Mage::register('search_result_attrs_applied', array());
233
+ Mage::register('search_result_attrs_available', array());
234
+
235
+ Mage::app()->getStore()->setCurrentCurrencyCode($currentCurrency);
236
+
237
+ $this->getResponse()->setHeader('Content-type', 'application/json; charset=UTF8', true);
238
+
239
+ $this->loadLayout();
240
+ $this->renderLayout();
241
+ return ;
242
+
243
+ }
244
+ // $this->getRequest()->setParam('order', $search_sort);
245
+ // $this->getRequest()->setParam('dir', $search_order);
246
+
247
+ // de esto se encarga Magento $search_criteria = Mage::helper('core/string')->cleanString( $search_criteria );
248
+ //die(Mage::app()->getStore()->getId());
249
+ $query = Mage::helper('catalogsearch')->getQuery();
250
+ $query->setStoreId($storeId);
251
+ if ($query->getId()) {
252
+ $query->setPopularity($query->getPopularity()+1);
253
+ }
254
+ else {
255
+ $query->setPopularity(1);
256
+ }
257
+ $query->prepare();
258
+ Mage::helper('catalogsearch')->checkNotes();
259
+
260
+ $query = Mage::getModel('catalogsearch/layer');
261
+
262
+
263
+
264
+ $filterableAttributes = $query->getFilterableAttributes();
265
+ $attrs = array();
266
+
267
+ if(!empty($filterableAttributes))
268
+ {
269
+ $tmp = new Mage_Catalog_Model_Resource_Eav_Attribute();
270
+ $tmp->SetAttributeCode('category');
271
+ $tmp->setFrontendLabel('Category');
272
+ $filterableAttributes->addItem($tmp);
273
+ }
274
+ // $filterableAttributes[] =
275
+ // category
276
+
277
+ foreach ($filterableAttributes as $attribute)
278
+ {
279
+ $code = $attribute->getAttributeCode();
280
+ $name = $attribute->getFrontendLabel();
281
+
282
+ // INIT
283
+ $items = array();
284
+ switch($code)
285
+ {
286
+ case 'price':
287
+ $_filterModelName = "catalog/layer_filter_price";
288
+ break;
289
+ case 'decimal':
290
+ $_filterModelName = "catalog/layer_filter_decimal";
291
+ break;
292
+ case 'category':
293
+ $_filterModelName = "catalog/layer_filter_category";
294
+ break;
295
+ default:
296
+ $_filterModelName = "catalog/layer_filter_attribute";
297
+ break;
298
+ }
299
+
300
+ $filter = Mage::getModel($_filterModelName)
301
+ ->setLayer($query)
302
+ ->setAttributeModel($attribute);
303
+ $filter->apply($this->getRequest(), $this);
304
+ $items = $filter->getItems();
305
+ // INIT
306
+
307
+ // En los filtros aplicados no nos viene el nombre, solo el id, lo obtenemos aqui
308
+ $optionId = $this->getRequest()->getParam($filter->getRequestVar());
309
+ $featurename = "";
310
+ if(!is_null($optionId)) {
311
+ switch($code)
312
+ {
313
+ case 'price':
314
+ $featurename = $this->getRequest()->get($code);
315
+ break;
316
+ case 'decimal':
317
+ $featurename = $this->getRequest()->get($code);
318
+ break;
319
+ case 'category':
320
+ $featurename = $filter->getCategory()->getName();
321
+ break;
322
+ default:
323
+ $featurename = $filter->getAttributeModel()->getFrontend()->getOption($optionId);
324
+ break;
325
+ }
326
+
327
+ }
328
+
329
+ $options = array();
330
+ foreach($items as $item)
331
+ {
332
+ if($item->getCount() > 0)
333
+ $options[] = array("label" => $item->getLabel(), "value" => $item->getValue(), "qty" => $item->getCount());
334
+ }
335
+
336
+ $attrs[] = array(
337
+ 'code' => $code,
338
+ 'name' => $name,
339
+ 'options' => $options,
340
+ 'featurename' => $featurename
341
+ );
342
+ }
343
+
344
+ $attrs_applied = array();
345
+ $attrs_available = array();
346
+ foreach($attrs as $attr)
347
+ {
348
+ if(!is_null($this->getRequest()->getParam($attr['code'])))
349
+ {
350
+ $attr['value'] = $this->getRequest()->getParam($attr['code']);
351
+ $attrs_applied[] = $attr;
352
+ }
353
+ else
354
+ {
355
+ $attrs_available[] = $attr;
356
+ }
357
+ /*
358
+ if($this->getRequest()
359
+ $attrs[] = array(
360
+ 'code' => $code,
361
+ 'name' => $name,
362
+ 'options' => $options
363
+ );
364
+ */
365
+ }
366
+
367
+
368
+ $result_collection = $query->getProductCollection();
369
+
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
+ };
app/code/community/LetsSyncroLLC/Oct8ne/etc/config.xml CHANGED
@@ -1,229 +1,244 @@
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.7</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
+ <design_package>LetsSyncroLLC_Oct8ne_Model_Mage_Package</design_package>
36
+ </rewrite>
37
+ </core>
38
+
39
+ <checkout>
40
+ <rewrite>
41
+ <type_onepage>LetsSyncroLLC_Oct8ne_Model_Mage_Onepage</type_onepage>
42
+ </rewrite>
43
+ </checkout>
44
+
45
+ </models>
46
+ <blocks>
47
+ <oct8ne>
48
+ <class>LetsSyncroLLC_Oct8ne_Block</class>
49
+ </oct8ne>
50
+
51
+ <page>
52
+ <rewrite>
53
+ <html_head>LetsSyncroLLC_Oct8ne_Block_Html_Head</html_head>
54
+ </rewrite>
55
+ </page>
56
+
57
+ </blocks>
58
+ <helpers>
59
+ <oct8ne>
60
+ <class>LetsSyncroLLC_Oct8ne_Helper</class>
61
+ </oct8ne>
62
+ </helpers>
63
+ <resources>
64
+ <oct8ne_setup>
65
+ <setup>
66
+ <module>LetsSyncroLLC_Oct8ne</module>
67
+ </setup>
68
+ <connection>
69
+ <use>core_setup</use>
70
+ </connection>
71
+ </oct8ne_setup>
72
+ <oct8ne_write>
73
+ <connection>
74
+ <use>core_write</use>
75
+ </connection>
76
+ </oct8ne_write>
77
+ <oct8ne_read>
78
+ <connection>
79
+ <use>core_read</use>
80
+ </connection>
81
+ </oct8ne_read>
82
+ </resources>
83
+
84
+
85
+ <events>
86
+ <controller_front_init_routers>
87
+ <observers>
88
+ <LetsSyncroLLC_Oct8ne_Intercept>
89
+ <type>singleton</type>
90
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
91
+ <method>interceptMethod</method>
92
+ </LetsSyncroLLC_Oct8ne_Intercept>
93
+ </observers>
94
+ </controller_front_init_routers>
95
+
96
+ <controller_action_layout_render_before>
97
+ <observers>
98
+ <LetsSyncroLLC_Oct8ne_Layout>
99
+ <type>singleton</type>
100
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
101
+ <method>layoutRenderBefore</method>
102
+ </LetsSyncroLLC_Oct8ne_Layout>
103
+ </observers>
104
+ </controller_action_layout_render_before>
105
+
106
+ <sales_order_place_after>
107
+ <observers>
108
+ <LetsSyncroLLC_Oct8ne_Order>
109
+ <type>singleton</type>
110
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
111
+ <method>placeOrderBefore</method>
112
+ </LetsSyncroLLC_Oct8ne_Order>
113
+ </observers>
114
+ </sales_order_place_after>
115
+
116
+ <sales_quote_save_after>
117
+ <observers>
118
+ <LetsSyncroLLC_Oct8ne_Quote>
119
+ <type>singleton</type>
120
+ <class>LetsSyncroLLC_Oct8ne_Model_Observer</class>
121
+ <method>saveQuoteAfter</method>
122
+ </LetsSyncroLLC_Oct8ne_Quote>
123
+ </observers>
124
+ </sales_quote_save_after>
125
+ </events>
126
+ </global>
127
+ <frontend>
128
+ <routers>
129
+ <oct8ne>
130
+ <!-- <LetsSyncroLLC_LetsSyncro> -->
131
+ <use>standard</use>
132
+ <args>
133
+ <module>LetsSyncroLLC_Oct8ne</module>
134
+ <frontName>oct8ne</frontName>
135
+ </args>
136
+ <!-- </LetsSyncroLLC_LetsSyncro> -->
137
+ </oct8ne>
138
+
139
+ <customer>
140
+ <args>
141
+ <modules>
142
+ <oct8ne before="Mage_Customer">LetsSyncroLLC_Oct8ne</oct8ne>
143
+ </modules>
144
+ </args>
145
+ </customer>
146
+ </routers>
147
+ <layout>
148
+ <updates>
149
+ <LetsSyncroLLC_Oct8ne>
150
+ <file>oct8ne.xml</file>
151
+ </LetsSyncroLLC_Oct8ne>
152
+ </updates>
153
+ </layout>
154
+ </frontend>
155
+ <admin>
156
+ <routers>
157
+ <!-- <LetsSyncroLLC_LetsSyncro> -->
158
+ <oct8ne>
159
+ <use>admin</use>
160
+ <args>
161
+ <module>LetsSyncroLLC_Oct8ne</module>
162
+ <frontName>oct8ne</frontName>
163
+ </args>
164
+ </oct8ne>
165
+ <!-- </LetsSyncroLLC_LetsSyncro> -->
166
+ </routers>
167
+ </admin>
168
+ <adminhtml>
169
+ <translate>
170
+ <modules>
171
+ <LetsSyncroLLC_Oct8ne>
172
+ <files>
173
+ <default>LetsSyncroLLC_Oct8ne.csv</default>
174
+ </files>
175
+ </LetsSyncroLLC_Oct8ne>
176
+ </modules>
177
+ </translate>
178
+ <menu>
179
+ <oct8ne translate="title" module="oct8ne">
180
+ <title>Oct8ne</title>
181
+ <sort_order>1000</sort_order>
182
+ <children>
183
+ <accountconfig translate="title" module="oct8ne">
184
+ <title>Account Setup</title>
185
+ <action>oct8ne/admin/accountconfig</action>
186
+ <sort_order>0</sort_order>
187
+ </accountconfig>
188
+ <!--<dashboard translate="title" module="oct8ne">
189
+ <title>Dashboard</title>
190
+ <action>oct8ne/admin/dashboard</action>
191
+ <sort_order>20</sort_order>
192
+ </dashboard>
193
+ <syncrodata translate="title" module="oct8ne">
194
+ <title>Syncro Data</title>
195
+ <action>oct8ne/admin/syncrodata</action>
196
+ <sort_order>40</sort_order>
197
+ </syncrodata>-->
198
+ </children>
199
+ </oct8ne>
200
+ </menu>
201
+ <acl>
202
+ <resources>
203
+ <admin>
204
+ <children>
205
+ <oct8ne translate="title" module="oct8ne">
206
+ <title>Oct8ne</title>
207
+ <sort_order>1000</sort_order>
208
+ <children>
209
+ <accountconfig translate="title" module="oct8ne">
210
+ <title>Account Setup</title>
211
+ <action>oct8ne/admin/accountconfig</action>
212
+ <sort_order>0</sort_order>
213
+ </accountconfig>
214
+ <!--<dashboard translate="title" module="oct8ne">
215
+ <title>Dashboard</title>
216
+ <action>oct8ne/admin/dashboard</action>
217
+ <sort_order>20</sort_order>
218
+ </dashboard>
219
+ <syncrodata translate="title" module="oct8ne">
220
+ <title>Syncro Data</title>
221
+ <action>oct8ne/admin/syncrodata</action>
222
+ <sort_order>40</sort_order>
223
+ </syncrodata>-->
224
+ </children>
225
+ </oct8ne>
226
+ </children>
227
+ </admin>
228
+
229
+ </resources>
230
+
231
+
232
+ </acl>
233
+ </adminhtml>
234
+
235
+ <default>
236
+ <design>
237
+ <oct8nedesign>
238
+ <package>default</package>
239
+ <theme>oct8ne</theme>
240
+ </oct8nedesign>
241
+ </design>
242
+ </default>
243
+ </config>
244
+
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,250 @@
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
+ </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
+
241
+ <oct8ne_frame_getreportdata>
242
+ <reference name="root">
243
+ <action method="setTemplate"><template>oct8ne/frame/json-page.phtml</template></action>
244
+ </reference>
245
+
246
+ <reference name="content">
247
+ <block type="core/template" template="oct8ne/frame/getreportdata.phtml" />
248
+ </reference>
249
+ </oct8ne_frame_getreportdata>
250
+ </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/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();
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();
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.6</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">
@@ -41,6 +41,7 @@
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 +50,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 +77,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>
@@ -112,6 +119,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"/>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>LetsSyncroLLC_Oct8ne</name>
4
+ <version>1.1.7</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">
41
  <dir name="Mage">
42
  <file name="Onepage.php" hash="09bdc97f5328062520758798a2b5545c"/>
43
  <file name="Url.php" hash="9811f73a73b5f1bd216442150f854a70"/>
44
+ <file name="Package.php" hash="9811f73a73b5f1bd216442150f854a70"/>
45
  </dir>
46
  <dir name="Mysql4">
47
  <dir name="LetsSyncro">
50
  <file name="Letssyncro.php" hash="81b49a4f7770d408eacd230a41434cbf"/>
51
  <dir name="Orderproducts">
52
  <file name="Collection.php" hash="d41809333ca198109c3e0511790a333b"/>
53
+ </dir>
54
+ <dir name="Quoteproducts">
55
+ <file name="Collection.php" hash="d41809333ca198109c3e0511790a333b"/>
56
  </dir>
57
  <file name="Orderproducts.php" hash="4c05fe63b71bbc669d7053915969ea0c"/>
58
+ <file name="Quoteproducts.php" hash="4c05fe63b71bbc669d7053915969ea0c"/>
59
  </dir>
60
  <file name="Observer.php" hash="35c7a2608b071457d02ef3d0bc31f542"/>
61
  <file name="Orderproducts.php" hash="96432b6c3a3abdd58d9f9657a6432e18"/>
62
+ <file name="Quoteproducts.php" hash="96432b6c3a3abdd58d9f9657a6432e18"/>
63
  </dir>
64
  <dir name="controllers">
65
  <file name="AccountController.php" hash="492f053985eca9a14bc1abf698966d77"/>
77
  <file name="mysql4-install-0.5.0.php" hash="51668af264bb01c6607c68964ac6bdb7"/>
78
  <file name="mysql4-install-1.0.0.php" hash="51668af264bb01c6607c68964ac6bdb7"/>
79
  <file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="0de801ad4896defa9491391754ee7229"/>
80
+ <file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="0de801ad4896defa9491391754ee7229"/>
81
  </dir>
82
  </dir>
83
  </dir>
119
  </dir>
120
  <file name="getcart.phtml" hash="f67bacfaf225c8972a52de542cac1d69"/>
121
  <file name="getwishlist.phtml" hash="4e00716786afcebad70c7f72000b998e"/>
122
+ <file name="getreportdata.phtml" hash="4e00716786afcebad70c7f72000b998e"/>
123
  <file name="json-page.phtml" hash="509893c584213ad7d78e17a1a53249d1"/>
124
  <file name="loginpost.phtml" hash="ea57cb60b282d1fc60186503f6909176"/>
125
  <file name="naked-page.phtml" hash="6b9275b9ba11e9c79610b52e423e5dda"/>