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

Commit

Permalink
Attributes selector
Browse files Browse the repository at this point in the history
  • Loading branch information
ecoslado committed May 17, 2017
1 parent 343a8db commit 258ce5a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
20 changes: 11 additions & 9 deletions dfTools.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,23 +253,25 @@ public static function getAttributeKeysForShopAndLang($id_shop, $id_lang){
* @return array of rows (assoc arrays).
*/
public static function getVariationImg($id_product, $id_product_attribute){
$sql =
"select i.id_image
$sql = "
SELECT i.id_image
from
(
select pa.id_product, pa.id_product_attribute,paic.id_attribute,min(i.position) as posicion
from ps_product_attribute pa
inner join ps_product_attribute_image pai
select pa.id_product, pa.id_product_attribute,paic.id_attribute,min(i.position) as min_position
from _DB_PREFIX_product_attribute pa
inner join _DB_PREFIX_product_attribute_image pai
on pai.id_product_attribute = pa.id_product_attribute
inner join ps_product_attribute_combination paic
inner join _DB_PREFIX_product_attribute_combination paic
on pai.id_product_attribute = paic.id_product_attribute
inner join ps_image i
inner join _DB_PREFIX_image i
on pai.id_image = i.id_image
where pa.id_product = $id_product and pa.id_product_attribute = $id_product_attribute
group by pa.id_product, pa.id_product_attribute,paic.id_attribute
) as P
inner join ps_image i
on i.id_product = P.id_product and i.position = P.posicion";
inner join _DB_PREFIX_image i
on i.id_product = P.id_product and i.position = P.min_position
";
$sql = self::prepareSQL($sql, array());
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
if(isset($result[0]))
return $result[0]['id_image'];
Expand Down
Binary file modified dist/doofinder-p1.5-latest.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion doofinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Doofinder extends Module

const GS_SHORT_DESCRIPTION = 1;
const GS_LONG_DESCRIPTION = 2;
const VERSION = "2.2.2";
const VERSION = "2.2.3";
const YES = 1;
const NO = 0;

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.2.2",
"version": "2.2.3",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.5.0",
Expand Down

0 comments on commit 258ce5a

Please sign in to comment.