ntoklo_recommendations - Version 1.1.1

Version Notes

Universal variable optimisation

Download this release

Release Info

Developer nToklo
Extension ntoklo_recommendations
Version 1.1.1
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.1

app/code/community/Ntoklo/Recommendations/Block/Chart.php CHANGED
@@ -84,7 +84,7 @@ class Ntoklo_Recommendations_Block_Chart extends Mage_Catalog_Block_Product_Abst
84
  ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
85
  ->setPageSize($limit ? $limit : 6);
86
 
87
- Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($collection);
88
 
89
  // Load parent product if possible if product is not visible individually
90
  /** @var $item Mage_Catalog_Model_Product */
84
  ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
85
  ->setPageSize($limit ? $limit : 6);
86
 
87
+ //Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($collection);
88
 
89
  // Load parent product if possible if product is not visible individually
90
  /** @var $item Mage_Catalog_Model_Product */
app/code/community/Ntoklo/Recommendations/Helper/Data.php CHANGED
@@ -249,11 +249,7 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
249
  ));
250
 
251
  array_push($object, $item);
252
-
253
-
254
-
255
-
256
-
257
  $tracker_id = Mage::helper('ntoklo_recommendations')->getTrackerId();
258
  // Recommendation click events
259
  if (!empty($_GET['nt_chrt'])) {
@@ -397,9 +393,10 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
397
  if ($this->getPageCategory() == self::PAGE_CATEGORY_CATEGORY) {
398
  $query = $this->getCategoryPath();
399
  }
400
-
401
-
402
  $pathCategory = $this->getCategoryPath();
 
 
403
  $last = count($pathCategory) - 1;
404
 
405
  // Build Items part - search context
@@ -417,7 +414,11 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
417
  if ($items) {
418
  $object = new Ntoklo_Recommendations_Model_UniversalVariable();
419
  $object->setProperties(array('query' => $query));
420
- $object->items = $items;
 
 
 
 
421
  }
422
 
423
  return $object;
@@ -452,8 +453,8 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
452
  'unit_price' => (float) $product->getPrice(),
453
  'unit_sale_price' => (float) $product->getFinalPrice(),
454
  'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
455
- 'description' => $product->getShortDescription(),
456
- 'stock' => (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty()
457
  ));
458
 
459
  if($category){
@@ -664,13 +665,13 @@ class Ntoklo_Recommendations_Helper_Data extends Mage_Core_Helper_Abstract {
664
 
665
  public function getWidgetType(){
666
 
667
- if($this->widget_type == 'recommendation'){
668
- return 'nt_rec';
669
- }
670
-
671
- if($this->widget_type){
672
- return 'nt_chrt';
673
- }
674
 
675
- }
676
  }
249
  ));
250
 
251
  array_push($object, $item);
252
+
 
 
 
 
253
  $tracker_id = Mage::helper('ntoklo_recommendations')->getTrackerId();
254
  // Recommendation click events
255
  if (!empty($_GET['nt_chrt'])) {
393
  if ($this->getPageCategory() == self::PAGE_CATEGORY_CATEGORY) {
394
  $query = $this->getCategoryPath();
395
  }
396
+
 
397
  $pathCategory = $this->getCategoryPath();
398
+
399
+ // print_r($pageCategory);
400
  $last = count($pathCategory) - 1;
401
 
402
  // Build Items part - search context
414
  if ($items) {
415
  $object = new Ntoklo_Recommendations_Model_UniversalVariable();
416
  $object->setProperties(array('query' => $query));
417
+
418
+ for ($i=0; $i<count($items) && $i < 5; $i++) {
419
+ //$items = $items[$i];
420
+ $object->items[$i] = $items[$i];
421
+ }
422
  }
423
 
424
  return $object;
453
  'unit_price' => (float) $product->getPrice(),
454
  'unit_sale_price' => (float) $product->getFinalPrice(),
455
  'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
456
+ 'description' => $product->getShortDescription()
457
+ //'stock' => (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty()
458
  ));
459
 
460
  if($category){
665
 
666
  public function getWidgetType(){
667
 
668
+ if($this->widget_type == 'recommendation'){
669
+ return 'nt_rec';
670
+ }
671
+
672
+ if($this->widget_type == 'chart'){
673
+ return 'nt_chrt';
674
+ }
675
 
676
+ }
677
  }
app/code/community/Ntoklo/Recommendations/Model/Service.php CHANGED
@@ -154,7 +154,6 @@ class Ntoklo_Recommendations_Model_Service extends Mage_Core_Model_Abstract {
154
  }
155
  break;
156
  case self::CALL_METHOD_RECOMMENDATIONS:
