PHP code example of spryker-demo / sales-invoice-file-feature

1. Go to this page and download the library: Download spryker-demo/sales-invoice-file-feature 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/ */

    

spryker-demo / sales-invoice-file-feature example snippets


// >>> FILESYSTEM
$config[FileSystemConstants::FILESYSTEM_SERVICE] = [
...
'invoice' => [
        'sprykerAdapterClass' => Aws3v3FilesystemBuilderPlugin::class,
        'root' => '',
        'path' => 'path_to_invoice_directory',
        'key' => getenv('AWS_S3_KEY') ?? '',
        'secret' => getenv('AWS_S3_SECRET') ?? '',
        'bucket' => 'bucket_name',
        'version' => 'version',
        'region' => 'region_name',
    ],
];

$jobs[] = [
    'name' => 'sales-invoice-file-generate-pdf',
    'command' => '$PHP_BIN vendor/bin/console sales-invoice-file:generate-pdf',
    'schedule' => '* * * * *',
    'enable' => true,
    'stores' => $allStores,
];


use SprykerDemo\Zed\MerchantRegistration\Communication\Plugin\Mail\MerchantRegistrationMailTypePlugin;

class MailDependencyProvider extends SprykerMailDependencyProvider
{
    /**
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderExpanderPluginInterface>
     */
    protected function getOrderHydrationPlugins(): array
    {
        return [
            new SalesInvoiceFileOrderExpanderPlugin(),
          ];
    }
}