|
@@ 342-361 (lines=20) @@
|
| 339 |
|
* @param \Shopware\Models\Article\Detail $detail |
| 340 |
|
* @param bool $force |
| 341 |
|
*/ |
| 342 |
|
private function generateChangesForDetail(\Shopware\Models\Article\Detail $detail, $force = false) |
| 343 |
|
{ |
| 344 |
|
$attribute = $this->getHelper()->getConnectAttributeByModel($detail); |
| 345 |
|
if (!$detail->getActive() && $this->getConnectConfig()->getConfig('excludeInactiveProducts')) { |
| 346 |
|
$this->getConnectExport()->syncDeleteDetail($detail); |
| 347 |
|
|
| 348 |
|
return; |
| 349 |
|
} |
| 350 |
|
|
| 351 |
|
if ($this->autoUpdateProducts == 1 || $force === true) { |
| 352 |
|
$this->getConnectExport()->export( |
| 353 |
|
[$attribute->getSourceId()], null, true |
| 354 |
|
); |
| 355 |
|
} elseif ($this->autoUpdateProducts == 2) { |
| 356 |
|
$this->manager->getConnection()->update( |
| 357 |
|
's_plugin_connect_items', |
| 358 |
|
['cron_update' => 1], |
| 359 |
|
['article_detail_id' => $detail->getId()] |
| 360 |
|
); |
| 361 |
|
} |
| 362 |
|
} |
| 363 |
|
|
| 364 |
|
private function generateChangesForArticle(\Shopware\Models\Article\Article $article, $force = false) |
|
@@ 364-382 (lines=19) @@
|
| 361 |
|
} |
| 362 |
|
} |
| 363 |
|
|
| 364 |
|
private function generateChangesForArticle(\Shopware\Models\Article\Article $article, $force = false) |
| 365 |
|
{ |
| 366 |
|
if (!$article->getActive() && $this->getConnectConfig()->getConfig('excludeInactiveProducts')) { |
| 367 |
|
$this->getConnectExport()->setDeleteStatusForVariants($article); |
| 368 |
|
|
| 369 |
|
return; |
| 370 |
|
} |
| 371 |
|
|
| 372 |
|
if ($this->autoUpdateProducts == 1 || $force === true) { |
| 373 |
|
$sourceIds = $this->getHelper()->getSourceIdsFromArticleId($article->getId()); |
| 374 |
|
|
| 375 |
|
$this->getConnectExport()->export($sourceIds, null, true); |
| 376 |
|
} elseif ($this->autoUpdateProducts == 2) { |
| 377 |
|
$this->manager->getConnection()->update( |
| 378 |
|
's_plugin_connect_items', |
| 379 |
|
['cron_update' => 1], |
| 380 |
|
['article_id' => $article->getId()] |
| 381 |
|
); |
| 382 |
|
} |
| 383 |
|
} |
| 384 |
|
|
| 385 |
|
/** |