PHP code example of de-swebhosting-shopware-plugin / smart-relation-sync
1. Go to this page and download the library: Download de-swebhosting-shopware-plugin/smart-relation-sync library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
de-swebhosting-shopware-plugin / smart-relation-sync example snippets
$productData = [
'id' => '...',
'categories' => [['id' => '...']],
'categoriesCleanupRelations' => true,
];
$this->productRepository->upsert([$productData], $context);