ntoklo_recommendations - Version 1.0.3

Version Notes

Enhancements to CSS and Registration Flow

Download this release

Release Info

Developer Magento Core Team
Extension ntoklo_recommendations
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

Files changed (30) hide show
  1. app/code/community/Ntoklo/Recommendations/Block/Adminhtml/System/Config/Form/Field/Registration.php +96 -0
  2. app/code/community/Ntoklo/Recommendations/Block/Chart.php +4 -2
  3. app/code/community/Ntoklo/Recommendations/Block/UniversalVariable.php +1 -0
  4. app/code/community/Ntoklo/Recommendations/Helper/Data.php +55 -23
  5. app/code/community/Ntoklo/Recommendations/Model/Observer.php +93 -7
  6. app/code/community/Ntoklo/Recommendations/Model/Resource/Mysql4/Setup.php +4 -0
  7. app/code/community/Ntoklo/Recommendations/etc/config.xml +26 -2
  8. app/code/community/Ntoklo/Recommendations/etc/system.xml +14 -54
  9. app/code/community/Ntoklo/Recommendations/sql/ntoklo_setup/mysql4-install-1.0.3.php +7 -0
  10. app/design/frontend/base/default/layout/ntoklo_recommendations.xml +3 -2
  11. app/design/frontend/base/default/template/ntoklo/recommendations/universal_variable.phtml +0 -1
  12. app/design/frontend/base/default/template/ntoklo/recommendations/widget/chart_horisontal.phtml +29 -37
  13. app/design/frontend/base/default/template/ntoklo/recommendations/widget/chart_vertical.phtml +16 -18
  14. documentation/readme.html +136 -0
  15. documentation/skin/img/cc.png +0 -0
  16. documentation/skin/img/config.png +0 -0
  17. documentation/skin/img/disablec1.png +0 -0
  18. documentation/skin/img/disablec2.png +0 -0
  19. documentation/skin/img/logo.png +0 -0
  20. documentation/skin/img/widgets_1.png +0 -0
  21. documentation/skin/img/widgets_2.png +0 -0
  22. documentation/skin/img/widgets_3.png +0 -0
  23. documentation/skin/img/widgets_4.png +0 -0
  24. documentation/skin/style.css +11 -0
  25. package.xml +5 -5
  26. skin/frontend/base/default/css/ntoklo/global.css +5 -0
  27. skin/frontend/base/default/css/ntoklo/widget.css +335 -0
  28. skin/frontend/base/default/css/ntoklo/widgets.css +0 -26
  29. skin/frontend/base/default/images/ntoklo/ntoklo_logo.png +0 -0
  30. skin/frontend/base/default/images/ntoklo/ntoklo_logo_2x.png +0 -0
app/code/community/Ntoklo/Recommendations/Block/Adminhtml/System/Config/Form/Field/Registration.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * nToklo
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
+ *
12
+ * @category Ntoklo
13
+ * @package Ntoklo_Recommendations
14
+ * @copyright Copyright (c) 2013 nToklo (http://ntoklo.com)
15
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
+ * @author nToklo
17
+ */
18
+
19
+ /**
20
+ * Class Ntoklo_Recommendations_Block_Test
21
+ */
22
+ class Ntoklo_Recommendations_Block_Adminhtml_System_Config_Form_Field_Registration extends Mage_Adminhtml_Block_System_Config_Form_Field {
23
+
24
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
25
+ $user = Mage::getSingleton('admin/session')->getUser();
26
+ $email = $user->getEmail();
27
+ $firstName = $user->getFirstname();
28
+ $lastName = $user->getLastname();
29
+ $storeName = "My store name";
30
+
31
+ // Get domain
32
+ preg_match('/^(https?:\/\/)?([^\/]*)/', Mage::getBaseUrl(), $matches);
33
+ $domain = $matches[2];
34
+
35
+ // Build URLs
36
+ $baseParams = array(
37
+ 'p' => 'magento',
38
+ 'e' => $email,
39
+ 'n' => $storeName,
40
+ 'd' => $domain);
41
+ $registrationParams = array_merge($baseParams, array(
42
+ 'f' => $firstName,
43
+ 'l' => $lastName,
44
+ 'r' => 'register'));
45
+ $loginParams = array_merge($baseParams, array(
46
+ 'r' => 'login'));
47
+
48
+ $url = "https://console.ntoklo.com/register";
49
+ $registrationUrl = sprintf("%s?%s", $url, http_build_query($registrationParams));
50
+ $loginUrl = sprintf("%s?%s", $url, http_build_query($loginParams));
51
+
52
+ $js = sprintf("<script>
53
+ function showRegistrationIframe() {
54
+ createIframe('%s', '500px', '882px');
55
+ }
56
+
57
+ function showLoginIframe() {
58
+ createIframe('%s', '500px', '668px');
59
+ }
60
+
61
+ function createIframe(url, width, height) {
62
+ removeIframe();
63
+ var iframe = document.createElement('iframe');
64
+ iframe.width = width;
65
+ iframe.height = height;
66
+ iframe.src = url;
67
+ document.getElementById('ntIframeWrapper').appendChild(iframe);
68
+ showCloseButton();
69
+ }
70
+
71
+ function removeIframe() {
72
+ document.getElementById('ntIframeWrapper').innerHTML = '';
73
+ hideCloseButton();
74
+ }
75
+
76
+ function showCloseButton() {
77
+ document.getElementById('ntCloseIframe').style.display = 'inline-block';
78
+ }
79
+
80
+ function hideCloseButton() {
81
+ document.getElementById('ntCloseIframe').style.display = 'none';
82
+ }
83
+
84
+ document.getElementById('ntLaunchRegister').onclick = showRegistrationIframe;
85
+ document.getElementById('ntLaunchLogin').onclick = showLoginIframe;
86
+ document.getElementById('ntCloseIframe').onclick = removeIframe;
87
+ </script>", $registrationUrl, $loginUrl);
88
+
89
+ $html = "<button type='button' class='ntOpen' id='ntLaunchRegister'>nToklo Registration</button>
90
+ <button type='button' class='ntOpen' id='ntLaunchLogin'>nToklo Login</button><br />
91
+ <a href='javascript: void(0);' id='ntCloseIframe' style='display:none;'>Close</a>
92
+ <div id='ntIframeWrapper'></div>";
93
+
94
+ return $html.$js;
95
+ }
96
+ }
app/code/community/Ntoklo/Recommendations/Block/Chart.php CHANGED
@@ -29,7 +29,7 @@ class Ntoklo_Recommendations_Block_Chart extends Mage_Catalog_Block_Product_Abst
29
  parent::_construct();
30
  $this->addData(array(
31
  'cache_lifetime' => 86400,
32
- 'cache_tags' => array(Mage_Catalog_Model_Product::CACHE_TAG),
33
  ));
34
  }
35
 
@@ -40,6 +40,7 @@ class Ntoklo_Recommendations_Block_Chart extends Mage_Catalog_Block_Product_Abst
40
  * @return array
41
  */
42
  public function getCacheKeyInfo() {
 
43
  return array(
44
  'CATALOG_PRODUCT_NTOKLO_RECOMMENDATIONS',
45
  Mage::app()->getStore()->getId(),
@@ -47,7 +48,8 @@ class Ntoklo_Recommendations_Block_Chart extends Mage_Catalog_Block_Product_Abst
47
  Mage::getDesign()->getTheme('template'),
48
  Mage::getSingleton('customer/session')->getCustomerGroupId(),
49
  'template' => $this->getTemplate(),
50
- Mage::getSingleton('customer/session')->getID()
 
51
  );
52
  }
53
 
29
  parent::_construct();
30
  $this->addData(array(
31
  'cache_lifetime' => 86400,
32
+ 'cache_tags' => array(Mage_Catalog_Model_Product::CACHE_TAG)
33
  ));
34
  }
35
 
40
  * @return array
41
  */
42
  public function getCacheKeyInfo() {
43
+ $product = $this->getProduct();
44
  return array(
45
  'CATALOG_PRODUCT_NTOKLO_RECOMMENDATIONS',
46
  Mage::app()->getStore()->getId(),
48
  Mage::getDesign()->getTheme('template'),
49
  Mage::getSingleton('customer/session')->getCustomerGroupId(),
50
  'template' => $this->getTemplate(),
51
+ Mage::getSingleton('customer/session')->getID(),
52
+ 'product_id' => $product ? $product->getId() : ""
53
  );
54
  }
55
 
app/code/community/Ntoklo/Recommendations/Block/UniversalVariable.php CHANGED
@@ -67,6 +67,7 @@ class Ntoklo_Recommendations_Block_UniversalVariable extends Mage_Core_Block_Tem
67
  $universalVariable = new Ntoklo_Recommendations_Model_UniversalVariable(array(
68
  'version' => '1.1.1',
69
  'magento_version' => Mage::getVersion(),
 
70
  'user' => Mage::helper('ntoklo_recommendations')->getUvMapUser()
71
  ));
72
 
67
  $universalVariable = new Ntoklo_Recommendations_Model_UniversalVariable(array(
68
  'version' => '1.1.1',
69
  'magento_version' => Mage::getVersion(),
70
+ 'ntoklo_version' => Mage::helper('ntoklo_recommendations')->getExtensionVersion(),
71
  'user' => Mage::helper('ntoklo_recommendations')->getUvMapUser()
72
  ));
73
 
app/code/community/Ntoklo/Recommendations/Helper/Data.php CHANGED
@@ -27,11 +27,13 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
27
  const CONFIG_XPATH_IS_ENABLED = 'ntoklo_recommendations/settings/is_enabled';
28
  const CONFIG_XPATH_API_KEY = 'ntoklo_recommendations/settings/api_key';
29
  const CONFIG_XPATH_API_SECRET = 'ntoklo_recommendations/settings/api_secret';
 
30
  const CONFIG_XPATH_API_SSL_KEY = 'ntoklo_recommendations/settings/api_ssl_key';
31
  const CONFIG_XPATH_API_SSL_SECRET = 'ntoklo_recommendations/settings/api_ssl_secret';
32
  const CONFIG_XPATH_API_SERVICE_URL = 'ntoklo_recommendations/settings/api_service_url';
33
  const CONFIG_XPATH_API_SCRIPT_URL = 'ntoklo_recommendations/settings/api_script_url';
