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

Commit

Permalink
BugFix: Weird results.
Browse files Browse the repository at this point in the history
  • Loading branch information
ecoslado committed Oct 23, 2015
1 parent a8eccac commit 813c561
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Binary file modified dist/doofinder-p1.5-latest.zip
Binary file not shown.
10 changes: 4 additions & 6 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.3";
const VERSION = "2.0.4";

const YES = 1;
const NO = 0;
Expand Down Expand Up @@ -596,7 +596,7 @@ public function searchOnApi($string,$page=1,$page_size=12,$timeout=8000){
global $product_pool_attributes;
$product_pool_attributes = array();
$product_pool = implode(', ', array_map(function ($entry) {
if($entry['type'] == 'product'){

global $product_pool_attributes;
$customexplodeattr = Configuration::get('DF_CUSTOMEXPLODEATTR', null);
if(!empty($customexplodeattr) && strpos($entry['id'],$customexplodeattr)!==false){
Expand All @@ -614,7 +614,7 @@ public function searchOnApi($string,$page=1,$page_size=12,$timeout=8000){
$id_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT id_product FROM ps_product_attribute WHERE id_product_attribute = '.$id_product_attribute);
return ((!empty($id_product)) ? $id_product : 0 );
}
}


}, $dfResultsArray));
// To avoid SQL errors.
Expand All @@ -627,9 +627,7 @@ public function searchOnApi($string,$page=1,$page_size=12,$timeout=8000){
if (!isset($context) || !$context)
$context = Context::getContext();
// Avoids SQL Error
if ($product_pool_attributes == ""){
$product_pool_attributes = "0";
}

$db = Db::getInstance(_PS_USE_SQL_SLAVE_);
$id_lang = $context->language->id;
$sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity,
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.3",
"version": "2.0.4",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.5.0",
Expand Down

0 comments on commit 813c561

Please sign in to comment.