Skip to content

Commit

Permalink
Set workflow run conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
arfenis committed Oct 18, 2024
1 parent df4a949 commit 05985c5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(
public UserInterface $user,
public Regions $region,
public ?AppInterface $app = null,
public bool $disableWorkflow = false
public bool $runWorkflow = true
) {
$this->app = $this->app ?? app(Apps::class);
}
Expand Down Expand Up @@ -82,7 +82,9 @@ public function execute(): ProductsModel
'is_published' => $this->importedProduct->isPublished,
'attributes' => $this->importedProduct->attributes,
]);
$this->product = (new CreateProductAction($productDto, $this->user, $this->disableWorkflow))->execute();
$createAction = new CreateProductAction($productDto, $this->user);
$createAction->setRunWorkflow($this->runWorkflow);
$this->product = $createAction->execute();

if (isset($this->importedProduct->customFields) && ! empty($this->importedProduct->customFields)) {
$this->product->setAllCustomFields($this->importedProduct->customFields);
Expand Down

0 comments on commit 05985c5

Please sign in to comment.