34
  const CONFIG_XPATH_API_DEBUG = 'ntoklo_recommendations/settings/api_debug';
 
35
 
36
 
37
  /**
@@ -53,11 +55,19 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
53
  const PAGE_CATEGORY_BASKET = 'basket';
54
  const PAGE_CATEGORY_CHECKOUT = 'checkout';
55
 
 
 
56
  /**
57
  * Cookie vars
58
  */
59
  const COOKIE_KEY_CONVERSION = 'ntoklo_conversion';
60
 
 
 
 
 
 
 
61
 
62
  /**
63
  * @return bool
@@ -73,18 +83,46 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
73
  return (bool)Mage::getStoreConfig(self::CONFIG_XPATH_IS_ENABLED);
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  /**
77
  * @return mixed
78
  */
79
  public function getNtokloApiKey() {
80
- return Mage::getStoreConfig(self::CONFIG_XPATH_API_KEY);
81
  }
82
 
83
  /**
84
  * @return mixed
85
  */
86
  public function getNtokloSecretKey() {
87
- return Mage::getStoreConfig(self::CONFIG_XPATH_API_SECRET);
 
 
 
 
 
 
 
 
 
 
88
  }
89
 
90
  /**
@@ -290,19 +328,8 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
290
  * @return Ntoklo_Recommendations_Model_UniversalVariable
291
  */
292
  public function getUvMapListing() {
293
-
294
  $object = false;
295
-
296
- // Build Items part - category context
297
  $items = array();
298
- /** @var $category Mage_Catalog_Model_Category */
299
- $category = Mage::registry('current_category');
300
- if ($category && !Mage::registry('current_product')) {
301
- foreach ($category->getProductCollection() as $product) {
302
- $product = $product->load($product->getId());
303
- array_push($items, $this->getUvMapProduct($product));
304
- }
305
- }
306
 
307
  /** @var Mage_Admin_Model_Session $session */
308
  $session = Mage::getSingleton('customer/session');
@@ -332,7 +359,6 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
332
  if (!empty($query)) {
333
  /** @var $listBlock Mage_Catalog_Block_Product_List */
334
  $listBlock = Mage::app()->getLayout()->getBlockSingleton('catalog/product_list');
335
-
336
  foreach ($listBlock->getLoadedProductCollection() as $product) {
337
  array_push($items, $this->getUvMapProduct($product));
338
  }
@@ -373,6 +399,7 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
373
  'id' => $product->getId(),
374
  'sku_code' => $product->getSku(),
375
  'url' => $product->getProductUrl(),
 
376
  'name' => $product->getName(),
377
  'unit_price' => (float) $product->getPrice(),
378
  'unit_sale_price' => (float) $product->getFinalPrice(),
@@ -452,7 +479,7 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
452
  'product' => $this->getUvMapProduct(Mage::getModel('catalog/product')->load($item->getProductId())),
453
  'subtotal' => (float) $item->getRowTotalInclTax(),
454
  'total_discount' => (float) $item->getDiscountAmount(),
455
- 'quantity' => ($this->getPageCategory() == self::PAGE_CATEGORY_BASKET) ? (float)$item->getQtyOrdered() : (float)$item->getQty(),
456
  )));
457
  }
458
  return $object;
@@ -540,21 +567,26 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
540
  * @return string
541
  */
542
  public function getNtokloUserId() {
543
-
544
- // Commented out as request to turn off the VisitorId usage: 26th April phone conversation.
545
- // /** @var Mage_Log_Model_Visitor $visitor */
546
- // $visitor = Mage::getSingleton('log/visitor');
547
- // if ($visitor->getVisitorId()) {
548
- // return $visitor->getVisitorId();
549
- // }
550
-
551
  /** @var Mage_Customer_Model_Customer $customer */
552
  $customer = Mage::helper('customer')->getCustomer();
553
  if ($customer->getId()) {
554
  return $customer->getId();
555
  }
556
 
 
 
 
 
 
 
557
  return false;
558
  }
559
 
 
 
 
 
 
 
 
560
  }
27
  const CONFIG_XPATH_IS_ENABLED = 'ntoklo_recommendations/settings/is_enabled';
28
  const CONFIG_XPATH_API_KEY = 'ntoklo_recommendations/settings/api_key';
29
  const CONFIG_XPATH_API_SECRET = 'ntoklo_recommendations/settings/api_secret';
30
+ const CONFIG_XPATH_ACTIVATION_CODE = 'ntoklo_recommendations/settings/activation_code';
31
  const CONFIG_XPATH_API_SSL_KEY = 'ntoklo_recommendations/settings/api_ssl_key';
32
  const CONFIG_XPATH_API_SSL_SECRET = 'ntoklo_recommendations/settings/api_ssl_secret';
33
  const CONFIG_XPATH_API_SERVICE_URL = 'ntoklo_recommendations/settings/api_service_url';
34
  const CONFIG_XPATH_API_SCRIPT_URL = 'ntoklo_recommendations/settings/api_script_url';
35
  const CONFIG_XPATH_API_DEBUG = 'ntoklo_recommendations/settings/api_debug';
36
+ const CONFIG_XPATH_WIDGET_INIT = 'ntoklo_recommendations/settings/widget_init';
37
 
38
 
39
  /**
55
  const PAGE_CATEGORY_BASKET = 'basket';
56
  const PAGE_CATEGORY_CHECKOUT = 'checkout';
57
 
58
+
59
+ const NEW_WIDGETS_MAGENTO_VERSION = 1.6;
60
  /**
61
  * Cookie vars
62
  */
63
  const COOKIE_KEY_CONVERSION = 'ntoklo_conversion';
64
 
65
+ /**
66
+ * Contains API Key and API Secret
67
+ */
68
+ private $_activationCode;
69
+
70
+ private $_usesNewWidgets;
71
 
72
  /**
73
  * @return bool
83
  return (bool)Mage::getStoreConfig(self::CONFIG_XPATH_IS_ENABLED);
84
  }
85
 
86
+ /**
87
+ * @return bool
88
+ */
89
+ public function needsWidget() {
90
+ return !(bool)Mage::getStoreConfig(self::CONFIG_XPATH_WIDGET_INIT);
91
+ }
92
+
93
+ public function setWidgetCreated() {
94
+ $this->_setConfig(self::CONFIG_XPATH_WIDGET_INIT, true);
95
+ }
96
+
97
+ public function usesNewWidgets() {
98
+ if (!isset($this->_usesNewWidgets)) {
99
+ $this->_usesNewWidgets = floatval(preg_replace('/^(\d\.\d).*/', "$1", Mage::getVersion())) >= self::NEW_WIDGETS_MAGENTO_VERSION;
100
+ }
101
+ return $this->_usesNewWidgets;
102
+ }
103
+
104
  /**
105
  * @return mixed
106
  */
107
  public function getNtokloApiKey() {
108
+ return $this->_getApiSecret() ? $this->_getApiSecret()->{'key'} : "";
109
  }
110
 
111
  /**
112
  * @return mixed
113
  */
114
  public function getNtokloSecretKey() {
115
+ return $this->_getApiSecret() ? $this->_getApiSecret()->{'secret'} : "";
116
+ }
117
+
118
+ /**
119
+ * @return mixed
120
+ */
121
+ private function _getApiSecret() {
122
+ if (!$this->_activationCode) {
123
+ $this->_activationCode = json_decode(Mage::getStoreConfig(self::CONFIG_XPATH_ACTIVATION_CODE));
124
+ }
125
+ return $this->_activationCode;
126
  }
127
 
128
  /**
328
  * @return Ntoklo_Recommendations_Model_UniversalVariable
329
  */
330
  public function getUvMapListing() {
 
331
  $object = false;
 
 
332
  $items = array();
 
 
 
 
 
 
 
 
333
 
334
  /** @var Mage_Admin_Model_Session $session */
335
  $session = Mage::getSingleton('customer/session');
359
  if (!empty($query)) {
360
  /** @var $listBlock Mage_Catalog_Block_Product_List */
361
  $listBlock = Mage::app()->getLayout()->getBlockSingleton('catalog/product_list');
 
362
  foreach ($listBlock->getLoadedProductCollection() as $product) {
363
  array_push($items, $this->getUvMapProduct($product));
364
  }
399
  'id' => $product->getId(),
400
  'sku_code' => $product->getSku(),
401
  'url' => $product->getProductUrl(),
402
+ 'image_url' => $product->getImageUrl(),
403
  'name' => $product->getName(),
404
  'unit_price' => (float) $product->getPrice(),
405
  'unit_sale_price' => (float) $product->getFinalPrice(),
479
  'product' => $this->getUvMapProduct(Mage::getModel('catalog/product')->load($item->getProductId())),
480
  'subtotal' => (float) $item->getRowTotalInclTax(),
481
  'total_discount' => (float) $item->getDiscountAmount(),
482
+ 'quantity' => ($this->getPageCategory() == self::PAGE_CATEGORY_CONFIRMATION) ? (float)$item->getQtyOrdered() : (float)$item->getQty(),
483
  )));
484
  }
485
  return $object;
567
  * @return string
568
  */
569
  public function getNtokloUserId() {
 
 
 
 
 
 
 
 
570
  /** @var Mage_Customer_Model_Customer $customer */
571
  $customer = Mage::helper('customer')->getCustomer();
572
  if ($customer->getId()) {
573
  return $customer->getId();
574
  }
575
 
576
+ /** @var Mage_Log_Model_Visitor $visitor */
577
+ $visitor = Mage::getSingleton('log/visitor');
578
+ if ($visitor->getVisitorId()) {
579
+ return $visitor->getVisitorId();
580
+ }
581
+
582
  return false;
583
  }
584
 
585
+ private function _setConfig($path, $value) {
586
+ Mage::getModel('core/config')->saveConfig($path, $value );
587
+ }
588
+
589
+ public function getExtensionVersion() {
590
+ return (string) $modules = Mage::getConfig()->getNode()->modules->Ntoklo_Recommendations->version;
591
+ }
592
  }
