Skip to content

Commit

Permalink
Fix: Add Error Message on Loading Combination Base Product
Browse files Browse the repository at this point in the history
  • Loading branch information
BadPixxel committed Mar 22, 2019
1 parent cdf77cf commit 87d088c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/splashsync/src/Objects/Product/AttributeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Attribute;
use Combination;
use Product;
use Splash\Core\SplashCore as Splash;
use Splash\Client\Splash as Splash;
use Splash\Local\Services\LanguagesManager as SLM;

/**
Expand Down Expand Up @@ -66,9 +66,11 @@ public function loadAttribute($unikId)
// Read Product Combinations
$attrList = $this->object->getAttributesResume(SLM::getDefaultLangId());
//====================================================================//
// if Product has Combinations => Cannot Read Variant Product Without AttributeId
// If Product has Combinations => Cannot Read Variant Product Without AttributeId
if (is_array($attrList) && !empty($attrList)) {
return false;
Splash::commit("Product", $this->ProductId, SPL_A_DELETE);

return Splash::log()->err("Trying to fetch a Base Product, this is now forbideen.");
}

return true;
Expand Down

0 comments on commit 87d088c

Please sign in to comment.