Skip to content

Commit

Permalink
ADD - Compat with Wk Product Combination
Browse files Browse the repository at this point in the history
  • Loading branch information
BadPixxel committed Jan 11, 2024
1 parent 6f91695 commit fac0c44
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions modules/splashsync/src/Services/WkCombination.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Combination;
use Db;
use Module;
use PrestaShopException;
use Shop;
use Splash\Core\SplashCore as Splash;

Expand Down Expand Up @@ -49,8 +48,6 @@ public static function isFeatureActive()
* @param null|int $attributeId Ps Product Attribute ID
* @param null|Combination $attribute Ps Product Attribute Class
*
* @throws PrestaShopException
*
* @return bool return TRUE if Product Attribute is Disabled
*/
public static function isDisabled(?int $attributeId, ?Combination $attribute): bool
Expand All @@ -72,7 +69,11 @@ public static function isDisabled(?int $attributeId, ?Combination $attribute): b
.' AND `id_shop` = '.(int) Shop::getContextShopID()
;

return !empty(Db::getInstance()->executeS($sql));
try {
return !empty(Db::getInstance()->executeS($sql));
} catch (\PrestaShopDatabaseException $e) {
return false;
}
}

/**
Expand Down Expand Up @@ -102,6 +103,11 @@ public static function setAvailability(
return false;
}
//====================================================================//
// Compare Product Attribute Status
if (!self::isDisabled($attributeId, $attribute) == $value) {
return true;
}
//====================================================================//
// Update Product Attribute Status
self::updateProductAttribute($productId, $attributeId, $value);

Expand Down

0 comments on commit fac0c44

Please sign in to comment.