From fac0c44457dd28204788bcabbaaf2e5e5f77859e Mon Sep 17 00:00:00 2001 From: BadPixxel Date: Thu, 11 Jan 2024 15:33:33 +0100 Subject: [PATCH] ADD - Compat with Wk Product Combination --- modules/splashsync/src/Services/WkCombination.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/splashsync/src/Services/WkCombination.php b/modules/splashsync/src/Services/WkCombination.php index 4e3af8e8..fb25671a 100644 --- a/modules/splashsync/src/Services/WkCombination.php +++ b/modules/splashsync/src/Services/WkCombination.php @@ -18,7 +18,6 @@ use Combination; use Db; use Module; -use PrestaShopException; use Shop; use Splash\Core\SplashCore as Splash; @@ -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 @@ -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; + } } /** @@ -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);