app/code/community/Ntoklo/Recommendations/Model/Observer.php CHANGED
@@ -28,15 +28,16 @@ class Ntoklo_Recommendations_Model_Observer {
28
  * @return Ntoklo_Recommendations_Model_Observer
29
  */
30
  public function processUniversalVariable($observer) {
31
-
32
  if (Mage::helper('ntoklo_recommendations')->isEnabled()) {
33
- if ($headBlock = Mage::app()->getLayout()->getBlock('head')) {
34
-
 
 
 
35
  /** @var $block Ntoklo_Recommendations_Block_UniversalVariable */
36
  $block = Mage::app()->getLayout()->createBlock('ntoklo_recommendations/UniversalVariable', 'ntoklo_recommendations_uv');
37
  $block->setTemplate('ntoklo/recommendations/universal_variable.phtml');
38
-
39
- $headBlock->append($block, 'ntoklo.recommendations.uv');
40
  }
41
  }
42
 
@@ -50,9 +51,94 @@ class Ntoklo_Recommendations_Model_Observer {
50
  * @return $this
51
  */
52
  public function registerWishlistProduct($observer) {
53
-
54
  $session = Mage::getSingleton("core/session", array("name"=>"frontend"));
55
  $session->setData("current_wishlist_add_product", $observer->getEvent()->getProduct());
56
  return $this;
57
  }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  * @return Ntoklo_Recommendations_Model_Observer
29
  */
30
  public function processUniversalVariable($observer) {
 
31
  if (Mage::helper('ntoklo_recommendations')->isEnabled()) {
32
+ $appendToBlock = Mage::app()->getLayout()->getBlock('before_body_end');
33
+ if (!$appendToBlock) {
34
+ $appendToBlock = Mage::app()->getLayout()->getBlock('head');
35
+ }
36
+ if ($appendToBlock) {
37
  /** @var $block Ntoklo_Recommendations_Block_UniversalVariable */
38
  $block = Mage::app()->getLayout()->createBlock('ntoklo_recommendations/UniversalVariable', 'ntoklo_recommendations_uv');
39
  $block->setTemplate('ntoklo/recommendations/universal_variable.phtml');
40
+ $appendToBlock->append($block, 'ntoklo.recommendations.uv');
 
41
  }
42
  }
43
 
51
  * @return $this
52
  */
53
  public function registerWishlistProduct($observer) {
 
54
  $session = Mage::getSingleton("core/session", array("name"=>"frontend"));
55
  $session->setData("current_wishlist_add_product", $observer->getEvent()->getProduct());
56
  return $this;
57
  }
58
+
59
+ /**
60
+ * Runs on admin config save and creates a widget if one isn't there.
61
+ */
62
+ public function initWidget($observer) {
63
+ $helper = Mage::helper('ntoklo_recommendations/data');
64
+
65
+ if (!$helper->needsWidget() || !$helper->getNtokloApiKey() || !$helper->isEnabled()) {
66
+ return $this;
67
+ }
68
+
69
+ $packageTheme = 'default/default';
70
+
71
+ $widget = Mage::getModel('widget/widget_instance');
72
+ $widget->setTitle('nToklo Sample Recommendations')
73
+ ->setType('ntoklo_recommendations/chart')
74
+ ->setPackageTheme($packageTheme)
75
+ ->setSortOrder(0)
76
+ ->setWidgetParameters(array(
77
+ 'widget_type' => 'recommendation',
78
+ 'widget_type_helper' => '',
79
+ 'header_recommendations' => 'Recommendations',
80
+ 'max_products' => '4',
81
+ 'column_count' => '4',
82
+ 'cache_lifetime' => ''
83
+ ));
84
+
85
+ if ($helper->usesNewWidgets()) {
86
+ $widget->setStoreIds(Mage::app()->getWebsite()->getDefaultGroup()->getDefaultStoreId());
87
+ }
88
+
89
+ // Create recommendations widget page layout
90
+ $widget->setPageGroups(array(
91
+ array(
92
+ 'page_group' => 'all_products',
93
+ 'all_products' => array(
94
+ 'page_id' => 0,
95
+ 'layout_handle' => 'catalog_product_view',
96
+ 'block' => 'right',
97
+ 'for' => 'all',
98
+ 'group' => 'all_products',
99
+ 'template' => 'ntoklo/recommendations/widget/chart_vertical.phtml'
100
+ )
101
+ )
102
+ ));
103
+ $widget->save();
104
+
105
+
106
+ $widget = Mage::getModel('widget/widget_instance');
107
+ $widget->setTitle('nToklo Sample Chart')
108
+ ->setType('ntoklo_recommendations/chart')
109
+ ->setPackageTheme($packageTheme)
110
+ ->setSortOrder(0)
111
+ ->setWidgetParameters(array(
112
+ 'widget_type' => 'chart',
113
+ 'widget_type_helper' => '',
114
+ 'header_chart' => 'Trending Products',
115
+ 'time_window' => "DAILY",
116
+ 'max_products' => '4',
117
+ 'column_count' => '2',
118
+ 'cache_lifetime' => ''
119
+ ));
120
+
121
+ if ($helper->usesNewWidgets()) {
122
+ $widget->setStoreIds(Mage::app()->getWebsite()->getDefaultGroup()->getDefaultStoreId());
123
+ }
124
+ // Creating charts widget
125
+ $widget->setPageGroups(array(
126
+ array(
127
+ 'page_group' => 'pages',
128
+ 'pages' => array(
129
+ 'page_id' => 0,
130
+ 'layout_handle' => 'cms_index_index',
131
+ 'block' => 'content',
132
+ 'for' => 'all',
133
+ 'template' => 'ntoklo/recommendations/widget/chart_horisontal.phtml'
134
+ )
135
+ )
136
+ ));
137
+ $widget->save();
138
+
139
+ $helper->setWidgetCreated();
140
+ Mage::getSingleton('adminhtml/session')->addNotice(Mage::helper('adminhtml')->__("nToklo has started collecting user activity. Product recommendations will automatically appear in 24 hours!"));
141
+ Mage::app()->cleanCache();
142
+ return $this;
143
+ }
144
+ }
app/code/community/Ntoklo/Recommendations/Model/Resource/Mysql4/Setup.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+
3
+ class Ntoklo_Recommendations_Model_Resource_Mysql4_Setup extends Mage_Core_Model_Resource_Setup {
4
+ }
app/code/community/Ntoklo/Recommendations/etc/config.xml CHANGED
@@ -20,7 +20,7 @@
20
  <config>
21
  <modules>
22
  <Ntoklo_Recommendations>
23
- <version>0.1.0</version>
24
  </Ntoklo_Recommendations>
25
  </modules>
26
  <global>
@@ -39,6 +39,17 @@
39
  <class>Ntoklo_Recommendations_Helper</class>
40
  </ntoklo_recommendations>
41
  </helpers>
 
 
 
 
 
 
 
 
 
 
 
42
  </global>
43
  <frontend>
44
  <translate>
@@ -78,6 +89,19 @@
78
  </wishlist_add_product>
79
  </events>
80
  </frontend>
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  <default>
82
  <ntoklo_recommendations>
83
  <settings>
@@ -92,4 +116,4 @@
92
  </settings>
93
  </ntoklo_recommendations>
94
  </default>
95
- </config>
20
  <config>
21
  <modules>
22
  <Ntoklo_Recommendations>
23
+ <version>1.0.3</version>
24
  </Ntoklo_Recommendations>
25
  </modules>
26
  <global>
39
  <class>Ntoklo_Recommendations_Helper</class>
40
  </ntoklo_recommendations>
41
  </helpers>
42
+ <resources>
43
+ <ntoklo_setup>
44
+ <setup>
45
+ <module>Ntoklo_Recommendations</module>
46
+ <class>Ntoklo_Recommendations_Model_Resource_Mysql4_Setup</class>
47
+ </setup>
48
+ <connection>
49
+ <use>core_setup</use>
50
+ </connection>
51
+ </ntoklo_setup>
52
+ </resources>
53
  </global>
54
  <frontend>
55
  <translate>
89
  </wishlist_add_product>
90
  </events>
91
  </frontend>
92
+ <adminhtml>
93
+ <events>
94
+ <admin_system_config_changed_section_ntoklo_recommendations>
95
+ <observers>
96
+ <ntoklo_recommendations>
97
+ <type>singleton</type>
98
+ <class>ntoklo_recommendations/observer</class>
99
+ <method>initWidget</method>
100
+ </ntoklo_recommendations>
101
+ </observers>
102
+ </admin_system_config_changed_section_ntoklo_recommendations>
103
+ </events>
104
+ </adminhtml>
105
  <default>
106
  <ntoklo_recommendations>
107
  <settings>
116
  </settings>
117
  </ntoklo_recommendations>
118
  </default>
119
+ </config>
app/code/community/Ntoklo/Recommendations/etc/system.xml CHANGED
@@ -43,6 +43,7 @@
43
  <show_in_default>1</show_in_default>
44
  <show_in_website>1</show_in_website>
45
  <show_in_store>1</show_in_store>
 
46
  <fields>
47
  <is_enabled translate="label">
48
  <label>Enabled</label>
@@ -52,69 +53,28 @@
52
  <show_in_default>1</show_in_default>
53
  <show_in_website>1</show_in_website>
54
  <show_in_store>1</show_in_store>
55
- <comment><![CDATA[Enable/Disable event submission to nToklo service. This switch also disables all "nToklo" widgets from been displayed.]]></comment>
56
  </is_enabled>
57
-
58
- <!--<auth_separator>-->
59
- <!--<label>API Authentication</label>-->
60
- <!--<sort_order>20</sort_order>-->
61
- <!--<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>-->
62
- <!--<show_in_default>1</show_in_default>-->
63
- <!--<show_in_website>1</show_in_website>-->
64
- <!--<show_in_store>1</show_in_store>-->
65
- <!--</auth_separator>-->
66
- <api_key translate="label">
67
- <label>Api Key</label>
68
- <frontend_type>text</frontend_type>
69
- <sort_order>30</sort_order>
70
  <show_in_default>1</show_in_default>
71
  <show_in_website>1</show_in_website>
72
  <show_in_store>1</show_in_store>
73
- <comment><![CDATA[Your API Key from nToklo Console.]]></comment>
74
- </api_key>
75
- <api_secret translate="label">
76
- <label>Api Secret</label>
77
- <frontend_type>text</frontend_type>
78
- <!--<frontend_type>obscure</frontend_type>-->
79
- <!--<backend_model>adminhtml/system_config_backend_encrypted</backend_model>-->
80
- <sort_order>40</sort_order>
81
  <show_in_default>1</show_in_default>
82
  <show_in_website>1</show_in_website>
83
  <show_in_store>1</show_in_store>
84
- <comment><![CDATA[Your API Secret from nToklo Console.]]></comment>
85
- </api_secret>
86
-
87
- <!--<advanced_separator>-->
88
- <!--<label>Advanced Configuration</label>-->
89
- <!--<sort_order>50</sort_order>-->
90
- <!--<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>-->
91
- <!--<show_in_default>1</show_in_default>-->
92
- <!--<show_in_website>1</show_in_website>-->
93
- <!--<show_in_store>1</show_in_store>-->
94
- <!--</advanced_separator>-->
95
-
96
- <!-- Commented out per Paolo's request 21 May 2013 -->
97
- <!--<api_service_url translate="label">-->
98
- <!--<label>Api Service URL</label>-->
99
- <!--<frontend_type>text</frontend_type>-->
100
- <!--<sort_order>60</sort_order>-->
101
- <!--<show_in_default>1</show_in_default>-->
102
- <!--<show_in_website>1</show_in_website>-->
103
- <!--<show_in_store>1</show_in_store>-->
104
- <!--<comment><![CDATA[nToklo API Service endpoint.]]></comment>-->
105
- <!--</api_service_url>-->
106
- <!--<api_script_url translate="label">-->
107
- <!--<label>Api Script URL</label>-->
108
- <!--<frontend_type>text</frontend_type>-->
109
- <!--<sort_order>70</sort_order>-->
110
- <!--<show_in_default>1</show_in_default>-->
111
- <!--<show_in_website>1</show_in_website>-->
112
- <!--<show_in_store>1</show_in_store>-->
113
- <!--<comment><![CDATA[nToklo js script location]]></comment>-->
114
- <!--</api_script_url>-->
115
  </fields>
116
  </settings>
117
  </groups>
118
  </ntoklo_recommendations>
119
  </sections>
120
- </config>
43
  <show_in_default>1</show_in_default>
44
  <show_in_website>1</show_in_website>
45
  <show_in_store>1</show_in_store>
46
+
47
  <fields>
48
  <is_enabled translate="label">
49
  <label>Enabled</label>
53
  <show_in_default>1</show_in_default>
54
  <show_in_website>1</show_in_website>
55
  <show_in_store>1</show_in_store>
56
+ <comment><![CDATA[Enable/Disable event submission to nToklo service. This switch also disables all "nToklo" widgets from being displayed.]]></comment>
57
  </is_enabled>
58
+ <activation_code translate="label">
59
+ <label>Activation code</label>
60
+ <frontend_type>textarea</frontend_type>
61
+ <sort_order>40</sort_order>
 
 
 
 
 
 
 
 
 
62
  <show_in_default>1</show_in_default>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
+ <comment><![CDATA[Your activation code from nToklo Console.<br />Example: {"key":"ABCD","secret":"12345"}]]></comment>
66
+ </activation_code>
67
+ <registration>
68
+ <label>Need activation code?</label>
69
+ <frontend_model>ntoklo_recommendations/adminhtml_system_config_form_field_registration</frontend_model>
70
+ <sort_order>50</sort_order>
 
 
71
  <show_in_default>1</show_in_default>
72
  <show_in_website>1</show_in_website>
73
  <show_in_store>1</show_in_store>
74
+ </registration>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  </fields>
76
  </settings>
77
  </groups>
78
  </ntoklo_recommendations>
79
  </sections>
80
+ </config>
app/code/community/Ntoklo/Recommendations/sql/ntoklo_setup/mysql4-install-1.0.3.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ //$url = Mage::helper('adminhtml')->getUrl('/system_config/edit/section/ntoklo_recommendations');
3
+ $notification = Mage::getModel('adminnotification/inbox');
4
+ $notification->setTitle('Visit the nToklo Configuration Page to Enable Recommendations', '');
5
+ //$notification->setUrl($url);
6
+ $notification->setSeverity($notification::SEVERITY_NOTICE);
7
+ $notification->save();
app/design/frontend/base/default/layout/ntoklo_recommendations.xml CHANGED
@@ -21,7 +21,8 @@
21
  <default>
22
  <reference name="head">
23
  <action method="addItem"><type>js</type><name>ntoklo/util.js</name></action>
24
- <action method="addCss"><stylesheet>css/ntoklo/widgets.css</stylesheet></action>
 
25
  </reference>
26
  </default>
27
- </layout>
21
  <default>
22
  <reference name="head">
23
  <action method="addItem"><type>js</type><name>ntoklo/util.js</name></action>
24
+ <action method="addCss"><stylesheet>css/ntoklo/global.css</stylesheet></action>
25
+ <action method="addCss"><stylesheet>css/ntoklo/widget.css</stylesheet></action>
26
  </reference>
27
  </default>
28
+ </layout>
app/design/frontend/base/default/template/ntoklo/recommendations/universal_variable.phtml CHANGED
@@ -24,7 +24,6 @@
24
  var _ntoklo_host = "<?php echo $this->getNtokloApiServiceUrl(); ?>";
25
  var _ntoklo_event_rate = "<?php echo Ntoklo_Recommendations_Helper_Data::PAGE_CATEGORY_RATE; ?>";
26
  var _ntoklo_event_review = "<?php echo Ntoklo_Recommendations_Helper_Data::PAGE_CATEGORY_REVIEW; ?>";
27
-
28
  Event.observe(window, 'load', function(){
29
  window.universal_variable = window.universal_variable || {};
30
  var _ntoklo = new Ntoklo("<?php echo $this->getNtokloScriptUrl(); ?>", (<?php echo $this->getJsonUniversalVariable(); ?>));
24
  var _ntoklo_host = "<?php echo $this->getNtokloApiServiceUrl(); ?>";
25
  var _ntoklo_event_rate = "<?php echo Ntoklo_Recommendations_Helper_Data::PAGE_CATEGORY_RATE; ?>";
26
  var _ntoklo_event_review = "<?php echo Ntoklo_Recommendations_Helper_Data::PAGE_CATEGORY_REVIEW; ?>";
 
27
  Event.observe(window, 'load', function(){
28
  window.universal_variable = window.universal_variable || {};
29
  var _ntoklo = new Ntoklo("<?php echo $this->getNtokloScriptUrl(); ?>", (<?php echo $this->getJsonUniversalVariable(); ?>));
app/design/frontend/base/default/template/ntoklo/recommendations/widget/chart_horisontal.phtml CHANGED
@@ -19,44 +19,36 @@
19
 
20
  <?php if (($_products = $this->getItems()) && count($_products)): ?>
21
  <!-- nToklo Chart -->
22
- <div class="widget widget-ntoklo-container">
23
- <div class="widget-title">
24
- <h2><?php echo $this->getHeader() ?></h2>
25
- </div>
26
- <div class="widget-products ntoklo-horisontal">
27
- <?php $_columnCount = $this->getColumnCount(); ?>
28
- <?php $i=0; foreach ($_products as $_product): ?>
29
- <?php if ($i++%$_columnCount==0): ?>
30
- <ol class="products-grid <?php if($this->isChart()) echo 'chart';?>">
31
- <?php endif ?>
32
- <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
33
- <span>
34
- <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>" class="product-image ntoklo_conversion"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->stripTags($_product->getName(), null, true) ?>" /></a>
35
- <h3 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>)" class="ntoklo_conversion"><?php echo $this->helper('catalog/output')->productAttribute($_product, $_product->getName() , 'name') ?></a></h3>
36
- <?php echo $this->getReviewsSummaryHtml($_product, 'ntoklo_short') ?>
37
- <?php echo $this->getPriceHtml($_product, true, '-widget-ntoklo-chart') ?>
38
- <div class="actions">
39
- <?php if ($_product->isSaleable()): ?>
40
- <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')" class="ntoklo_conversion"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
41
- <?php else: ?>
42
- <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
43
- <?php endif; ?>
44
- <ul class="add-to-links">
45
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
46
- <li><a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="link-wishlist ntoklo_conversion"><?php echo $this->__('Add to Wishlist') ?></a></li>
47
- <?php endif; ?>
48
- <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
49
- <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare ntoklo_conversion"><?php echo $this->__('Add to Compare') ?></a></li>
50
- <?php endif; ?>
51
- </ul>
52
  </div>
53
- </span>
54
- </li>
55
- <?php if ($i%$_columnCount==0 || $i==count($_products)): ?>
56
- </ol>
57
- <?php endif ?>
58
- <?php endforeach; ?>
59
  </div>
60
  </div>
61
  <!-- //END nToklo Chart -->
62
- <?php endif; ?>
19
 
20
  <?php if (($_products = $this->getItems()) && count($_products)): ?>
21
  <!-- nToklo Chart -->
22
+ <div class="widget-ntoklo-container clearfix" style="clear:both">
23
+ <?php $_columnCount = $this->getColumnCount(); ?>
24
+ <div class="nt_wrapper nt_grid nt_orange nt_<?php echo $_columnCount ?>_column">
25
+ <p class="nt_header"><?php echo $this->getHeader() ?></p>
26
+ <div class="nt_widget clearfix">
27
+ <?php $i=0; foreach ($_products as $_product): ?>
28
+ <?php if ($i++%$_columnCount==0): ?>
29
+ <div class="nt_row clearfix">
30
+ <?php endif ?>
31
+ <div class="nt_item_wrap" style="width:<?php echo (100 / $_columnCount) ?>%">
32
+ <div class="nt_img_wrap">
33
+ <a href="<?php echo $_product->getProductUrl() ?>" class="ntoklo_conversion"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(100) ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"></a>
34
+ </div>
35
+ <span class="nt_product_title"><?php echo $this->htmlEscape($_product->getName()) ?></span>
36
+ <span class="nt_product_price"><?php echo Mage::helper('core')->currency($_product->getPrice()); ?></span>
37
+ <a href="<?php echo $_product->getProductUrl() ?>" class="nt_btn">
38
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="10.853px" height="11.229px" viewBox="0 0 10.853 11.229" enable-background="new 0 0 10.853 11.229" xml:space="preserve">
39
+ <g>
40
+ <path fill="#fff" d="M8.825,6.164l-4.367,4.361c-0.154,0.154-0.375,0.248-0.603,0.248c-0.229,0-0.449-0.094-0.604-0.248l-0.509-0.502C2.589,9.862,2.495,9.64,2.495,9.413c0-0.229,0.094-0.449,0.248-0.604l3.255-3.255L2.743,2.305c-0.154-0.16-0.248-0.382-0.248-0.609s0.094-0.449,0.248-0.603L3.252,0.59C3.406,0.43,3.627,0.336,3.855,0.336c0.228,0,0.448,0.094,0.603,0.254l4.367,4.361c0.154,0.153,0.248,0.375,0.248,0.603S8.979,6.003,8.825,6.164z"/>
41
+ </g>
42
+ </svg>
43
+ </a>
44
+ </div>
45
+ <?php if ($i%$_columnCount==0 || $i==count($_products)): ?>
 
 
 
 
 
 
46
  </div>
47
+ <?php endif ?>
48
+ <?php endforeach; ?>
49
+ </div>
50
+ <div class="nt_logo"></div>
 
 
51
  </div>
52
  </div>
53
  <!-- //END nToklo Chart -->
54
+ <?php endif; ?>
app/design/frontend/base/default/template/ntoklo/recommendations/widget/chart_vertical.phtml CHANGED
@@ -19,29 +19,27 @@
19
 
20
  <?php if (($_products = $this->getItems()) && count($_products)): ?>
21
  <!-- nToklo Chart -->
22
- <div class="block widget-ntoklo-container">
23
- <div class="block-title">
24
- <strong><span><?php echo $this->getHeader() ?></span></strong>
25
- </div>
26
- <div class="block-content ntoklo-vertical">
27
- <ol class="mini-products-list <?php if($this->isChart()) echo 'chart';?>" id="block-ntoklo-chart">
28
  <?php $i=0; foreach ($_products as $_item): ?>
29
- <li class="item">
30
- <div class="product">
31
- <a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" class="product-image ntoklo_conversion"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
32
- <div class="product-details">
33
- <p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>" class="ntoklo_conversion"><?php echo $this->htmlEscape($_item->getName()) ?></a></p>
34
- <?php echo $this->getPriceHtml($_item, true, '-ntoklo-chart') ?>
35
- <?php if ($this->helper('wishlist')->isAllow()) : ?>
36
- <a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist ntoklo_conversion"><?php echo $this->__('Add to Wishlist') ?></a>
37
- <?php endif; ?>
38
  </div>
39
  </div>
40
  </li>
41
  <?php endforeach ?>
42
- </ol>
43
- <script type="text/javascript">decorateList('block-ntoklo-chart', 'none-recursive')</script>
44
  </div>
45
  </div>
46
  <!-- //END nToklo Chart -->
47
- <?php endif ?>
19
 
20
  <?php if (($_products = $this->getItems()) && count($_products)): ?>
21
  <!-- nToklo Chart -->
22
+ <div class="widget-ntoklo-container clearfix" style="clear:both">
23
+ <div class="nt_wrapper nt_column nt_green nt_img_above">
24
+ <p class="nt_header"><?php echo $this->getHeader() ?></p>
25
+ <ul class="nt_widget">
 
 
26
  <?php $i=0; foreach ($_products as $_item): ?>
27
+ <li>
28
+ <div class="nt_item_wrap">
29
+ <div class="nt_img_wrap">
30
+ <a href="<?php echo $_item->getProductUrl() ?>" class="ntoklo_conversion"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(100) ?>" alt="<?php echo $this->htmlEscape($_item->getName()) ?>"></a>
31
+ </div>
32
+ <div class="nt_info_wrap">
33
+ <span class="nt_product_title"><?php echo $this->htmlEscape($_item->getName()) ?></span>
34
+ <span class="nt_product_price"><?php echo Mage::helper('core')->currency($_item->getPrice()); ?></span>
35
+ <a href="<?php echo $_item->getProductUrl() ?>" class="ntoklo_conversion nt_btn"><?php echo $this->__('More details') ?></a>
36
  </div>
37
  </div>
38
  </li>
39
  <?php endforeach ?>
40
+ </ul>
41
+ <div class="nt_logo"></div>
42
  </div>
43
  </div>
44
  <!-- //END nToklo Chart -->
45
+ <?php endif ?>
documentation/readme.html ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>nToklo Recommendations : readme</title>
5
+ <link rel="stylesheet" href="skin/style.css" type="text/css" />
6
+ <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
7
+ </head>
8
+ <body>
9
+ <div id="main-container">
10
+ <div id="header">
11
+ <div id="logo">
12
+ <a href="http://www.ntoklo.com"><img src="skin/img/logo.png"/></a>
13
+ </div>
14
+ <div id="address">
15
+ 1st Floor, 48 Warwick Street<br/>
16
+ London, W1B 5NL, United Kingdom<br/>
17
+ T: +44 (0) 20 7747 1080<br/>
18
+ F: +44 (0) 20 7747 1010<br/>
19
+ Email: <a href="mailto:support@ntoklo.com">support@ntoklo.com</a><br/>
20
+ </div>
21
+ <div class="clearer"></div>
22
+ </div>
23
+ <div id="main">
24
+ <br/><br/>
25
+ <h1>nToklo Recommendations</h1>
26
+ <h1>Table of Contents</h1>
27
+ <ol>
28
+ <li><a href="#description">Description</a></li>
29
+ <li><a href="#features">Features</a></li>
30
+ <li><a href="#installation">Installation</a></li>
31
+ <li><a href="#configuration">Configuration</a></li>
32
+ <li><a href="#widgets">Widgets</a></li>
33
+ <li><a href="#widget-options">Widget Options</a></li>
34
+ </ol>
35
+
36
+
37
+ <h1 id="description">Description</h1>
38
+ <strong>Version 0.1.0</strong>
39
+ <br/><br/>
40
+ Magento Connect extension page: <a href="http://www.magentocommerce.com/magento-connect/ntoklo-recommendations.html">http://www.magentocommerce.com/magento-connect/ntoklo-recommendations.html</a>
41
+ <p>Displays personalised product recommendations and trending product charts through integration with nToklo for retail platform.</p>
42
+
43
+ <h1 id="features">Features</h1>
44
+ <ul>
45
+ <li>Seamlessly Integrates with nToklo for retail recommendations API’s.</li>
46
+ <li>Uses the Open Data Alliance Universal Variable - Generats UniversalVariable JSON object and submits it to nToklo for processing to leverage user behaviour.</li>
47
+ <li>Utilises native Magento widgets to render personalised product recommendations and trending product charts through nToklo API’s.</li>
48
+ <li>Integrates with your store CMS to account for product categories.</li>
49
+ </ul>
50
+
51
+ <h1 id="installation">Installation</h1>
52
+
53
+ <p><strong>Backup your data</strong></p>
54
+ <p>Backup the database and your store's web directory.</p>
55
+
56
+ <p><strong>Disable Compilation</strong></p>
57
+ <p>This step is for Magento 1.4+ versions. If you are running an older version, this step can be skipped. In the Magento admin panel, go to System->Tools->Compilation.
58
+ In case "Compiler Status" is "Enabled", click on the "Disable" button (in case the status is disabled you can skip this step): </p>
59
+ <img src="skin/img/disablec1.png"/>
60
+
61
+ <p>This screen should now look like this:</p>
62
+ <img src="skin/img/disablec2.png"/>
63
+
64
+ <p><strong>Download and Extract</strong></p>
65
+ <p>Download and extract (unzip) the extension's contents on you computer. Navigate inside the extracted folder.</p>
66
+
67
+ <p><strong>Upload files</strong></p>
68
+ <p>Upload the content of the extension directory to the store's document root so that the app directory in the extension folder merges with the app directory on the server. If asked to replace any files, select "Yes".</p>
69
+
70
+ <p><strong>Clear the cache</strong></p>
71
+ <p>In the Magento admin panel, go to <b>System -> Cache Management</b> and press the "Flush Magento Cache" button:</p>
72
+ <img src="skin/img/cc.png"/>
73
+
74
+
75
+ <h1 id="configuration">Configuration</h1>
76
+ <p>You will need an nToklo account.</p>
77
+ <p>After successfully installing the extension, go to <a href="http://console.ntoklo.com/register">http://console.ntoklo.com/register</a> and register an account if you don’t already have one. From within your console, create an application using your store domain name.<br />
78
+ When entering the domain of your application, do not put the http:// or trailing path. For example, if your store url is http://mydomain.com/store. Simply enter the domain mydomain.com</p>
79
+ <p>Navigate to <b>Admin -> System -> Configuration -> nToklo</b>.
80
+ <ul>
81
+ <li><b>Enabled</b> - Turn this on to send the UniversalVariable object to nToklo and also allow widgets to display on pages.</li>
82
+ <li><b>Api Key</b> - The API key of the application you registered in your nToklo console (<a href="http://console.ntoklo.com">http://console.ntoklo.com</a>)</li>
83
+ <li><b>Api Secret</b> - This can be found along with the API Key in the nToklo console for your application. (<a href="http://console.ntoklo.com">http://console.ntoklo.com</a>)</li>
84
+ </ul>
85
+ </p>
86
+ <img src="skin/img/config.png"/>
87
+
88
+ <h1 id="widgets">Widgets</h1>
89
+ <p><strong>Note:</strong><br />
90
+ Widgets will only render 24hrs after integration and configuration is complete. <br />
91
+ nToklo requires at least 24hrs data to provide recommendations and trending charts. <br />
92
+ For more information please see our <a href="http://www.ntoklo.com/getting-started/">website</a>.</p>
93
+ <p>Displaying the product recommendations or trending product chart requires you to configure nToklo widgets on the pages you select.<br/><br />
94
+ Navigate to <b>Admin -> CMS -> Widgets</b> and choose "Add New Widget Instance".<br /><br />
95
+ Select Type nToklo.</p>
96
+ <img src="skin/img/widgets_1.png"/>
97
+
98
+ <br />
99
+ <p>Under "Frontend Properties" choose the appropriate store and theme. Under Layout Updates define the pages/regions where you need your widgets to be placed<br /><br />
100
+ Choosing <b>Template</b> under <b>Layout Updates</b>:
101
+ <ol>
102
+ <li>nToklo Column Template - use it to place the widget under left / right column regions.</li>
103
+ <li>nToklo Grid Template - use it to place the widget wider spaces like Main Content Area.</li>
104
+ </ol>
105
+ </p>
106
+ <img src="skin/img/widgets_2.png"/>
107
+
108
+ <h1 id="widget-options">Widget Options</h1>
109
+ <p>Here you can chose what type of widget you would like and how it should behave.</p>
110
+ <img src="skin/img/widgets_4.png"/>
111
+
112
+ <br />
113
+ <p>Options:
114
+ <ul>
115
+ <li><b>Widget type</b>:
116
+ <ul>
117
+ <li>Recommendations - Select this option to present personalized product recommendations in the widget. Where the user is anonymous the best option recommendations will be served. Where available, item context like the product category is used. So recommendations on product / category pages will be scoped appropriately.</li>
118
+ <li>Trending product chart - this widget type is non-personalized as it provides a billboard type chart of products. Items in the widget are numbered numerically. Where available, item context like the product category is used. So charts on product / category pages will be scoped appropriately. You may select a daily or weekly chart.</li>
119
+ </ul>
120
+ </li>
121
+ <li><b>Header</b>: - the widget title.</li>
122
+ <li><b>Time Window</b>: - option only available for "Charts". The option specifies whether to show a daily, i.e. the trending products from yesterday, or, weekly chart, i.e. the trending products from last week. A week is taken as the last 7 days, i.e. it’s a rolling week.</li>
123
+ <li><b>Max Products</b>: - The maximum number of products to show in the widget.</li>
124
+ <li><b>Column count</b>: - this defines the number of columns to be displayed when using the "nToklo Grid Template" in the Widget Properties tab.</li>
125
+ <li><b>Cache lifetime</b>: - allows you to define the refresh interval. 86400 is the default Magento cache lifetime.</li>
126
+ </ul>
127
+ </p>
128
+ <img src="skin/img/widgets_3.png"/>
129
+ </div>
130
+
131
+ <div id="footer">
132
+ &copy; <a href="http://www.ntoklo.com/">nToklo</a>
133
+ </div>
134
+ </div>
135
+ </body>
136
+ </html>
documentation/skin/img/cc.png ADDED
Binary file
documentation/skin/img/config.png ADDED
Binary file
documentation/skin/img/disablec1.png ADDED
Binary file
documentation/skin/img/disablec2.png ADDED
Binary file
documentation/skin/img/logo.png ADDED
Binary file
documentation/skin/img/widgets_1.png ADDED
Binary file
documentation/skin/img/widgets_2.png ADDED
Binary file
documentation/skin/img/widgets_3.png ADDED
Binary file
documentation/skin/img/widgets_4.png ADDED
Binary file
documentation/skin/style.css ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ .clearer {clear:both}
2
+ body{font: 14px "museo-sans", sans-serif, Helvetica, Arial;color: #444;}
3
+ a {color: #DD3F2B;text-decoration:none;}
4
+ a:hover{text-decoration: underline;}
5
+ #footer {margin-top:20px;margin-bottom:30px;border-top: 1px solid black;}
6
+ h1 {font-size: 30px;line-height: 40px;}
7
+ #main-container {margin: 0 auto 0 auto;width:1024px;}
8
+ #header {margin-bottom:20px}
9
+ #logo {float:left;}
10
+ #address {float:right;margin-top:10px;}
11
+
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ntoklo_recommendations</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
@@ -13,11 +13,11 @@ Uses the Open Data Alliance Universal Variable - Generats UniversalVariable JSON
13
  &#xD;
14
  Utilises native Magento widgets to render personalised product recommendations and trending product charts through nToklo API&#x2019;s.&#xD;
15
  Integrates with your store CMS to account for product categories.</description>
16
- <notes>- Fixed package files (remove license file)</notes>
17
  <authors><author><name>nToklo</name><user>auto-converted</user><email>dev@ntoklo.com</email></author></authors>
18
- <date>2013-07-17</date>
19
- <time>11:43:23</time>
20
- <contents><target name="magecommunity"><dir name="Ntoklo"><dir name="Recommendations"><dir name="Block"><dir name="Adminhtml"><dir name="Widget"><dir name="Date"><file name="Helper.php" hash="6df6eb6926c5f06b085c980f0d640b72"/></dir><dir name="Type"><file name="Helper.php" hash="7003dba7c2b54e7dd03013de2f41a4e1"/></dir></dir></dir><file name="Chart.php" hash="a1ae31b76c209ab7e826d885ef36257e"/><file name="UniversalVariable.php" hash="ccb989862b31cdec6bae7ed823026819"/></dir><dir name="Helper"><file name="Data.php" hash="cab1091fa7a00b5727a77e19009bbe02"/></dir><dir name="Model"><dir name="Cache"><file name="UniversalVariable.php" hash="761f465d4fda0e3d48541fc67af5c4b1"/></dir><dir name="Widget"><file name="Type.php" hash="f399f8084a0c9c270c92e5fccd74e50f"/></dir><file name="Observer.php" hash="79bd41f44e0e743ee50dfb55176d8812"/><file name="Service.php" hash="842507619406f53f312cb5ef01c37799"/><file name="UniversalVariable.php" hash="7744caef59b5c3f056f89577c108e0f5"/></dir><dir name="etc"><file name="adminhtml.xml" hash="aff0945a94da77aab01ef814d14309d5"/><file name="cache.xml" hash="9be6ef2826f8e880e0c2db016787cacf"/><file name="config.xml" hash="b8a1f80d0e052d87d9bfc91a9ce43827"/><file name="system.xml" hash="6e9ca200e15d3df11f48d55d7b81947a"/><file name="widget.xml" hash="e94eaffd9ce677d742161bca542c069b"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="ntoklo"><dir name="recommendations"><dir name="widget"><file name="chart_horisontal.phtml" hash="ccba6e9cf4b0d1edb47fa7e3468ac264"/><file name="chart_review_short.phtml" hash="25a789e2e031e33e6e82fcd8fd73aa23"/><file name="chart_vertical.phtml" hash="ed87dfd4e7667b473a6c276fc769a95c"/></dir><file name="universal_variable.phtml" hash="e25a87c2244ca1c93b133e0b5db5f5f6"/></dir></dir></dir><dir name="layout"><file name="ntoklo_recommendations.xml" hash="54426563db6994151279dde06ac298c8"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ntoklo_Recommendations.xml" hash="d809f1cc3329034ac5d3ffcc4fe40d4c"/></dir></target><target name="magelocale"><dir name="en_US"><file name="ntoklo_recommendations.csv" hash="ba56401beed41df865bd37b1df0c82aa"/></dir></target><target name="mageweb"><dir name="js"><dir name="ntoklo"><file name="util.js" hash="051d37aa940bb1b877435698e1827295"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="ntoklo"><file name="widgets.css" hash="2437f25f0847229039184ed6e8615abe"/></dir></dir></dir></dir></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ntoklo_recommendations</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
13
  &#xD;
14
  Utilises native Magento widgets to render personalised product recommendations and trending product charts through nToklo API&#x2019;s.&#xD;
15
  Integrates with your store CMS to account for product categories.</description>
16
+ <notes>Enhancements to CSS and Registration Flow</notes>
17
  <authors><author><name>nToklo</name><user>auto-converted</user><email>dev@ntoklo.com</email></author></authors>
18
+ <date>2013-12-05</date>
19
+ <time>00:22:11</time>
20
+ <contents><target name="magecommunity"><dir name="Ntoklo"><dir name="Recommendations"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Registration.php" hash="6454d0327fb5881aba96beaed86005ac"/></dir></dir></dir></dir><dir name="Widget"><dir name="Date"><file name="Helper.php" hash="6df6eb6926c5f06b085c980f0d640b72"/></dir><dir name="Type"><file name="Helper.php" hash="7003dba7c2b54e7dd03013de2f41a4e1"/></dir></dir></dir><file name="Chart.php" hash="2f1f29ce21a7eaf2cda2f576225de839"/><file name="UniversalVariable.php" hash="d98923906642289029a7ef80be5a0c4f"/></dir><dir name="Helper"><file name="Data.php" hash="aa1f42d8eb6d51e39be80f4b54056770"/></dir><dir name="Model"><dir name="Cache"><file name="UniversalVariable.php" hash="761f465d4fda0e3d48541fc67af5c4b1"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="c76b856838d10860a74c2ec08d47bc87"/></dir></dir><dir name="Widget"><file name="Type.php" hash="f399f8084a0c9c270c92e5fccd74e50f"/></dir><file name="Observer.php" hash="9a22bdcae4fc457372692b0488f30833"/><file name="Service.php" hash="842507619406f53f312cb5ef01c37799"/><file name="UniversalVariable.php" hash="7744caef59b5c3f056f89577c108e0f5"/></dir><dir name="etc"><file name="adminhtml.xml" hash="aff0945a94da77aab01ef814d14309d5"/><file name="cache.xml" hash="9be6ef2826f8e880e0c2db016787cacf"/><file name="config.xml" hash="107ab3f5cb97e97826321310c8be7bfc"/><file name="system.xml" hash="d90aad78d74273219bbeb6bd3b38e477"/><file name="widget.xml" hash="e94eaffd9ce677d742161bca542c069b"/></dir><dir name="sql"><dir name="ntoklo_setup"><file name="mysql4-install-1.0.3.php" hash="96c7c0734c5290210b09dbb96f5cfa34"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="ntoklo"><dir name="recommendations"><dir name="widget"><file name="chart_horisontal.phtml" hash="d582b79bdca5e9da5cb723a91e6b3799"/><file name="chart_review_short.phtml" hash="25a789e2e031e33e6e82fcd8fd73aa23"/><file name="chart_vertical.phtml" hash="233500742979e1eb97499b9cfdb50cb4"/></dir><file name="universal_variable.phtml" hash="76ab001d6c660f77af83739540cf9edc"/></dir></dir></dir><dir name="layout"><file name="ntoklo_recommendations.xml" hash="b6649abad9f507fdf0e7b48d11d9a594"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ntoklo_Recommendations.xml" hash="d809f1cc3329034ac5d3ffcc4fe40d4c"/></dir></target><target name="magelocale"><dir name="en_US"><file name="ntoklo_recommendations.csv" hash="ba56401beed41df865bd37b1df0c82aa"/></dir></target><target name="mageweb"><dir name="js"><dir name="ntoklo"><file name="util.js" hash="051d37aa940bb1b877435698e1827295"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="ntoklo"><file name="global.css" hash="6dbef7435a7cde07887d428fb5fbb2fa"/><file name="widget.css" hash="2d1a9869e0c5e857965d4158535237f2"/></dir></dir><dir name="images"><dir name="ntoklo"><file name="ntoklo_logo.png" hash="647bf0ef039f657f27f2340450be65d5"/><file name="ntoklo_logo_2x.png" hash="7ebefaa14abf7da4db85e39d5986cdbf"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="documentation"><dir name="skin"><dir name="img"><file name="cc.png" hash="83f629e3f2c6e94df256a92a0d826079"/><file name="config.png" hash="a0f8540c37bbaa614a6e6818c52b9b1e"/><file name="disablec1.png" hash="3b7a509db5f2228c1187dd169c8a7c34"/><file name="disablec2.png" hash="ce25b484b08735a1890a4871eefd23ef"/><file name="logo.png" hash="5bbc2b3e56f571eb96923185485c3a27"/><file name="widgets_1.png" hash="61c6c6acc64e9bad49e2546d43032767"/><file name="widgets_2.png" hash="a357562e6cb535458c30f8a6c53bd44d"/><file name="widgets_3.png" hash="cc6ec6b496b03e516c29eb8ed63aa7a9"/><file name="widgets_4.png" hash="1feb96648e38c0e95629bf897baeb26b"/></dir><file name="style.css" hash="f544a9e3edc200affa0a9be9af98e878"/></dir><file name="readme.html" hash="76a9aa7ea09fbb80af24ce340f498d13"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>
skin/frontend/base/default/css/ntoklo/global.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ html,
2
+ body {
3
+ font-family: "Source Sans Pro", sans-serif;
4
+ font-size: .9em;
5
+ }
skin/frontend/base/default/css/ntoklo/widget.css ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .clearfix:after {
2
+ content: ".";
3
+ display: block;
4
+ height: 0;
5
+ clear: both;
6
+ visibility: hidden; }
7
+
8
+ .clearfix {
9
+ display: inline-block; }
10
+
11
+ * html .clearfix {
12
+ height: 1%; }
13
+
14
+ /* Hides from IE-mac \*/
15
+ .clearfix {
16
+ display: block; }
17
+
18
+ .nt_wrapper,
19
+ .nt_wrapper *,
20
+ .nt_wrapper *:before,
21
+ .nt_wrapper *:after {
22
+ -moz-box-sizing: border-box;
23
+ -webkit-box-sizing: border-box;
24
+ box-sizing: border-box; }
25
+
26
+ .nt_wrapper {
27
+ border: 1px solid #eeeeee;
28
+ color: #333;
29
+ line-height: 1;
30
+ margin-bottom: 1em;
31
+ -webkit-border-radius: 3px;
32
+ -moz-border-radius: 3px;
33
+ -ms-border-radius: 3px;
34
+ -o-border-radius: 3px;
35
+ border-radius: 3px; }
36
+ .nt_wrapper .nt_header {
37
+ font-size: 1.3em;
38
+ margin: 0;
39
+ padding: .5em;
40
+ -webkit-border-top-left-radius: 3px;
41
+ -moz-border-top-left-radius: 3px;
42
+ -ms-border-top-left-radius: 3px;
43
+ -o-border-top-left-radius: 3px;
44
+ border-top-left-radius: 3px;
45
+ -webkit-border-top-right-radius: 3px;
46
+ -moz-border-top-right-radius: 3px;
47
+ -ms-border-top-right-radius: 3px;
48
+ -o-border-top-right-radius: 3px;
49
+ border-top-right-radius: 3px; }
50
+ .nt_wrapper table {
51
+ line-height: 1;
52
+ margin: 0; }
53
+ .nt_wrapper table td {
54
+ vertical-align: middle; }
55
+ .nt_wrapper .nt_item_info {
56
+ border-collapse: separate;
57
+ border-spacing: 2px; }
58
+ .nt_wrapper ul {
59
+ list-style: none;
60
+ margin: 0;
61
+ padding: 0; }
62
+ .nt_wrapper:not(.nt_chart) .nt_widget img,
63
+ .nt_wrapper:not(.nt_chart) .nt_widget span {
64
+ display: block; }
65
+ .nt_wrapper:not(.nt_chart) .nt_widget .nt_img_wrap {
66
+ border: 1px solid #dddddd;
67
+ margin-bottom: .4em;
68
+ overflow: hidden; }
69
+ .nt_wrapper:not(.nt_chart) .nt_widget .nt_img_wrap img {
70
+ margin: 0 auto; }
71
+ .nt_wrapper:not(.nt_chart) .nt_widget a.nt_btn {
72
+ color: #fff;
73
+ display: inline-block;
74
+ padding: .3em .7em;
75
+ text-decoration: none;
76
+ -webkit-border-radius: 0.3em;
77
+ -moz-border-radius: 0.3em;
78
+ -ms-border-radius: 0.3em;
79
+ -o-border-radius: 0.3em;
80
+ border-radius: 0.3em; }
81
+ .nt_wrapper .nt_item_wrap {
82
+ overflow: hidden;
83
+ padding: 1em; }
84
+ .nt_wrapper .nt_product_title {
85
+ border-bottom: 1px solid #dddddd;
86
+ font-size: 1.1em;
87
+ margin-bottom: .5em;
88
+ padding-bottom: .5em; }
89
+ .nt_wrapper .nt_product_price {
90
+ font-size: 1.4em;
91
+ margin: .3em 0; }
92
+ .nt_wrapper.nt_img_right .nt_widget .nt_item_wrap {
93
+ padding-bottom: 0; }
94
+ .nt_wrapper.nt_img_right .nt_widget .nt_item_wrap div.nt_img_wrap {
95
+ border: 0;
96
+ float: right;
97
+ margin-left: 1em; }
98
+ .nt_wrapper.nt_img_right .nt_widget .nt_item_wrap .nt_product_title {
99
+ margin-right: 90px; }
100
+ .nt_wrapper.nt_column .nt_product_price, .nt_wrapper.nt_row .nt_product_price, .nt_wrapper.nt_grid .nt_product_price {
101
+ float: left;
102
+ margin-right: .6em; }
103
+ .nt_wrapper.nt_column a.nt_btn, .nt_wrapper.nt_row a.nt_btn, .nt_wrapper.nt_grid a.nt_btn {
104
+ margin-top: .5em; }
105
+ .nt_wrapper.nt_column.nt_img_above .nt_widget, .nt_wrapper.nt_row .nt_widget, .nt_wrapper.nt_grid .nt_widget {
106
+ border-bottom: 1px solid #dddddd; }
107
+ .nt_wrapper.nt_column.nt_img_above a.nt_btn {
108
+ float: right; }
109
+ .nt_wrapper.nt_column.nt_img_right li {
110
+ border-bottom: 1px solid #dddddd; }
111
+ .nt_wrapper.nt_column .nt_item_wrap {
112
+ padding-bottom: 1em; }
113
+ .nt_wrapper.nt_row {
114
+ width: 100%; }
115
+ .nt_wrapper.nt_row.nt_r3 li {
116
+ float: left;
117
+ width: 33.3%; }
118
+ .nt_wrapper.nt_row.nt_r4 li {
119
+ float: left;
120
+ width: 25%; }
121
+ .nt_wrapper.nt_grid .nt_row .nt_item_wrap {
122
+ float: left;
123
+ padding: 1em; }
124
+ .nt_wrapper.nt_grid.nt_2_column .nt_row .nt_item_wrap {
125
+ width: 50%; }
126
+ .nt_wrapper.nt_grid.nt_3_column .nt_row .nt_item_wrap {
127
+ width: 33.3%; }
128
+ .nt_wrapper.nt_chart table {
129
+ width: 100%; }
130
+ .nt_wrapper.nt_chart table th,
131
+ .nt_wrapper.nt_chart table td {
132
+ border-bottom: 1px solid #dddddd;
133
+ padding: 3px; }
134
+ .nt_wrapper.nt_chart table .nt_peak_time_wrapper {
135
+ padding: 0;
136
+ text-align: center; }
137
+ .nt_wrapper.nt_chart table .nt_peak_time_wrapper .nt_item_info {
138
+ height: 100%; }
139
+ .nt_wrapper.nt_chart table .nt_peak_time_wrapper .nt_item_info td {
140
+ border-bottom: 0;
141
+ -webkit-border-radius: 0.2em;
142
+ -moz-border-radius: 0.2em;
143
+ -ms-border-radius: 0.2em;
144
+ -o-border-radius: 0.2em;
145
+ border-radius: 0.2em; }
146
+ .nt_wrapper.nt_chart table th {
147
+ text-align: left; }
148
+ .nt_wrapper.nt_chart table th svg {
149
+ margin: 0 auto; }
150
+ .nt_wrapper.nt_chart table .nt_position {
151
+ min-width: 25px; }
152
+ .nt_wrapper.nt_chart table .nt_table_item {
153
+ padding: .5em 1em; }
154
+ .nt_wrapper.nt_chart table .nt_peak {
155
+ min-width: 15px; }
156
+ .nt_wrapper.nt_chart table .nt_img_wrap {
157
+ /*padding: 5px 5px 5px 0;*/ }
158
+ .nt_wrapper.nt_chart table .nt_img_wrap img {
159
+ display: block;
160
+ max-height: 40px; }
161
+ .nt_wrapper.nt_chart table .nt_position,
162
+ .nt_wrapper.nt_chart table .nt_peak,
163
+ .nt_wrapper.nt_chart table .nt_time {
164
+ text-align: center; }
165
+ .nt_wrapper.nt_chart table tfoot td {
166
+ background: #f8f8f7;
167
+ border: 0; }
168
+ .nt_wrapper.nt_chart table tfoot .nt_item_info td {
169
+ background: #e7e7e4; }
170
+ .nt_wrapper.nt_chart table tfoot .nt_table_item {
171
+ background: #f8f8f7 url(../../images/ntoklo/ntoklo_logo.png) no-repeat 95% center; }
172
+ .nt_wrapper .nt_logo {
173
+ background: transparent url(../../images/ntoklo/ntoklo_logo.png) no-repeat right center;
174
+ clear: both;
175
+ height: 26px;
176
+ margin: .5em 1em; }
177
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
178
+ .nt_wrapper .nt_logo {
179
+ background-image: url(../img/ntoklo_logo_2x.png);
180
+ background-size: 160px 26px; } }
181
+
182
+ @media screen and (max-width: 768px) {
183
+ .nt_wrapper .nt_header {
184
+ padding: 0.5rem 1em; }
185
+ .nt_wrapper .nt_item_wrap {
186
+ padding: 1em; }
187
+ .nt_wrapper.nt_row .nt_header {
188
+ padding: .5rem 1rem; }
189
+ .nt_wrapper.nt_row li .nt_item_wrap {
190
+ padding: 1em; }
191
+ .nt_wrapper.nt_row li .nt_item_wrap img {
192
+ max-height: 100px; }
193
+ .nt_wrapper.nt_grid .nt_header {
194
+ padding: .5rem 1rem; }
195
+ .nt_wrapper.nt_grid.nt_2_column .nt_row .nt_item_wrap {
196
+ padding: 1em;
197
+ width: 50%; }
198
+ .nt_wrapper.nt_grid.nt_3_column .nt_row .nt_item_wrap {
199
+ padding: 1em;
200
+ width: 33.3%; } }
201
+ @media screen and (max-width: 480px) {
202
+ .nt_wrapper .nt_header {
203
+ padding: 0.5rem 1em; }
204
+ .nt_wrapper .nt_item_wrap {
205
+ padding: 1em; }
206
+ .nt_wrapper.nt_row li {
207
+ width: 100%; }
208
+ .nt_wrapper.nt_grid .nt_header {
209
+ padding: .5rem 1rem; }
210
+ .nt_wrapper.nt_grid.nt_2_column .nt_row .nt_item_wrap, .nt_wrapper.nt_grid.nt_3_column .nt_row .nt_item_wrap {
211
+ margin: 0;
212
+ padding: 1em;
213
+ width: 100%; } }
214
+ @media screen and (max-width: 320px) {
215
+ .nt_wrapper .nt_header {
216
+ padding: 0.5rem 1em; }
217
+ .nt_wrapper .nt_item_wrap {
218
+ padding: 1em; }
219
+ .nt_wrapper.nt_row li {
220
+ border-bottom: 1px solid #dddddd;
221
+ width: 100%; }
222
+ .nt_wrapper.nt_column.nt_img_right .nt_product_price {
223
+ float: none; }
224
+ .nt_wrapper.nt_column.nt_img_right a {
225
+ margin-top: 0; }
226
+ .nt_wrapper.nt_grid.nt_2_column .nt_row .nt_item_wrap, .nt_wrapper.nt_grid.nt_3_column .nt_row .nt_item_wrap {
227
+ width: 100%; } }
228
+ /* color schemes */
229
+ .nt_wrapper {
230
+ background: #f8f8f7; }
231
+
232
+ .nt_widget {
233
+ background: #fff; }
234
+
235
+ .nt_item_info td {
236
+ background: #ecece9; }
237
+
238
+ .nt_wrapper.nt_plum .nt_header, .nt_wrapper.nt_pink .nt_header, .nt_wrapper.nt_orange .nt_header, .nt_wrapper.nt_green .nt_header, .nt_wrapper.nt_blue .nt_header, .nt_wrapper.nt_dark_blue .nt_header {
239
+ color: #fff; }
240
+ .nt_wrapper.nt_plum {
241
+ /*&.nt_chart {
242
+ th {
243
+ background: #F6E8F1;
244
+ }
245
+ }*/ }
246
+ .nt_wrapper.nt_plum .nt_header {
247
+ background-color: #ac1873; }
248
+ .nt_wrapper.nt_plum a {
249
+ color: #ac1873; }
250
+ .nt_wrapper.nt_plum .nt_product_price {
251
+ color: #7f1255; }
252
+ .nt_wrapper.nt_plum:not(.nt_chart) .nt_widget a.nt_btn {
253
+ background: #ac1873; }
254
+ .nt_wrapper.nt_plum:not(.nt_chart) .nt_widget a.nt_btn:hover, .nt_wrapper.nt_plum:not(.nt_chart) .nt_widget a.nt_btn:focus {
255
+ background: #d91e91; }
256
+ .nt_wrapper.nt_pink {
257
+ /*&.nt_chart {
258
+ th {
259
+ background: #FAEAF1;
260
+ }
261
+ }*/ }
262
+ .nt_wrapper.nt_pink .nt_header {
263
+ background-color: #ce0e5c; }
264
+ .nt_wrapper.nt_pink a {
265
+ color: #ce0e5c; }
266
+ .nt_wrapper.nt_pink .nt_product_price {
267
+ color: #9e0b47; }
268
+ .nt_wrapper.nt_pink:not(.nt_chart) .nt_widget a.nt_btn {
269
+ background: #ce0e5c; }
270
+ .nt_wrapper.nt_pink:not(.nt_chart) .nt_widget a.nt_btn:hover, .nt_wrapper.nt_pink:not(.nt_chart) .nt_widget a.nt_btn:focus {
271
+ background: #f01f74; }
272
+ .nt_wrapper.nt_orange {
273
+ /*&.nt_chart {
274
+ th {
275
+ background: #fdf0e8;
276
+ }
277
+ }*/ }
278
+ .nt_wrapper.nt_orange .nt_header {
279
+ background-color: #d15915; }
280
+ .nt_wrapper.nt_orange a {
281
+ color: #d15915; }
282
+ .nt_wrapper.nt_orange .nt_product_price {
283
+ color: #a34510; }
284
+ .nt_wrapper.nt_orange:not(.nt_chart) .nt_widget a.nt_btn {
285
+ background: #d15915; }
286
+ .nt_wrapper.nt_orange:not(.nt_chart) .nt_widget a.nt_btn:hover, .nt_wrapper.nt_orange:not(.nt_chart) .nt_widget a.nt_btn:focus {
287
+ background: #ea732f; }
288
+ .nt_wrapper.nt_green {
289
+ /*&.nt_chart {
290
+ th {
291
+ background: #dff2d9;
292
+ }
293
+ }*/ }
294
+ .nt_wrapper.nt_green .nt_header {
295
+ background-color: #4a9834; }
296
+ .nt_wrapper.nt_green a {
297
+ color: #4a9834; }
298
+ .nt_wrapper.nt_green .nt_product_price {
299
+ color: #387227; }
300
+ .nt_wrapper.nt_green:not(.nt_chart) .nt_widget a.nt_btn {
301
+ background: #4a9834; }
302
+ .nt_wrapper.nt_green:not(.nt_chart) .nt_widget a.nt_btn:hover, .nt_wrapper.nt_green:not(.nt_chart) .nt_widget a.nt_btn:focus {
303
+ background: #5dbe41; }
304
+ .nt_wrapper.nt_blue {
305
+ /*&.nt_chart {
306
+ th {
307
+ background: #E5F2F3;
308
+ }
309
+ }*/ }
310
+ .nt_wrapper.nt_blue .nt_header {
311
+ background-color: #008999; }
312
+ .nt_wrapper.nt_blue a {
313
+ color: #008999; }
314
+ .nt_wrapper.nt_blue .nt_product_price {
315
+ color: #005b66; }
316
+ .nt_wrapper.nt_blue:not(.nt_chart) .nt_widget a.nt_btn {
317
+ background: #008999; }
318
+ .nt_wrapper.nt_blue:not(.nt_chart) .nt_widget a.nt_btn:hover, .nt_wrapper.nt_blue:not(.nt_chart) .nt_widget a.nt_btn:focus {
319
+ background: #00b7cc; }
320
+ .nt_wrapper.nt_dark_blue {
321
+ /*&.nt_chart {
322
+ th {
323
+ background: #E5F2F3;
324
+ }
325
+ }*/ }
326
+ .nt_wrapper.nt_dark_blue .nt_header {
327
+ background-color: #5f668a; }
328
+ .nt_wrapper.nt_dark_blue a {
329
+ color: #5f668a; }
330
+ .nt_wrapper.nt_dark_blue .nt_product_price {
331
+ color: #4a506c; }
332
+ .nt_wrapper.nt_dark_blue:not(.nt_chart) .nt_widget a.nt_btn {
333
+ background: #5f668a; }
334
+ .nt_wrapper.nt_dark_blue:not(.nt_chart) .nt_widget a.nt_btn:hover, .nt_wrapper.nt_dark_blue:not(.nt_chart) .nt_widget a.nt_btn:focus {
335
+ background: #7980a3; }
skin/frontend/base/default/css/ntoklo/widgets.css DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * nToklo
3
- *
4
- * NOTICE OF LICENSE
5
- *
6
- * This source file is subject to the Open Software License (OSL 3.0)
7
- * that is bundled with this package in the file LICENSE.txt.
8
- * It is also available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category Ntoklo
12
- * @package Ntoklo_Recommendations
13
- * @copyright Copyright (c) 2013 nToklo (http://ntoklo.com)
14
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
- * @author nToklo
16
- */
17
- div.widget-ntoklo-container .block-title, div.widget-ntoklo-container .block-title span {color: #e25203;}
18
- div.widget-ntoklo-container ol.chart {list-style-type:decimal;}
19
- div.widget-ntoklo-container ol.chart li {color: #e25203; font-weight: bold;}
20
- div.widget-ntoklo-container div.ntoklo-vertical {padding: 10px 10px 17px 17px;}
21
- div.widget-ntoklo-container div.ntoklo-vertical ol.chart li.item {margin-left: 7px; padding: 7px 0;}
22
- div.widget-ntoklo-container div.ntoklo-horisontal ol.chart {list-style-position:inside;}
23
- div.widget-ntoklo-container div.ntoklo-horisontal ol.chart li.first {margin-left: 7px;}
24
- div.widget-ntoklo-container div.ntoklo-horisontal ol.chart li.item {padding: 12px 9px 90px; font-size: 13px;}
25
- div.widget-ntoklo-container div.ntoklo-horisontal ol.chart li.item .product-image {height: auto;}
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/frontend/base/default/images/ntoklo/ntoklo_logo.png ADDED
Binary file
skin/frontend/base/default/images/ntoklo/ntoklo_logo_2x.png ADDED
Binary file