PHP code example of tmonier / sylius-digital-product-passport-plugin
1. Go to this page and download the library: Download tmonier/sylius-digital-product-passport-plugin 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/ */
tmonier / sylius-digital-product-passport-plugin example snippets
return [
// ...
Tmonier\SyliusDigitalProductPassportPlugin\TmonierSyliusDigitalProductPassportPlugin::class => ['all' => true],
];
$passport = new DigitalProductPassport();
$passport->setProductVariant($variant);
$passport->setOriginMaterials('France, Germany');
$passport->setRecyclability('100% recyclable');
$passport->setRepairability('Repairability index: 8/10');
$passport->setProductIdentifier('01234567890128'); // GTIN, used for the GS1 Digital Link
$passport->setEquipmentModelCode('FORKLIFT_X'); // optional, customer-asset-management equipment model
$entityManager->persist($passport);
$entityManager->flush();