boulderx / spryker-quick-order-excel
Package info
github.com/boulderx/spryker-quick-order-excel
pkg:composer/boulderx/spryker-quick-order-excel
1.0.1
2025-12-13 14:05 UTC
Requires
- php: >=8.3
- phpoffice/phpspreadsheet: ^5.3
README
Excel quick order module for Sprkyer. It can be used to replace the quick order csv import
Based on Spryker's dummy module:
Use this repo as a reference on how to set up the project for contributions
https://github.com/spryker-community/dummy-module
Integration Points:
- Require the module
composer require boulderx/boulderx-quick-order-excel
- Extend config/Shared/config_default.php
$config[KernelConstants::CORE_NAMESPACES] = [ 'BoulderX', 'SprykerShop', 'SprykerEco', 'Spryker', 'SprykerSdk', ];
- Extend QuickOrderPageConfig in Pyz:
<?php /** * This file is part of the Spryker Commerce OS. * For full license information, please view the LICENSE file that was distributed with this source code. */ declare(strict_types = 1); namespace Pyz\Yves\QuickOrderPage; use SprykerShop\Yves\QuickOrderPage\QuickOrderPageConfig as SprykerQuickOrderPageConfig; class QuickOrderPageConfig extends SprykerQuickOrderPageConfig { protected const ALLOWED_CSV_FILE_MIME_TYPES = [ 'text/csv', 'text/plain', 'text/x-csv', 'application/vnd.ms-excel', 'application/csv', 'application/x-csv', 'text/comma-separated-values', 'text/x-comma-separated-values', 'text/tab-separated-values', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', ]; }
- Extend the QuickOrderPageFactory in Pyz:
<?php /** * This file is part of the Spryker Commerce OS. * For full license information, please view the LICENSE file that was distributed with this source code. */ declare(strict_types = 1); namespace Pyz\Yves\QuickOrderPage; use BoulderX\Yves\QuickOrderPage\File\Parser\UploadedFile\ExcelType\UploadedFileExcelTypeParser; use BoulderX\Yves\QuickOrderPage\File\Parser\UploadedFile\ExcelType\UploadedFileExcelTypeSanitizer; use BoulderX\Yves\QuickOrderPage\File\Parser\UploadedFile\ExcelType\UploadedFileExcelTypeValidator; use BoulderX\Yves\QuickOrderPage\File\Parser\UploadedFile\UploadedFileExcelTypeSanitizerInterface; use SprykerShop\Yves\QuickOrderPage\File\Parser\UploadedFile\UploadedFileTypeParserInterface; use SprykerShop\Yves\QuickOrderPage\File\Parser\UploadedFile\UploadedFileTypeValidatorInterface; use SprykerShop\Yves\QuickOrderPage\QuickOrderPageFactory as SprykerQuickOrderPageFactory; /** * @method \Pyz\Yves\QuickOrderPage\QuickOrderPageConfig getConfig() */ class QuickOrderPageFactory extends SprykerQuickOrderPageFactory { /** * @return QuickOrderPageConfig */ public function getModuleConfig(): QuickOrderPageConfig { return $this->getConfig(); } /** * @return UploadedFileTypeParserInterface */ public function createUploadedFileExcelTypeParser(): UploadedFileTypeParserInterface { return new UploadedFileExcelTypeParser( $this->createUploadedFileExcelTypeSanitizer(), ); } /**+ * @return UploadedFileTypeValidatorInterface */ public function createUploadedFileExcelTypeValidator(): UploadedFileTypeValidatorInterface { return new UploadedFileExcelTypeValidator(); } /** * @return UploadedFileExcelTypeSanitizerInterface */ public function createUploadedFileExcelTypeSanitizer(): UploadedFileExcelTypeSanitizerInterface { return new UploadedFileExcelTypeSanitizer(); } }
- Extend the QuickOrderPageDependencyProvider in Pyz:
<?php /** * This file is part of the Spryker Commerce OS. * For full license information, please view the LICENSE file that was distributed with this source code. */ declare(strict_types = 1); namespace Pyz\Yves\QuickOrderPage; use BoulderX\Yves\QuickOrderPage\Plugin\QuickOrderPage\QuickOrderExcelFileTemplateStrategyPlugin; use BoulderX\Yves\QuickOrderPage\Plugin\QuickOrderPage\QuickOrderExcelUploadedFileParserStrategyPlugin; use BoulderX\Yves\QuickOrderPage\Plugin\QuickOrderPage\QuickOrderExcelUploadedFileValidatorStrategyPlugin; use SprykerShop\Yves\ProductPackagingUnitWidget\Plugin\QuickOrder\QuickOrderItemDefaultPackagingUnitExpanderPlugin; use SprykerShop\Yves\QuickOrderPage\Plugin\QuickOrder\QuickOrderFormMeasurementUnitColumnPlugin; use SprykerShop\Yves\QuickOrderPage\QuickOrderPageDependencyProvider as SprykerQuickOrderPageDependencyProvider; use SprykerShop\Yves\ShoppingListWidget\Plugin\QuickOrderPage\ShoppingListQuickOrderFormHandlerStrategyPlugin; class QuickOrderPageDependencyProvider extends SprykerQuickOrderPageDependencyProvider { /** * @return array<\SprykerShop\Yves\QuickOrderPageExtension\Dependency\Plugin\QuickOrderUploadedFileParserStrategyPluginInterface> */ protected function getQuickOrderUploadedFileParserPlugins(): array { return [ new QuickOrderExcelUploadedFileParserStrategyPlugin(), ]; } /** * @return array<\SprykerShop\Yves\QuickOrderPageExtension\Dependency\Plugin\QuickOrderFileTemplateStrategyPluginInterface> */ protected function getQuickOrderFileTemplatePlugins(): array { return [ new QuickOrderExcelFileTemplateStrategyPlugin(), ]; } /** * @return array<\SprykerShop\Yves\QuickOrderPageExtension\Dependency\Plugin\QuickOrderUploadedFileValidatorStrategyPluginInterface> */ protected function getQuickOrderUploadedFileValidatorPlugins(): array { return [ new QuickOrderExcelUploadedFileValidatorStrategyPlugin(), ]; } }