PHP code example of ntzrbtr / shopware-custom-field-installer
1. Go to this page and download the library: Download ntzrbtr/shopware-custom-field-installer 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/ */
ntzrbtr / shopware-custom-field-installer example snippets
declare(strict_types=1);
namespace Swag\BasicExample;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
class SwagBasicExample extends Plugin
{
public function install(InstallContext $installContext): void
{
$customFieldInstaller = $this->container->get(CustomFieldInstaller::class);
$customFieldInstaller->install($this->getPath() . '/Resources/app/custom-field-set.xml', $installContext->getContext());
}
}
// config/bundles.php
return [
// ...
Netzarbeiter\Shopware\CustomFieldInstaller\NetzarbeiterShopwareCustomFieldInstallerBundle::class => ['all' => true],
];