PHP code example of boulderx / spryker-quick-order-excel
1. Go to this page and download the library: Download boulderx/spryker-quick-order-excel 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/ */
boulderx / spryker-quick-order-excel example snippets
/**
* 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',
];
}
/**
* 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();
}
}
/**
* 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(),
];
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.