Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
ecoslado committed Nov 3, 2015
1 parent 813c561 commit 64dd1b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Binary file modified dist/doofinder-p1.5-latest.zip
Binary file not shown.
14 changes: 7 additions & 7 deletions doofinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Doofinder extends Module

const GS_SHORT_DESCRIPTION = 1;
const GS_LONG_DESCRIPTION = 2;
const VERSION = "2.0.4";
const VERSION = "2.0.5";

const YES = 1;
const NO = 0;
Expand Down Expand Up @@ -581,6 +581,7 @@ public function searchOnApi($string,$page=1,$page_size=12,$timeout=8000){
}
$hash_id = Configuration::get('DF_HASHID', null);
$api_key = Configuration::get('DF_API_KEY', null);

if($hash_id && $api_key){
$df = new DoofinderApi($hash_id, $api_key);
$dfResults = $df->query($string, $page, array('rpp' => $page_size, // results per page
Expand Down Expand Up @@ -621,12 +622,12 @@ public function searchOnApi($string,$page=1,$page_size=12,$timeout=8000){
if($product_pool == ""){
$product_pool = "0";
}

if($product_pool_attributes == ""){
$product_pool_attributes = "0";
}
$product_pool_attributes = implode(',', $product_pool_attributes);

if (!isset($context) || !$context)
$context = Context::getContext();
// Avoids SQL Error
$context = Context::getContext();

$db = Db::getInstance(_PS_USE_SQL_SLAVE_);
$id_lang = $context->language->id;
Expand Down Expand Up @@ -657,8 +658,7 @@ public function searchOnApi($string,$page=1,$page_size=12,$timeout=8000){
AND (pa.`id_product_attribute` IS NULL OR pa.`id_product_attribute` IN ('.$product_pool_attributes.'))
GROUP BY product_shop.id_product, pa.`id_product_attribute`
ORDER BY FIELD (p.`id_product`,'.$product_pool.'),FIELD (pa.`id_product_attribute`,'.$product_pool_attributes.')';
$result = $db->executeS($sql);

$result = $db->executeS($sql);
if (!$result)
return false;
else
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "doofinder-for-prestashop",
"version": "2.0.4",
"version": "2.0.5",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.5.0",
Expand Down

0 comments on commit 64dd1b3

Please sign in to comment.