Skip to content

Commit

Permalink
Updated setproductsactive extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Meijer committed Jul 21, 2021
1 parent 707a1a4 commit cb63b2d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Plugin/SetProductsActive.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Akeneo\Connector\Helper\Import\Entities;
use Magento\Store\Model\ScopeInterface as scope;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Catalog\Model\Product\Attribute\Source\Status;

class SetProductsActive
{
Expand All @@ -27,18 +28,20 @@ public function __construct(

/**
* afterInsertData function
* @param product $subject
* @param product $product
* @param bool $result
* @return bool $result
*/
public function afterInsertData(product $subject, $result)
public function afterInsertData(product $product, $result)
{
$extensionEnabled = $this->config->getValue('akeneo_connector/justbetter/setproductsactive', scope::SCOPE_WEBSITE);
if (!$extensionEnabled) {
return $result;
}

// todo:
//todo: Save enabled status on product
// $product->setStatus(Status::STATUS_ENABLED);
// $product->save();

return $result;
}
Expand Down

0 comments on commit cb63b2d

Please sign in to comment.