157
-
158
  if (array_key_exists('items', $response)) {
159
  foreach ($response['items'] as $item) {
160
  Mage::helper('ntoklo_recommendations')->setTrackerId($response['tracker_id'], $chart->getData('widget_type'));
154
  }
155
  break;
156
  case self::CALL_METHOD_RECOMMENDATIONS:
 
157
  if (array_key_exists('items', $response)) {
158
  foreach ($response['items'] as $item) {
159
  Mage::helper('ntoklo_recommendations')->setTrackerId($response['tracker_id'], $chart->getData('widget_type'));
app/code/community/Ntoklo/Recommendations/etc/config.xml CHANGED
@@ -20,7 +20,7 @@
20
  <config>
21
  <modules>
22
  <Ntoklo_Recommendations>
23
- <version>1.1.0</version>
24
  </Ntoklo_Recommendations>
25
  </modules>
26
  <global>
20
  <config>
21
  <modules>
22
  <Ntoklo_Recommendations>
23
+ <version>1.1.1</version>
24
  </Ntoklo_Recommendations>
25
  </modules>
26
  <global>
package.xml CHANGED
@@ -1,9 +1,9 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ntoklo_recommendations</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
- <license>open software license</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Displays personalised product recommendations and trending product charts through nToklo for retail platform. </summary>
@@ -11,11 +11,11 @@
11
  2. Uses the Open Data Alliance Universal Variable - Generats UniversalVariable JSON object and submits it to nToklo for processing to leverage user behaviour.&#xD;
12
  3. Utilises native widgets to render personalised product recommendations and trending product charts through nToklo API&#x2019;s.&#xD;
13
  4. Integrates with your store CMS to account for product categories</description>
14
- <notes>Color configuration options</notes>
15
- <authors><author><name>Fu</name><user>ntoklo</user><email>fu.hoang@ntoklo.com</email></author></authors>
16
- <date>2014-07-14</date>
17
- <time>09:30:14</time>
18
- <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="Color"><file name="Helper.php" hash="1c4904bb47589542401263480591a933"/></dir><dir name="Date"><file name="Helper.php" hash="29592c951ce694efb69397141a679226"/></dir><dir name="Type"><file name="Helper.php" hash="af54dfb2a4dd16295484e2f07ba0df6c"/></dir></dir></dir><file name="Chart.php" hash="26a6c4de1c75ccb79a990206f53657f1"/><file name="UniversalVariable.php" hash="5d152104f7b251062ce9827ad05945cc"/></dir><dir name="Helper"><file name="Data.php" hash="07443c67ce8b49310612bf819f2daab8"/></dir><dir name="Model"><dir name="Cache"><file name="UniversalVariable.php" hash="761f465d4fda0e3d48541fc67af5c4b1"/></dir><file name="Observer.php" hash="573f0925408a41f8e0b4032d45fbc301"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="c76b856838d10860a74c2ec08d47bc87"/></dir></dir><file name="Service.php" hash="bbc18a59769c9f45a2ea0e9cd31ca290"/><file name="UniversalVariable.php" hash="7744caef59b5c3f056f89577c108e0f5"/><dir name="Widget"><file name="Color.php" hash="03dc0047eb5914c18e97b84e244077c3"/><file name="Type.php" hash="f399f8084a0c9c270c92e5fccd74e50f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="aff0945a94da77aab01ef814d14309d5"/><file name="cache.xml" hash="9be6ef2826f8e880e0c2db016787cacf"/><file name="config.xml" hash="4139426055be93f73b9c40677439dab5"/><file name="system.xml" hash="d90aad78d74273219bbeb6bd3b38e477"/><file name="widget.xml" hash="03208ca9c734ff7b9641e7501197c081"/></dir><dir name="sql"><dir name="ntoklo_setup"><file name="mysql4-install-1.0.7.php" hash="96c7c0734c5290210b09dbb96f5cfa34"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ntoklo_Recommendations.xml" hash="d809f1cc3329034ac5d3ffcc4fe40d4c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ntoklo_recommendations.xml" hash="b6649abad9f507fdf0e7b48d11d9a594"/></dir><dir name="template"><dir name="ntoklo"><dir name="recommendations"><file name="universal_variable.phtml" hash="a825bae10ea9f4bd603fa233d2681f93"/><dir name="widget"><file name="chart_horisontal.phtml" hash="d0adefca90db68946c8b190b14470997"/><file name="chart_review_short.phtml" hash="25a789e2e031e33e6e82fcd8fd73aa23"/><file name="chart_vertical.phtml" hash="2fc407250d963a30fa957313edbf2e15"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="documentation"><file name="readme.html" hash="76a9aa7ea09fbb80af24ce340f498d13"/><dir name="skin"><dir><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></dir><file name="style.css" hash="f544a9e3edc200affa0a9be9af98e878"/></dir></dir><dir name="js"><dir name="ntoklo"><file name="util.js" hash="9cea20bac53b7f7890613e18fd4c5275"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="ntoklo"><file name="custom.css" hash="12162eb47db3f45433dd08c536f99182"/><file name="global.css" hash="fd2d2b773d3ce16d41488e9051bad8c8"/><file name="widget.css" hash="2d1a9869e0c5e857965d4158535237f2"/></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>ntoklo_recommendations</name>
4
+ <version>1.1.1</version>
5
  <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/OSL-3.0">open sofetware license</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Displays personalised product recommendations and trending product charts through nToklo for retail platform. </summary>
11
  2. Uses the Open Data Alliance Universal Variable - Generats UniversalVariable JSON object and submits it to nToklo for processing to leverage user behaviour.&#xD;
12
  3. Utilises native widgets to render personalised product recommendations and trending product charts through nToklo API&#x2019;s.&#xD;
13
  4. Integrates with your store CMS to account for product categories</description>
14
+ <notes>Universal variable optimisation </notes>
15
+ <authors><author><name>nToklo</name><user>nToklo</user><email>fu.hoang@ntoklo.com</email></author></authors>
16
+ <date>2014-07-31</date>
17
+ <time>12:47:20</time>
18
+ <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="Color"><file name="Helper.php" hash="1c4904bb47589542401263480591a933"/></dir><dir name="Date"><file name="Helper.php" hash="29592c951ce694efb69397141a679226"/></dir><dir name="Type"><file name="Helper.php" hash="af54dfb2a4dd16295484e2f07ba0df6c"/></dir></dir></dir><file name="Chart.php" hash="d361ab19d9781fb12ace06e0b1df1f15"/><file name="UniversalVariable.php" hash="5d152104f7b251062ce9827ad05945cc"/></dir><dir name="Helper"><file name="Data.php" hash="bfc509baa133c94962b4ad516217f111"/></dir><dir name="Model"><dir name="Cache"><file name="UniversalVariable.php" hash="761f465d4fda0e3d48541fc67af5c4b1"/></dir><file name="Observer.php" hash="573f0925408a41f8e0b4032d45fbc301"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="c76b856838d10860a74c2ec08d47bc87"/></dir></dir><file name="Service.php" hash="7c15d033f538cad223489749bfbb7b8d"/><file name="UniversalVariable.php" hash="7744caef59b5c3f056f89577c108e0f5"/><dir name="Widget"><file name="Color.php" hash="03dc0047eb5914c18e97b84e244077c3"/><file name="Type.php" hash="f399f8084a0c9c270c92e5fccd74e50f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="aff0945a94da77aab01ef814d14309d5"/><file name="cache.xml" hash="9be6ef2826f8e880e0c2db016787cacf"/><file name="config.xml" hash="d04facec8cb7dc6b1b493f507895dfdf"/><file name="system.xml" hash="d90aad78d74273219bbeb6bd3b38e477"/><file name="widget.xml" hash="03208ca9c734ff7b9641e7501197c081"/></dir><dir name="sql"><dir name="ntoklo_setup"><file name="mysql4-install-1.0.7.php" hash="96c7c0734c5290210b09dbb96f5cfa34"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ntoklo_Recommendations.xml" hash="d809f1cc3329034ac5d3ffcc4fe40d4c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ntoklo_recommendations.xml" hash="b6649abad9f507fdf0e7b48d11d9a594"/></dir><dir name="template"><dir name="ntoklo"><dir name="recommendations"><file name="universal_variable.phtml" hash="a825bae10ea9f4bd603fa233d2681f93"/><dir name="widget"><file name="chart_horisontal.phtml" hash="d0adefca90db68946c8b190b14470997"/><file name="chart_review_short.phtml" hash="25a789e2e031e33e6e82fcd8fd73aa23"/><file name="chart_vertical.phtml" hash="2fc407250d963a30fa957313edbf2e15"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="documentation"><file name="readme.html" hash="76a9aa7ea09fbb80af24ce340f498d13"/><dir name="skin"><dir><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></dir><file name="style.css" hash="f544a9e3edc200affa0a9be9af98e878"/></dir></dir><dir name="js"><dir name="ntoklo"><file name="util.js" hash="9cea20bac53b7f7890613e18fd4c5275"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="ntoklo"><file name="custom.css" hash="12162eb47db3f45433dd08c536f99182"/><file name="global.css" hash="fd2d2b773d3ce16d41488e9051bad8c8"/><file name="widget.css" hash="2d1a9869e0c5e857965d4158535237f2"/></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>