commit d950880d654667f2d44c5f24b7f3f57ea4b82afa Author: Raphael Martin Date: Tue Dec 5 10:40:47 2023 +0100 inital commit diff --git a/Classes/Controller/IngredientsController.php b/Classes/Controller/IngredientsController.php new file mode 100755 index 0000000..09c3d62 --- /dev/null +++ b/Classes/Controller/IngredientsController.php @@ -0,0 +1,114 @@ +, none + */ + +/** + * IngredientsController + */ +class IngredientsController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { + + use InjectIngredientsRepositoryTrait; + use InjectImageServiceTrait; + + /** + * action list + * + * @return string|object|null|void + */ + public function listAction() { + $ingredients = $this->ingredientsRepository->findAll(); + $this->view->assign('contentObjectUid', $this->configurationManager->getContentObject()->data['uid']); + + $this->view->assign('ingredients', $ingredients); + } + + /** + * action ajaxListAction + * + * @return string|object|null|void + */ + public function ajaxListAction() { + + } + + /** + * action show + * + * @param Ingredients $ingredient + * @return string|object|null|void + */ + public function showAction(Ingredients $ingredient) { + $titleProvider = GeneralUtility::makeInstance(A2gPageTitleProvider::class); + + if(array_key_exists('pageTitleSuffix', $this->settings) && $this->settings['pageTitleSuffix'] !== null && $this->settings['pageTitleSuffix'] !== '' && (strlen($ingredient->getTitle()) + strlen($this->settings['pageTitleSuffix'])) < 66 ){ + $pageTitle = $ingredient->getTitle(). ' ' . $this->settings['pageTitleSuffix']; + } else { + $pageTitle = $ingredient->getTitle(); + } + $titleProvider->setTitle($pageTitle); + $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class); + $description = $contentObject->crop($ingredient->getDescription(), 125 . '|...|' . true); + + $uri = $this->uriBuilder->reset()->setCreateAbsoluteUri(true)->setTargetPageUid( + $GLOBALS['TSFE']->id)->uriFor('show', ['ingredient' => $ingredient], 'Ingredients', 'a2gProducts', 'ingredientsdetail'); + + + $this->view->assign('contentObjectUid', $this->configurationManager->getContentObject()->data['uid']); + + $metaTagManager = GeneralUtility::makeInstance(MetaTagManagerRegistry::class); + + /* TODO change + $metaTagManager->getManagerForProperty('robots')->addProperty('robots', 'index, folow'); + $metaTagManager->getManagerForProperty('og:type')->addProperty('og:type', 'website'); + $metaTagManager->getManagerForProperty('twitter:card')->addProperty('twitter:card', 'summary_large_image'); + + if ($ingredient->getTitle() !== '') { + $metaTagManager->getManagerForProperty('title')->addProperty('title', $pageTitle); + $metaTagManager->getManagerForProperty('og:title')->addProperty('og:title', $pageTitle); + $metaTagManager->getManagerForProperty('twitter:title')->addProperty('twitter:title', $pageTitle); + } + if ($ingredient->getDescription() !== '') { + $metaTagManager->getManagerForProperty('description')->addProperty('description', $description); + $metaTagManager->getManagerForProperty('og:description')->addProperty('og:description', $description); + $metaTagManager->getManagerForProperty('twitter:description')->addProperty('twitter:description', $description); + } + $metaTagManager->getManagerForProperty('og:url')->addProperty('og:url', $uri); + $metaTagManager->getManagerForProperty('twitter:url')->addProperty('twitter:url', $uri); + + if ($ingredient->getImage() !== null) { + $processedImage = $this->imageService->applyProcessingInstructions( + $this->imageService->getImage('', $ingredient->getImage(), false), + ['width' => ' + 1200', 'height' => '630c'] + ); + $metaTagManager->getManagerForProperty('twitter:image')->addProperty('twitter:image', $this->imageService->getImageUri($processedImage, true)); + $metaTagManager->getManagerForProperty('og:image')->addProperty('og:image', $this->imageService->getImageUri($processedImage, true)); + } + */ + $this->view->assign('ingredient', $ingredient); + } + +} diff --git a/Classes/Controller/ProductsController.php b/Classes/Controller/ProductsController.php new file mode 100755 index 0000000..43dbde4 --- /dev/null +++ b/Classes/Controller/ProductsController.php @@ -0,0 +1,222 @@ +, none + */ + +/** + * ProductsController + */ +class ProductsController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { + + use InjectProductsRepositoryTrait; + use InjectFiltersRepositoryTrait; + use InjectCategoriesRepositoryTrait; + use InjectImageServiceTrait; + + use SetMetaTagsTrait; + /** + * @var FeuserSessionService + */ + protected $feuserSessionService = null; + + /** + * @param FeuserSessionService $feuserSessionService + */ + public function injectFeuserSessionService(FeuserSessionService $feuserSessionService) { + $this->feuserSessionService = $feuserSessionService; + } + + /** + * mapInt + * + * @param string $int + * @return int|null + */ + static function mapInt(string $int): ?int { + if (MathUtility::canBeInterpretedAsInteger($int)) { + return (int) $int; + } + return null; + } + + /** + * + * @param \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $obj + * @return int|null + */ + static function mapGetUid(\TYPO3\CMS\Extbase\DomainObject\AbstractEntity $obj): ?int { + return $obj->getUid(); + } + + /** + * action list + * + * @return string|object|null|void + */ + public function listAction() { + $uniqid = $GLOBALS['TSFE']->id . '_' . $this->configurationManager->getContentObject()->data['uid']; + $this->injectFeuserSessionService(new FeuserSessionService('a2gProducts_' . $uniqid . '_')); + $activFilter = $this->feuserSessionService->get('filter'); + $searchField = $this->feuserSessionService->get('searchField'); + $catUids = array_filter(array_map('self::mapInt', explode(',', $this->settings['showCategories']))); + + $categories = $this->categoriesRepository->findByUids($catUids); + $filters = $this->filtersRepository->getFromCategories($catUids); + if (!empty($activFilter)) { + if ((int) $this->settings['ajaxListLimit'] === 0) { + $products = $this->productsRepository->filter($catUids, $activFilter, $searchField, 0, 0, $filters); + } else { + $products = $this->productsRepository->filter($catUids, $activFilter, $searchField, $this->settings['ajaxListLimit'] + 2, 0, $filters); + } + } else { + if ((int) $this->settings['ajaxListLimit'] === 0) { + $products = $this->productsRepository->getFromCategories($catUids); + } else { + $products = $this->productsRepository->getFromCategories($catUids, (int) $this->settings['ajaxListLimit'] + 2); + } + } + $this->view->assign('contentObjectUid', $this->configurationManager->getContentObject()->data['uid']); + + $this->view->assign('categories', $categories); + $this->view->assign('filters', $filters); + $this->view->assign('activeFilter', $activFilter); + $this->view->assign('searchField', $searchField); + $this->view->assign('products', $products); + $this->view->assign('uniqid', $uniqid); + } + + /** + * action ajaxListAction + * + * @return string|object|null|void + */ + public function ajaxListAction() { + $this->injectFeuserSessionService(new FeuserSessionService('a2gProducts_' . (string) $_POST['tx_a2gproducts_a2gproductlist']['uniqid'] . '_')); + $uniqid = $GLOBALS['TSFE']->id . '_' . $this->configurationManager->getContentObject()->data['uid']; + $settings = [ + 'detailPage' => $_POST['tx_a2gproducts_a2gproductlist']['dp'], + 'showCategories' => $_POST['tx_a2gproducts_a2gproductlist']['sc'], + 'style' => $_POST['tx_a2gproducts_a2gproductlist']['style'], + 'ajaxListLimit' => (int) $_POST['tx_a2gproducts_a2gproductlist']['limit'] + ]; + + $catUids = array_filter(array_map('self::mapInt', explode(',', $_POST['tx_a2gproducts_a2gproductlist']['sc']))); + $filters = $this->filtersRepository->getFromCategories($catUids); + + if (array_key_exists('filter',$_POST['tx_a2gproducts_a2gproductlist']) && $_POST['tx_a2gproducts_a2gproductlist']['filter'] === null) { + $filter = []; + } else { + $filter = $_POST['tx_a2gproducts_a2gproductlist']['filter']; + } + + $this->feuserSessionService->set($filter, 'filter'); + $this->feuserSessionService->set($_POST['tx_a2gproducts_a2gproductlist']['searchField'], 'searchField'); + + // duplicate from listAction make a new function !! + if (!empty($filter) || $_POST['tx_a2gproducts_a2gproductlist']['searchField'] !== '') { + if ((int) $settings['ajaxListLimit'] === 0) { + $products = $this->productsRepository->filter($catUids, $filter, $_POST['tx_a2gproducts_a2gproductlist']['searchField'], 0, 0, $filters); + } else { + $products = $this->productsRepository->filter($catUids, $filter, $_POST['tx_a2gproducts_a2gproductlist']['searchField'], $settings['ajaxListLimit'] + 2, (int) $_POST['tx_a2gproducts_a2gproductlist']['loads'] * $settings['ajaxListLimit'], $filters); + } + } else { + if ((int) $settings['ajaxListLimit'] === 0) { + $products = $this->productsRepository->getFromCategories($catUids); + } else { + $products = $this->productsRepository->getFromCategories($catUids, $settings['ajaxListLimit'] + 2, (int) $_POST['tx_a2gproducts_a2gproductlist']['loads'] * $settings['ajaxListLimit']); + } + } + + $this->view->assign('products', $products); + $this->view->assign('filters', $filters); + $this->view->assign('settings', $settings); + } + + static protected function isAllowedCategory(\A2G\A2gProducts\Domain\Model\Products $product, $categories){ + + } + + /** + * action show + * + * @param \A2G\A2gProducts\Domain\Model\Products $product + * @param \A2G\A2gProducts\Domain\Model\ProductVariants $productVariant + * @return string|object|null|void + */ + public function showAction(\A2G\A2gProducts\Domain\Model\Products $product = null, \A2G\A2gProducts\Domain\Model\ProductVariants $productVariant = null) { + + + + if($product === null){ + return GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Controller\ErrorController::class) + ->pageNotFoundAction( + $GLOBALS['TYPO3_REQUEST'], + 'Shop Product not found!', + ['code' => \TYPO3\CMS\Frontend\Page\PageAccessFailureReasons::INVALID_PAGE_ARGUMENTS] + ); + } + + $titleProvider = GeneralUtility::makeInstance(A2gPageTitleProvider::class); + $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class); + $description = $contentObject->crop($product->getDescription(), 125 . '|...|' . true); + $imageUri=null; + if ($product->getImage() !== null) { + $processedImage = $this->imageService->applyProcessingInstructions( + $this->imageService->getImage('', $product->getImage(), false), + ['width' => '1200c', 'height' => '630'] + ); + $imageUri = $this->imageService->getImageUri($processedImage, true); + } + + $this->view->assign('product', $product); + + if($productVariant === null){ + $uri = $this->uriBuilder->reset()->setCreateAbsoluteUri(true)->setTargetPageUid( + $GLOBALS['TSFE']->id)->uriFor('show', ['product' => $product], 'Products', 'a2gShop', 'A2gproductsdetail'); + } else { + $uri = $this->uriBuilder->reset()->setCreateAbsoluteUri(true)->setTargetPageUid( + $GLOBALS['TSFE']->id)->uriFor('show', ['product' => $product, 'productVariant' => $productVariant], 'Products', 'a2gShop', 'A2gproductsdetail'); + } + if($productVariant !== null && array_key_exists('pageTitleSuffix', $this->settings) && $this->settings['pageTitleSuffix'] !== '' && (strlen($product->getTitle()) + (strlen($productVariant->getTitle()) + strlen($this->settings['pageTitleSuffix'])) < 65 )){ + $titleProvider->setTitle($product->getTitle() . ' ' .$productVariant->getTitle() .' - ' . $this->settings['pageTitleSuffix']); + $this->setMetaTags($product->getTitle(). ' ' .$productVariant->getTitle() .' - ' . $this->settings['pageTitleSuffix'], $description, $uri, $imageUri); + } else if($productVariant !== null && (strlen($product->getTitle()) + strlen($productVariant->getTitle())) < 65 ){ + $titleProvider->setTitle($product->getTitle() . ' ' .$productVariant->getTitle()); + $this->setMetaTags($product->getTitle(). ' ' .$productVariant->getTitle(), $description, $uri, $imageUri); + }else if(array_key_exists('pageTitleSuffix', $this->settings) && $this->settings['pageTitleSuffix'] !== '' && (strlen($product->getTitle()) + strlen($this->settings['pageTitleSuffix'])) < 66 ){ + $titleProvider->setTitle($product->getTitle() .' - ' . $this->settings['pageTitleSuffix']); + $this->setMetaTags($product->getTitle() .' - ' . $this->settings['pageTitleSuffix'], $description, $uri, $imageUri); + } else { + $titleProvider->setTitle($product->getTitle()); + $this->setMetaTags($product->getTitle(), $description, $uri, $imageUri); + } + if(!array_key_exists('listPage', $this->settings)){ + $this->view->assign('contentObjectUid', $this->configurationManager->getContentObject()->data['uid']); + } + } + +} diff --git a/Classes/Domain/Model/Brands.php b/Classes/Domain/Model/Brands.php new file mode 100755 index 0000000..0742fab --- /dev/null +++ b/Classes/Domain/Model/Brands.php @@ -0,0 +1,104 @@ +, none + */ + +/** + * Brands + */ +class Brands extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + + + /** + * title + * + * @var string + * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") + */ + protected $title = ''; + + + /** + * image + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $image = null; + + /** + * Returns the title + * + * @return string $title + */ + public function getTitle() { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle(string $title) { + $this->title = $title; + } + + /** + * Returns the image + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + */ + public function getImage() { + if ($this->image instanceof LazyLoadingProxy) { + $this->image = $this->image->_loadRealInstance(); + } + return $this->image; + } + + /** + * Sets the image + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + * @return void + */ + public function setImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image) { + $this->image = $image; + } + + /** + * __construct + */ + public function __construct() { + + // Do not remove the next line: It would break the functionality + $this->initializeObject(); + } + + /** + * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called) + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + public function initializeObject() { + + } + +} diff --git a/Classes/Domain/Model/Categories.php b/Classes/Domain/Model/Categories.php new file mode 100755 index 0000000..c1d6945 --- /dev/null +++ b/Classes/Domain/Model/Categories.php @@ -0,0 +1,180 @@ +, none + */ + +/** + * Categories + */ +class Categories extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +{ + + /** + * title + * + * @var string + */ + protected $title = ''; + + /** + * description + * + * @var string + */ + protected $description = ''; + + /** + * image + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + */ + protected $image = null; + + /** + * relFilters + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Filters> + */ + protected $relFilters = null; + + /** + * __construct + */ + public function __construct() + { + + // Do not remove the next line: It would break the functionality + $this->initializeObject(); + } + + /** + * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called) + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + public function initializeObject() + { + $this->relFilters = $this->relFilters ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + } + + /** + * Returns the title + * + * @return string $title + */ + public function getTitle() + { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle(string $title) + { + $this->title = $title; + } + + /** + * Returns the description + * + * @return string $description + */ + public function getDescription() + { + return $this->description; + } + + /** + * Sets the description + * + * @param string $description + * @return void + */ + public function setDescription(string $description) + { + $this->description = $description; + } + + /** + * Returns the image + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + */ + public function getImage() + { + return $this->image; + } + + /** + * Sets the image + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + * @return void + */ + public function setImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image) + { + $this->image = $image; + } + + /** + * Adds a Filters + * + * @param \A2G\A2gProducts\Domain\Model\Filters $relFilter + * @return void + */ + public function addRelFilter(\A2G\A2gProducts\Domain\Model\Filters $relFilter) + { + $this->relFilters->attach($relFilter); + } + + /** + * Removes a Filters + * + * @param \A2G\A2gProducts\Domain\Model\Filters $relFilterToRemove The Filters to be removed + * @return void + */ + public function removeRelFilter(\A2G\A2gProducts\Domain\Model\Filters $relFilterToRemove) + { + $this->relFilters->detach($relFilterToRemove); + } + + /** + * Returns the relFilters + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Filters> $relFilters + */ + public function getRelFilters() + { + return $this->relFilters; + } + + /** + * Sets the relFilters + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Filters> $relFilters + * @return void + */ + public function setRelFilters(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relFilters) + { + $this->relFilters = $relFilters; + } +} diff --git a/Classes/Domain/Model/FilterOptions.php b/Classes/Domain/Model/FilterOptions.php new file mode 100755 index 0000000..2cb4e1a --- /dev/null +++ b/Classes/Domain/Model/FilterOptions.php @@ -0,0 +1,120 @@ +, none + */ + +/** + * FilterOptions + */ +class FilterOptions extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +{ + + /** + * title + * + * @var string + */ + protected $title = ''; + + /** + * valueMin + * + * @var float + */ + protected $valueMin = 0.0; + + /** + * valueMax + * + * @var float + */ + protected $valueMax = 0.0; + + /** + * Returns the title + * + * @return string $title + */ + public function getTitle() + { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle(string $title) + { + $this->title = $title; + } + + /** + * Returns the valueMin + * + * @return float $valueMin + */ + public function getValueMin() + { + return $this->valueMin; + } + + /** + * Sets the valueMin + * + * @param float $valueMin + * @return void + */ + public function setValueMin(float $valueMin) + { + $this->valueMin = $valueMin; + } + + /** + * Returns the valueMax + * + * @return float $valueMax + */ + public function getValueMax() + { + return $this->valueMax; + } + + /** + * Sets the valueMax + * + * @param float $valueMax + * @return void + */ + public function setValueMax(float $valueMax) + { + $this->valueMax = $valueMax; + } + + /** + * Getter for _localizedUid. + * + * @return int|null The _localizedUid or NULL if none set yet. + */ + public function getLocalizedUid(): ?int + { + if ($this->_localizedUid !== null) { + return (int)$this->_localizedUid; + } + return null; + } + +} diff --git a/Classes/Domain/Model/FilterValues.php b/Classes/Domain/Model/FilterValues.php new file mode 100755 index 0000000..207e00e --- /dev/null +++ b/Classes/Domain/Model/FilterValues.php @@ -0,0 +1,99 @@ +, none + */ + +/** + * FilterValues + */ +class FilterValues extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + + /** + * value + * + * @var float + */ + protected $value = 0.0; + + /** + * relFilterOptions + * + * @var \A2G\A2gProducts\Domain\Model\FilterOptions + */ + protected $relFilterOption = null; + + /** + * relFilters + * + * @var \A2G\A2gProducts\Domain\Model\Filters + */ + protected $relFilters = null; + + /** + * Returns the value + * + * @return float $value + */ + public function getValue() { + return $this->value; + } + + /** + * Sets the value + * + * @param float $value + * @return void + */ + public function setValue(float $value) { + $this->value = $value; + } + + /** + * Returns the relFilterOption + * + * @return \A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOption + */ + public function getRelFilterOption() { + return $this->relFilterOption; + } + + /** + * Sets the relFilterOption + * + * @param \A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOptio + * @return void + */ + public function setRelFilterOption(\A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOptions) { + $this->relFilterOption = $relFilterOption; + } + + /** + * Returns the relFilters + * + * @return \A2G\A2gProducts\Domain\Model\Filters $relFilters + */ + public function getRelFilters() { + return $this->relFilters; + } + + /** + * Sets the relFilters + * + * @param \A2G\A2gProducts\Domain\Model\Filters $relFilters + * @return void + */ + public function setRelFilters(\A2G\A2gProducts\Domain\Model\Filters $relFilters) { + $this->relFilters = $relFilters; + } + +} diff --git a/Classes/Domain/Model/Filters.php b/Classes/Domain/Model/Filters.php new file mode 100755 index 0000000..6ea9433 --- /dev/null +++ b/Classes/Domain/Model/Filters.php @@ -0,0 +1,234 @@ +, none + */ + +/** + * Filters + */ +class Filters extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +{ + + /** + * dbOperations + * + * @var array + */ + static public $dbOperations = [ + 1 => '=', + 2 => '>', + 3 => '<', + 4 => '>=', + 5 => '<=', + 6 => 'IN' + ]; + + + /** + * dbType + * + * @var array + */ + static public $dbType = [ + 1 => 'range ( uses min and max value )', + 2 => 'compare ( uses just min value )', + 3 => 'useFilterOptions' + ]; + + /** + * title + * + * @var string + */ + protected $title = ''; + + /** + * filterType + * + * @var int + */ + protected $filterType = ''; + + /** + * dbOperationMax + * + * @var int + */ + protected $dbOperationMax = 0; + + /** + * dbOperationMin + * + * @var int + */ + protected $dbOperationMin = ''; + + /** + * relFilterOption + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterOptions> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + */ + protected $relFilterOption = null; + + /** + * Returns the title + * + * @return string $title + */ + public function getTitle() + { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle(string $title) + { + $this->title = $title; + } + + /** + * Returns the filterType + * + * @return string $filterType + */ + public function getFilterType() + { + return $this->filterType; + } + + /** + * Sets the filterType + * + * @param string $filterType + * @return void + */ + public function setFilterType(string $filterType) + { + $this->filterType = $filterType; + } + + /** + * Returns the dbOperationMax + * + * @return int $dbOperationMax + */ + public function getDbOperationMax() + { + return $this->dbOperationMax; + } + + /** + * Sets the dbOperationMax + * + * @param int $dbOperationMax + * @return void + */ + public function setDbOperationMax(int $dbOperationMax) + { + $this->dbOperationMax = $dbOperationMax; + } + + /** + * Returns the dbOperationMin + * + * @return int dbOperationMin + */ + public function getDbOperationMin() + { + return $this->dbOperationMin; + } + + /** + * Sets the dbOperationMin + * + * @param string $dbOperationMin + * @return void + */ + public function setDbOperationMin(string $dbOperationMin) + { + $this->dbOperationMin = $dbOperationMin; + } + + /** + * __construct + */ + public function __construct() + { + + // Do not remove the next line: It would break the functionality + $this->initializeObject(); + } + + /** + * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called) + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + public function initializeObject() + { + $this->relFilterOption = $this->relFilterOption ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + } + + /** + * Adds a FilterOptions + * + * @param \A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOption + * @return void + */ + public function addRelFilterOption(\A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOption) + { + $this->relFilterOption->attach($relFilterOption); + } + + /** + * Removes a FilterOptions + * + * @param \A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOptionToRemove The FilterOptions to be removed + * @return void + */ + public function removeRelFilterOption(\A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOptionToRemove) + { + $this->relFilterOption->detach($relFilterOptionToRemove); + } + + /** + * Returns the relFilterOption + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterOptions> $relFilterOption + */ + public function getRelFilterOption() + { + return $this->relFilterOption; + } + + /** + * Sets the relFilterOption + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterOptions> $relFilterOption + * @return void + */ + public function setRelFilterOption(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relFilterOption) + { + $this->relFilterOption = $relFilterOption; + } +} diff --git a/Classes/Domain/Model/Ingredients.php b/Classes/Domain/Model/Ingredients.php new file mode 100755 index 0000000..2376ccb --- /dev/null +++ b/Classes/Domain/Model/Ingredients.php @@ -0,0 +1,303 @@ +, none + */ + +/** + * Ingredients + */ +class Ingredients extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + + /** + * title + * + * @var string + * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") + */ + protected $title = ''; + + /** + * pathSegment + * + * @var string + */ + protected $pathSegment = ''; + + /** + * description + * + * @var string + */ + protected $description = ''; + + /** + * image + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $image = null; + + /** + * images + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $images = null; + + /** + * gallery + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $gallery = null; + + + /** + * relProducts + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relProducts = null; + + + /** + * Returns the title + * + * @return string $title + */ + public function getTitle() { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle(string $title) { + $this->title = $title; + } + + /** + * Returns the pathSegment + * + * @return string $pathSegment + */ + public function getPathSegment() + { + return $this->pathSegment; + } + + /** + * Sets the pathSegment + * + * @param string $pathSegment + * @return void + */ + public function setPathSegment($pathSegment) + { + $this->pathSegment = $pathSegment; + } + + /** + * Returns the description + * + * @return string $description + */ + public function getDescription() { + return $this->description; + } + + /** + * Sets the description + * + * @param string $description + * @return void + */ + public function setDescription(string $description) { + $this->description = $description; + } + + /** + * Returns the image + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + */ + public function getImage() { + if ($this->image instanceof LazyLoadingProxy) { + $this->image = $this->image->_loadRealInstance(); + } + return $this->image; + } + + /** + * Sets the image + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + * @return void + */ + public function setImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image) { + $this->image = $image; + } + + /** + * Returns the images + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $images + */ + public function getImages() { + return $this->images; + } + + /** + * Sets the images + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $images + * @return void + */ + public function setImages(\TYPO3\CMS\Extbase\Domain\Model\FileReference $images) { + $this->images = $images; + } + + /** + * Returns the gallery + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery + */ + public function getGallery() { + return $this->gallery; + } + + /** + * Sets the gallery + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery + * @return void + */ + public function setGallery(\TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery) { + $this->gallery = $gallery; + } + + + /** + * __construct + */ + public function __construct() { + + // Do not remove the next line: It would break the functionality + $this->initializeObject(); + } + + /** + * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called) + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + public function initializeObject() { + $this->gallery = $this->gallery ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + $this->relProducts = $this->relProducts ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + } + + + /** + * Adds a MasonryItem + * + * @param MasonryItem $relMasonryItem + * @return void + */ + public function addGallerys(MasonryItem $relMasonryItem) { + $this->gallery->attach($relMasonryItem); + } + + /** + * Removes a MasonryItem + * + * @param MasonryItem $relMasonryItem The MasonryItem to be removed + * @return void + */ + public function removeGallerys(MasonryItem $relMasonryItem) { + $this->gallery->detach($relMasonryItem); + } + + /** + * Returns the gallery + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $gallery + */ + public function getGallerys() { + return $this->gallery; + } + + /** + * Sets the gallery + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $gallery + * @return void + */ + public function setGallerys(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $gallery) { + $this->gallery = $gallery; + } + + /** + * Adds a Products + * + * @param Products $relProducts + * @return void + */ + public function addRelProducts(Products $relProducts) { + $this->relProducts->attach($relProducts); + } + + /** + * Removes a Products + * + * @param Products $relProducts The Products to be removed + * @return void + */ + public function removeRelProducts(Products $relProducts) { + $this->relProducts->detach($relProducts); + } + + /** + * Returns the relProducts + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $relProducts + */ + public function getRelProducts() { + return $this->relProducts; + } + + /** + * Sets the relProducts + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $relProducts + * @return void + */ + public function setRelProducts(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relProducts) { + $this->relProducts = $relProducts; + } +} diff --git a/Classes/Domain/Model/MasonryItem.php b/Classes/Domain/Model/MasonryItem.php new file mode 100755 index 0000000..7c94333 --- /dev/null +++ b/Classes/Domain/Model/MasonryItem.php @@ -0,0 +1,96 @@ +, none + */ + +/** + * MasonryItem + */ +class MasonryItem extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + + /** + * header + * + * @var string + */ + protected $header = ''; + + /** + * itemClass + * + * @var string + */ + protected $itemClass = ''; + + /** + * image + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $image = null; + + public function getHeader(): string { + return $this->header; + } + + public function getItemClass(): string { + return $this->itemClass; + } + + public function getImage(): \TYPO3\CMS\Extbase\Domain\Model\FileReference { + if ($this->image instanceof LazyLoadingProxy) { + $this->image = $this->image->_loadRealInstance(); + } + return $this->image; + } + + public function setHeader(string $header): void { + $this->header = $header; + } + + public function setItemClass(string $itemClass): void { + $this->itemClass = $itemClass; + } + + public function setImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image): void { + $this->image = $image; + } + + + /** + * __construct + */ + public function __construct() { + + // Do not remove the next line: It would break the functionality + $this->initializeObject(); + } + + /** + * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called) + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + public function initializeObject() { + $this->relCategory = $this->relCategory ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + $this->relFilterValues = $this->relFilterValues ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + } + +} diff --git a/Classes/Domain/Model/ProductVariantSizes.php b/Classes/Domain/Model/ProductVariantSizes.php new file mode 100755 index 0000000..606a409 --- /dev/null +++ b/Classes/Domain/Model/ProductVariantSizes.php @@ -0,0 +1,180 @@ +, none + */ + +/** + * ProductVariants + */ +class ProductVariantSizes extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + + /** + * nr + * + * @var string + * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") + */ + protected $nr = ''; + + /** + * title + * + * @var string + */ + protected $title = ''; + + /** + * pathSegment + * + * @var string + */ + protected $pathSegment = ''; + + /** + * description + * + * @var string + */ + protected $description = ''; + + /** + * @var ProductVariants + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $productvariant = null; + + /** + * + * @return ProductVariants + */ + public function getProductvariant(): ProductVariants { + if ($this->productvariant instanceof LazyLoadingProxy) { + $this->productvariant = $this->productvariant->_loadRealInstance(); + } + return $this->productvariant; + } + + /** + * + * @param ProductVariants $productvariant + * @return void + */ + public function setProductvariant(ProductVariants $productvariant): void { + $this->productvariant = $productvariant; + } + + + /** + * Returns the nr + * + * @return string $nr + */ + public function getNr() { + return $this->nr; + } + + /** + * Sets the nr + * + * @param string $nr + * @return void + */ + public function setNr(string $nr) { + $this->nr = $nr; + } + + /** + * Returns the title + * + * @return string $title + */ + public function getTitle() { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle(string $title) { + $this->title = $title; + } + + /** + * Returns the pathSegment + * + * @return string $pathSegment + */ + public function getPathSegment() + { + return $this->pathSegment; + } + + /** + * Sets the pathSegment + * + * @param string $pathSegment + * @return void + */ + public function setPathSegment($pathSegment) + { + $this->pathSegment = $pathSegment; + } + + /** + * Returns the description + * + * @return string $description + */ + public function getDescription() { + return $this->description; + } + + /** + * Sets the description + * + * @param string $description + * @return void + */ + public function setDescription(string $description) { + $this->description = $description; + } + + /** + * __construct + */ + public function __construct() { + $this->initializeObject(); + } + + /** + * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called) + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + public function initializeObject() { + } + +} diff --git a/Classes/Domain/Model/ProductVariants.php b/Classes/Domain/Model/ProductVariants.php new file mode 100755 index 0000000..1d802f4 --- /dev/null +++ b/Classes/Domain/Model/ProductVariants.php @@ -0,0 +1,632 @@ +, none + */ + +/** + * ProductVariants + */ +class ProductVariants extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + + /** + * nr + * + * @var string + * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") + */ + protected $nr = ''; + + /** + * title + * + * @var string + */ + protected $title = ''; + + /** + * pathSegment + * + * @var string + */ + protected $pathSegment = ''; + + /** + * description + * + * @var string + */ + protected $description = ''; + + /** + * image + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $image = null; + + /** + * tabIcon + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $tabIcon = null; + + /** + * images + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $images = null; + + /** + * gallery + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $gallery = null; + + /** + * seoImage1x1 + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $seoImage1x1 = null; + /** + * seoImage4x3 + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $seoImage4x3 = null; + /** + * seoImage16x9 + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $seoImage16x9 = null; + + /** + * relCategory + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Categories> + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relCategory = null; + + /** + * relFilterValues + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterValues> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relFilterValues = null; + + /** + * relIngredients + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relIngredients = null; + + + /** + * relFilterValues + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\SelectableAttribute> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relSelectableattribute = null; + + + + /** + * relFilterValues + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\ProductVariantSizes> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relSizes = null; + + /** + * @var Products + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $product = null; + + public function getProduct(): Products { + + if ($this->product instanceof LazyLoadingProxy) { + $this->product = $this->product->_loadRealInstance(); + } + return $this->product; + } + + public function setProduct(Products $product): void { + $this->product = $product; + } + + + /** + * Returns the nr + * + * @return string $nr + */ + public function getNr() { + return $this->nr; + } + + /** + * Sets the nr + * + * @param string $nr + * @return void + */ + public function setNr(string $nr) { + $this->nr = $nr; + } + + /** + * Returns the title + * + * @return string $title + */ + public function getTitle() { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle(string $title) { + $this->title = $title; + } + + /** + * Returns the pathSegment + * + * @return string $pathSegment + */ + public function getPathSegment() + { + return $this->pathSegment; + } + + /** + * Sets the pathSegment + * + * @param string $pathSegment + * @return void + */ + public function setPathSegment($pathSegment) + { + $this->pathSegment = $pathSegment; + } + + /** + * Returns the description + * + * @return string $description + */ + public function getDescription() { + return $this->description; + } + + /** + * Sets the description + * + * @param string $description + * @return void + */ + public function setDescription(string $description) { + $this->description = $description; + } + + /** + * Returns the tabIcon + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $tabIcon + */ + public function getTabIcon() { + if ($this->tabIcon instanceof LazyLoadingProxy) { + $this->tabIcon = $this->tabIcon->_loadRealInstance(); + } + return $this->tabIcon; + } + + /** + * Sets the tabIcon + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $tabIcon + * @return void + */ + public function setTabIcon(\TYPO3\CMS\Extbase\Domain\Model\FileReference $tabIcon) { + $this->tabIcon = $tabIcon; + } + + /** + * Returns the image + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + */ + public function getImage() { + if ($this->image instanceof LazyLoadingProxy) { + $this->image = $this->image->_loadRealInstance(); + } + return $this->image; + } + + /** + * Sets the image + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + * @return void + */ + public function setImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image) { + $this->image = $image; + } + + /** + * Returns the images + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $images + */ + public function getImages() { + return $this->images; + } + + /** + * Sets the images + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $images + * @return void + */ + public function setImages(\TYPO3\CMS\Extbase\Domain\Model\FileReference $images) { + $this->images = $images; + } + + + /** + * Returns the gallery + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery + */ + public function getGallery() { + return $this->gallery; + } + + /** + * Sets the gallery + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery + * @return void + */ + public function setGallery(\TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery) { + $this->gallery = $gallery; + } + + + + /** + * Returns the seoImage1x1 + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage1x1 + */ + public function getSeoImage1x1() { + if ($this->seoImage1x1 instanceof LazyLoadingProxy) { + $this->seoImage1x1 = $this->seoImage1x1->_loadRealInstance(); + } + return $this->seoImage1x1; + } + + /** + * Sets the seoImage1x1 + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage1x1 + * @return void + */ + public function setSeoImage1x1(\TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage1x1) { + $this->seoImage1x1 = $seoImage1x1; + } + + /** + * Returns the seoImage4x3 + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage4x3 + */ + public function getSeoImage4x3() { + if ($this->seoImage4x3 instanceof LazyLoadingProxy) { + $this->seoImage4x3 = $this->seoImage4x3->_loadRealInstance(); + } + return $this->seoImage4x3; + } + + /** + * Sets the seoImage4x3 + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage4x3 + * @return void + */ + public function setSeoImage4x3(\TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage4x3) { + $this->seoImage4x3 = $seoImage4x3; + } + + /** + * Returns the seoImage16x9 + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage16x9 + */ + public function getSeoImage16x9() { + if ($this->seoImage16x9 instanceof LazyLoadingProxy) { + $this->seoImage16x9 = $this->seoImage16x9->_loadRealInstance(); + } + return $this->seoImage16x9; + } + + /** + * Sets the seoImage16x9 + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage16x9 + * @return void + */ + public function setSeoImage16x9(\TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage16x9) { + $this->seoImage16x9 = $seoImage16x9; + } + + + /** + * __construct + */ + public function __construct() { + + // Do not remove the next line: It would break the functionality + $this->initializeObject(); + } + + /** + * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called) + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + public function initializeObject() { + $this->relCategory = $this->relCategory ?: new ObjectStorage(); + $this->relFilterValues = $this->relFilterValues ?: new ObjectStorage(); + $this->relIngredients = $this->relIngredients ?: new ObjectStorage(); + $this->relSelectableattribute = $this->relSelectableattribute ?: new ObjectStorage(); + $this->relSizes = $this->relSizes ?: new ObjectStorage(); + } + + /** + * Adds a Size + * + * @param \A2G\A2gProducts\Domain\Model\ProductVariantSizes $relSizes + * @return void + */ + public function addRelSizes(\A2G\A2gProducts\Domain\Model\ProductVariantSizes $relSizes) { + $this->relSizes->attach($relSizes); + } + + /** + * Removes a Categories + * + * @param \A2G\A2gProducts\Domain\Model\Categories $relSizesToRemove The Categories to be removed + * @return void + */ + public function removeRelSizes(\A2G\A2gProducts\Domain\Model\ProductVariantSizes $relSizesToRemove) { + $this->relSizes->detach($relSizesToRemove); + } + + /** + * Returns the relSizes + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\ProductVariantSizes> $relSizes + */ + public function getRelSizes() { + return $this->relSizes; + } + + /** + * Sets the relSizes + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\ProductVariantSizes> $relSizes + * @return void + */ + public function setRelSizes(ObjectStorage $relSizes) { + $this->relSizes = $relSizes; + } + + /** + * Adds a Categories + * + * @param \A2G\A2gProducts\Domain\Model\Categories $relCategory + * @return void + */ + public function addRelCategory(\A2G\A2gProducts\Domain\Model\Categories $relCategory) { + $this->relCategory->attach($relCategory); + } + + /** + * Removes a Categories + * + * @param \A2G\A2gProducts\Domain\Model\Categories $relCategoryToRemove The Categories to be removed + * @return void + */ + public function removeRelCategory(\A2G\A2gProducts\Domain\Model\Categories $relCategoryToRemove) { + $this->relCategory->detach($relCategoryToRemove); + } + + /** + * Returns the relCategory + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Categories> $relCategory + */ + public function getRelCategory() { + return $this->relCategory; + } + + /** + * Sets the relCategory + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Categories> $relCategory + * @return void + */ + public function setRelCategory(ObjectStorage $relCategory) { + $this->relCategory = $relCategory; + } + + /** + * Adds a FilterValues + * + * @param \A2G\A2gProducts\Domain\Model\FilterValues $relFilterValue + * @return void + */ + public function addRelFilterValue(\A2G\A2gProducts\Domain\Model\FilterValues $relFilterValue) { + $this->relFilterValues->attach($relFilterValue); + } + + /** + * Removes a FilterValues + * + * @param \A2G\A2gProducts\Domain\Model\FilterValues $relFilterValueToRemove The FilterValues to be removed + * @return void + */ + public function removeRelFilterValue(\A2G\A2gProducts\Domain\Model\FilterValues $relFilterValueToRemove) { + $this->relFilterValues->detach($relFilterValueToRemove); + } + + /** + * Returns the relFilterValues + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterValues> $relFilterValues + */ + public function getRelFilterValues() { + return $this->relFilterValues; + } + + /** + * Sets the relFilterValues + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterValues> $relFilterValues + * @return void + */ + public function setRelFilterValues(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relFilterValues) { + $this->relFilterValues = $relFilterValues; + } + + /** + * Adds a FilterValues + * + * @param Ingredients $relIngredients + * @return void + */ + public function addRelIngredients(Ingredients $relIngredients) { + $this->relIngredients->attach($relIngredients); + } + + /** + * Removes a FilterValues + * + * @param Ingredients $relIngredients The Ingredients to be removed + * @return void + */ + public function removeRelIngredients(Ingredients $relIngredients) { + $this->relIngredients->detach($relIngredients); + } + + /** + * Returns the relIngredients + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $relIngredients + */ + public function getRelIngredients() { + return $this->relIngredients; + } + + /** + * Sets the relIngredients + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $relIngredients + * @return void + */ + public function setRelIngredients(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relIngredients) { + $this->relIngredients = $relIngredients; + } + /** + * Adds a SelectableAttribute + * + * @param \A2G\A2gProducts\Domain\Model\SelectableAttribute $relSelectableattribute + * @return void + */ + public function addRelSelectableattribute(\A2G\A2gProducts\Domain\Model\SelectableAttribute $relSelectableattribute) { + $this->relSelectableattribute->attach($relSelectableattribute); + } + + /** + * Removes a SelectableAttribute + * + * @param \A2G\A2gProducts\Domain\Model\SelectableAttribute $relSelectableattributeToRemove The SelectableAttribute to be removed + * @return void + */ + public function removeRelSelectableattribute(\A2G\A2gProducts\Domain\Model\SelectableAttribute $relSelectableattributeToRemove) { + $this->relSelectableattribute->detach($relSelectableattributeToRemove); + } + + /** + * Returns the relSelectableAttribute + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\SelectableAttribute> $relSelectableattribute + */ + public function getRelSelectableattribute() { + return $this->relSelectableattribute; + } + + /** + * Sets the relSelectableAttribute + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\SelectableAttribute> $relSelectableattribute + * @return void + */ + public function setRelSelectableattribute(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relSelectableattribute) { + $this->relSelectableattribute = $relSelectableattribute; + } +} diff --git a/Classes/Domain/Model/Products.php b/Classes/Domain/Model/Products.php new file mode 100755 index 0000000..acbeb4f --- /dev/null +++ b/Classes/Domain/Model/Products.php @@ -0,0 +1,677 @@ +, none + */ + +/** + * Products + */ +class Products extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + + /** + * nr + * + * @var string + * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") + */ + protected $nr = ''; + + /** + * title + * + * @var string + * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") + */ + protected $title = ''; + + /** + * pathSegment + * + * @var string + */ + protected $pathSegment = ''; + + /** + * description + * + * @var string + */ + protected $description = ''; + + /** + * descriptionHtml + * + * @var string + */ + protected $descriptionHtml = ''; + + /** + * image + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $image = null; + + /** + * images + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $images = null; + + /** + * gallery + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $gallery = null; + + + /** + * seoImage1x1 + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $seoImage1x1 = null; + /** + * seoImage4x3 + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $seoImage4x3 = null; + /** + * seoImage16x9 + * + * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $seoImage16x9 = null; + + /** + * relCategory + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Categories> + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relCategory = null; + + /** + * relFilterValues + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterValues> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relFilterValues = null; + + /** + * relIngredients + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relIngredients = null; + + /** + * relProductvariants + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relProductvariants = null; + + /** + * relFilterValues + * + * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\SelectableAttribute> + * @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove") + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relSelectableattribute = null; + + /** + * relBrand + * + * @var Brands + * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy + */ + protected $relBrand = null; + + /** + * Returns the nr + * + * @return string $nr + */ + public function getNr() { + return $this->nr; + } + + /** + * Sets the nr + * + * @param string $nr + * @return void + */ + public function setNr(string $nr) { + $this->nr = $nr; + } + + /** + * Returns the title + * + * @return string $title + */ + public function getTitle() { + return $this->title; + } + + /** + * Sets the title + * + * @param string $title + * @return void + */ + public function setTitle(string $title) { + $this->title = $title; + } + + /** + * Returns the pathSegment + * + * @return string $pathSegment + */ + public function getPathSegment() { + return $this->pathSegment; + } + + /** + * Sets the pathSegment + * + * @param string $pathSegment + * @return void + */ + public function setPathSegment($pathSegment) { + $this->pathSegment = $pathSegment; + } + + /** + * Returns the description + * + * @return string $description + */ + public function getDescription() { + return $this->description; + } + + /** + * Sets the description + * + * @param string $description + * @return void + */ + public function setDescription(string $description) { + $this->description = $description; + } + + public function getDescriptionHtml(): string { + return $this->descriptionHtml; + } + + public function setDescriptionHtml(string $descriptionHtml): void { + $this->descriptionHtml = $descriptionHtml; + } + + /** + * Returns the image + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + */ + public function getImage() { + if ($this->image instanceof LazyLoadingProxy) { + $this->image = $this->image->_loadRealInstance(); + } + return $this->image; + } + + /** + * Sets the image + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image + * @return void + */ + public function setImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image) { + $this->image = $image; + } + + /** + * Returns the images + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $images + */ + public function getImages() { + return $this->images; + } + + /** + * Sets the images + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $images + * @return void + */ + public function setImages(\TYPO3\CMS\Extbase\Domain\Model\FileReference $images) { + $this->images = $images; + } + + /** + * Returns the gallery + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery + */ + public function getGallery() { + return $this->gallery; + } + + /** + * Sets the gallery + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery + * @return void + */ + public function setGallery(\TYPO3\CMS\Extbase\Domain\Model\FileReference $gallery) { + $this->gallery = $gallery; + } + + + + /** + * Returns the seoImage1x1 + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage1x1 + */ + public function getSeoImage1x1() { + if ($this->seoImage1x1 instanceof LazyLoadingProxy) { + $this->seoImage1x1 = $this->seoImage1x1->_loadRealInstance(); + } + return $this->seoImage1x1; + } + + /** + * Sets the seoImage1x1 + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage1x1 + * @return void + */ + public function setSeoImage1x1(\TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage1x1) { + $this->seoImage1x1 = $seoImage1x1; + } + + /** + * Returns the seoImage4x3 + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage4x3 + */ + public function getSeoImage4x3() { + if ($this->seoImage4x3 instanceof LazyLoadingProxy) { + $this->seoImage4x3 = $this->seoImage4x3->_loadRealInstance(); + } + return $this->seoImage4x3; + } + + /** + * Sets the seoImage4x3 + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage4x3 + * @return void + */ + public function setSeoImage4x3(\TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage4x3) { + $this->seoImage4x3 = $seoImage4x3; + } + + /** + * Returns the seoImage16x9 + * + * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage16x9 + */ + public function getSeoImage16x9() { + if ($this->seoImage16x9 instanceof LazyLoadingProxy) { + $this->seoImage16x9 = $this->seoImage16x9->_loadRealInstance(); + } + return $this->seoImage16x9; + } + + /** + * Sets the seoImage16x9 + * + * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage16x9 + * @return void + */ + public function setSeoImage16x9(\TYPO3\CMS\Extbase\Domain\Model\FileReference $seoImage16x9) { + $this->seoImage16x9 = $seoImage16x9; + } + + + + + /** + * __construct + */ + public function __construct() { + + // Do not remove the next line: It would break the functionality + $this->initializeObject(); + } + + /** + * Initializes all ObjectStorage properties when model is reconstructed from DB (where __construct is not called) + * Do not modify this method! + * It will be rewritten on each save in the extension builder + * You may modify the constructor of this class instead + * + * @return void + */ + public function initializeObject() { + $this->relCategory = $this->relCategory ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + $this->relFilterValues = $this->relFilterValues ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + $this->relIngredients = $this->relIngredients ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + $this->relSelectableattribute = $this->relSelectableattribute ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + $this->relProductvariants = $this->relProductvariants ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + $this->gallery = $this->gallery ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); +// $this->relBrand = $this->relBrand ?: new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); + } + + /** + * Adds a Categories + * + * @param \A2G\A2gProducts\Domain\Model\Categories $relCategory + * @return void + */ + public function addRelCategory(\A2G\A2gProducts\Domain\Model\Categories $relCategory) { + $this->relCategory->attach($relCategory); + } + + /** + * Removes a Categories + * + * @param \A2G\A2gProducts\Domain\Model\Categories $relCategoryToRemove The Categories to be removed + * @return void + */ + public function removeRelCategory(\A2G\A2gProducts\Domain\Model\Categories $relCategoryToRemove) { + $this->relCategory->detach($relCategoryToRemove); + } + + /** + * Returns the relCategory + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Categories> $relCategory + */ + public function getRelCategory() { + return $this->relCategory; + } + + /** + * Sets the relCategory + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\Categories> $relCategory + * @return void + */ + public function setRelCategory(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relCategory) { + $this->relCategory = $relCategory; + } + + /** + * Adds a FilterValues + * + * @param \A2G\A2gProducts\Domain\Model\FilterValues $relFilterValue + * @return void + */ + public function addRelFilterValue(\A2G\A2gProducts\Domain\Model\FilterValues $relFilterValue) { + $this->relFilterValues->attach($relFilterValue); + } + + /** + * Removes a FilterValues + * + * @param \A2G\A2gProducts\Domain\Model\FilterValues $relFilterValueToRemove The FilterValues to be removed + * @return void + */ + public function removeRelFilterValue(\A2G\A2gProducts\Domain\Model\FilterValues $relFilterValueToRemove) { + $this->relFilterValues->detach($relFilterValueToRemove); + } + + /** + * Returns the relFilterValues + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterValues> $relFilterValues + */ + public function getRelFilterValues() { + return $this->relFilterValues; + } + + /** + * Sets the relFilterValues + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\FilterValues> $relFilterValues + * @return void + */ + public function setRelFilterValues(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relFilterValues) { + $this->relFilterValues = $relFilterValues; + } + + /** + * Adds a SelectableAttribute + * + * @param \A2G\A2gProducts\Domain\Model\SelectableAttribute $relSelectableattribute + * @return void + */ + public function addRelSelectableattribute(\A2G\A2gProducts\Domain\Model\SelectableAttribute $relSelectableattribute) { + $this->relSelectableattribute->attach($relSelectableattribute); + } + + /** + * Removes a SelectableAttribute + * + * @param \A2G\A2gProducts\Domain\Model\SelectableAttribute $relSelectableattributeToRemove The SelectableAttribute to be removed + * @return void + */ + public function removeRelSelectableattribute(\A2G\A2gProducts\Domain\Model\SelectableAttribute $relSelectableattributeToRemove) { + $this->relSelectableattribute->detach($relSelectableattributeToRemove); + } + + /** + * Returns the relSelectableAttribute + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\SelectableAttribute> $relSelectableattribute + */ + public function getRelSelectableattribute() { + return $this->relSelectableattribute; + } + + /** + * Sets the relSelectableAttribute + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gProducts\Domain\Model\SelectableAttribute> $relSelectableattribute + * @return void + */ + public function setRelSelectableattribute(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relSelectableattribute) { + $this->relSelectableattribute = $relSelectableattribute; + } + + /** + * Adds a FilterValues + * + * @param Ingredients $relIngredients + * @return void + */ + public function addRelIngredients(Ingredients $relIngredients) { + $this->relIngredients->attach($relIngredients); + } + + /** + * Removes a FilterValues + * + * @param Ingredients $relIngredients The Ingredients to be removed + * @return void + */ + public function removeRelIngredients(Ingredients $relIngredients) { + $this->relIngredients->detach($relIngredients); + } + + /** + * Returns the relIngredients + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $relIngredients + */ + public function getRelIngredients() { + return $this->relIngredients; + } + + /** + * Sets the relIngredients + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $relIngredients + * @return void + */ + public function setRelIngredients(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relIngredients) { + $this->relIngredients = $relIngredients; + } + + /** + * Adds a MasonryItem + * + * @param MasonryItem $relMasonryItem + * @return void + */ + public function addGallerys(MasonryItem $relMasonryItem) { + $this->gallery->attach($relMasonryItem); + } + + /** + * Removes a MasonryItem + * + * @param MasonryItem $relMasonryItem The MasonryItem to be removed + * @return void + */ + public function removeGallerys(MasonryItem $relMasonryItem) { + $this->gallery->detach($relMasonryItem); + } + + /** + * Returns the gallery + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $gallery + */ + public function getGallerys() { + return $this->gallery; + } + + /** + * Sets the gallery + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $gallery + * @return void + */ + public function setGallerys(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $gallery) { + $this->gallery = $gallery; + } + +// +// public function getRelProductvariants() { +// return $this->relProductvariants; +// } +// +// public function setRelProductvariants($relProductvariants): void { +// $this->relProductvariants = $relProductvariants; +// } +// +// + + /** + * Adds a FilterValues + * + * @param ProductVariants $relProductvariants + * @return void + */ + public function addRelProductvariants($relProductvariants) { + $this->relProductvariants->attach($relProductvariants); + } + + /** + * Removes a FilterValues + * + * @param ProductVariants $relProductvariants The ProductVariants to be removed + * @return void + */ + public function removeRelProductvariants($relProductvariants) { + $this->relProductvariants->detach($relProductvariants); + } + + /** + * Returns the relProductvariants + * + * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $relProductvariants + */ + public function getRelProductvariants() { + return $this->relProductvariants; + } + + /** + * Sets the relProductvariants + * + * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $relProductvariants + * @return void + */ + public function setRelProductvariants(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relProductvariants) { + $this->relProductvariants = $relProductvariants; + } + + /** + * Returns the relBrand + * + * @return Brands|null + */ + public function getRelBrand():?Brands { + if ($this->relBrand instanceof LazyLoadingProxy) { + $this->relBrand = $this->relBrand->_loadRealInstance(); + } + return $this->relBrand; + } + + /** + * Sets the relBrand + * + * @param Brands|null $relBrand + * @return void + */ + public function setRelBrand(?Brands $relBrand) { + $this->relBrand = $relBrand; + } +} diff --git a/Classes/Domain/Model/SelectableAttribute.php b/Classes/Domain/Model/SelectableAttribute.php new file mode 100755 index 0000000..66b8985 --- /dev/null +++ b/Classes/Domain/Model/SelectableAttribute.php @@ -0,0 +1,87 @@ +, none + */ + +/** + * SelectableAttribute + */ +class SelectableAttribute extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { + + /** + * relFilterOptions + * + * @var \A2G\A2gProducts\Domain\Model\FilterOptions + */ + protected $relFilterOption = null; + + /** + * relFilters + * + * @var \A2G\A2gProducts\Domain\Model\Filters + */ + protected $relFilters = null; + + /** + * + * @var string + */ + protected $title = ''; + + /** + * Returns the relFilterOption + * + * @return \A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOption + */ + public function getRelFilterOption() { + return $this->relFilterOption; + } + + /** + * Sets the relFilterOption + * + * @param \A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOptio + * @return void + */ + public function setRelFilterOption(\A2G\A2gProducts\Domain\Model\FilterOptions $relFilterOptions) { + $this->relFilterOption = $relFilterOption; + } + + /** + * Returns the relFilters + * + * @return \A2G\A2gProducts\Domain\Model\Filters $relFilters + */ + public function getRelFilters() { + return $this->relFilters; + } + + /** + * Sets the relFilters + * + * @param \A2G\A2gProducts\Domain\Model\Filters $relFilters + * @return void + */ + public function setRelFilters(\A2G\A2gProducts\Domain\Model\Filters $relFilters) { + $this->relFilters = $relFilters; + } + + public function getTitle(): string { + return $this->title; + } + + public function setTitle(string $title): void { + $this->title = $title; + } + +} diff --git a/Classes/Domain/Repository/CategoriesRepository.php b/Classes/Domain/Repository/CategoriesRepository.php new file mode 100755 index 0000000..5ab96bd --- /dev/null +++ b/Classes/Domain/Repository/CategoriesRepository.php @@ -0,0 +1,43 @@ +, web-crossing gmbh + * + * * */ + +/** + * The repository for Categories + */ +class CategoriesRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + + /** + * @var array + */ + protected $defaultOrderings = [ + 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING + ]; + + /** + * @param array $uids + */ + public function findByUids(array $uids = []) { + if (!empty($uids)) { + $query = $this->createQuery(); + $constraints = []; + $constraints[] = $query->in('uid', $uids); + $query->matching($query->logicalAnd($constraints)); + return $query->execute(); + } + } + +} diff --git a/Classes/Domain/Repository/FilterOptionsRepository.php b/Classes/Domain/Repository/FilterOptionsRepository.php new file mode 100755 index 0000000..fe1d6d6 --- /dev/null +++ b/Classes/Domain/Repository/FilterOptionsRepository.php @@ -0,0 +1,30 @@ +, web-crossing gmbh + * + * * */ + +/** + * The repository for FilterOptions + */ +class FilterOptionsRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + + /** + * @var array + */ + protected $defaultOrderings = [ + 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING + ]; +} diff --git a/Classes/Domain/Repository/FiltersRepository.php b/Classes/Domain/Repository/FiltersRepository.php new file mode 100755 index 0000000..9b5cb42 --- /dev/null +++ b/Classes/Domain/Repository/FiltersRepository.php @@ -0,0 +1,51 @@ +, none + */ + +/** + * The repository for Products + */ +class FiltersRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + /** + * @var array + */ + + protected $defaultOrderings = [ + 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING + ]; + + /** + * @param array $categoryUids + */ + public function getFromCategories(array $categoryUids = []) { + $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language'); + $sys_language_uid = $languageAspect->getId(); + + $query = $this->createQuery(); + $sql = 'SELECT DISTINCT fT.* FROM tx_a2gproducts_domain_model_filters AS fT ' + . 'JOIN tx_a2gproducts_categories_filters_mm AS mmT ON mmT.uid_foreign = fT.uid' + . ' WHERE fT.hidden=0 AND fT.deleted=0 ' + . (empty($categoryUids) ? '' :'AND mmT.uid_local IN (' . implode(',', $categoryUids ) . ') ') + . 'AND fT.sys_language_uid IN (:dcSysLanguageUid, -1) ORDER BY fT.sorting'; + $arguments = [ + ':dcSysLanguageUid' => $sys_language_uid + ]; + $query->statement($sql, $arguments); + return $query->execute(); + } + +} diff --git a/Classes/Domain/Repository/IngredientsRepository.php b/Classes/Domain/Repository/IngredientsRepository.php new file mode 100755 index 0000000..233ad90 --- /dev/null +++ b/Classes/Domain/Repository/IngredientsRepository.php @@ -0,0 +1,33 @@ +, none + */ + +/** + * The repository for Ingredients + */ +class IngredientsRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + + /** + * @var array + */ + protected $defaultOrderings = [ + 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING + ]; + + public function initializeObject() { + $querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class); + $querySettings->setRespectStoragePage(false); + $this->setDefaultQuerySettings($querySettings); + } +} diff --git a/Classes/Domain/Repository/ProductVariantsRepository.php b/Classes/Domain/Repository/ProductVariantsRepository.php new file mode 100755 index 0000000..afeed34 --- /dev/null +++ b/Classes/Domain/Repository/ProductVariantsRepository.php @@ -0,0 +1,27 @@ +, none + */ + +/** + * The repository for ProductVariants + */ +class ProductVariantsRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + + /** + * @var array + */ + protected $defaultOrderings = [ + 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING + ]; +} diff --git a/Classes/Domain/Repository/ProductsRepository.php b/Classes/Domain/Repository/ProductsRepository.php new file mode 100755 index 0000000..7af0ff4 --- /dev/null +++ b/Classes/Domain/Repository/ProductsRepository.php @@ -0,0 +1,204 @@ +, none + */ + +/** + * The repository for Products + */ +class ProductsRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { + + use InjectFiltersRepositoryTrait; + use InjectFilterOptionsRepositoryTrait; + + /** + * @param array $categoryUids + */ + public function getFromCategories(array $categoryUids, int $limit = 0, int $offset = 0, array $excludeProduct = [], bool $random = false) { + if (!empty($categoryUids)) { + $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language'); + $sys_language_uid = $languageAspect->getId(); + $query = $this->createQuery(); + + $sql = ' SELECT DISTINCT pT.* FROM tx_a2gproducts_domain_model_products AS pT ' + . 'JOIN tx_a2gproducts_domain_model_productvariants AS pvT ON pvT.product = pT.uid ' + . 'JOIN tx_a2gproducts_products_categories_mm AS mmT ON mmT.uid_local = pT.uid '; + $sqlWhere = ' WHERE pT.hidden=0 AND pT.deleted=0 AND pvT.hidden=0 AND pvT.deleted=0 AND mmT.uid_foreign IN (' . implode(',', $categoryUids) . ') AND pT.sys_language_uid IN (-1, :dcSysLangUid) '; + $arguments = [ + ':dcSysLangUid' => $sys_language_uid + ]; + + if (!empty($excludeProduct)) { + $sqlWhere .= ' AND pT.uid NOT IN (' . implode(',', $excludeProduct) . ') '; + } + + if ($random) { + $sqlWhere .= ' ORDER BY RAND() '; + } else { + $sqlWhere .= ' ORDER BY pT.sorting '; + } + + + + if ($limit > 0) { + $sqlWhere .= ' LIMIT :dcLimit '; + $arguments[':dcLimit'] = $limit; + } + if ($offset > 0) { + $sqlWhere .= ' OFFSET :dcOffset '; + $arguments[':dcOffset'] = $offset; + } + + $query->statement($sql . $sqlWhere, $arguments); + return $query->execute(); + } else { + return $this->findAll(); + } + } + + /** + * + * @param array $categoryUids + * @param array $mainFilter + * @param string $search + * @param int $limit + * @param int $offset + * @param QueryResult $filters + * @param bool $random + * @return QueryResult + */ + public function filter(array $categoryUids, array $mainFilter = [], string $search = '', int $limit = 0, int $offset = 0, QueryResult $filters = null, bool $random = false): QueryResult { + $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language'); + $sys_language_uid = $languageAspect->getId(); + + $query = $this->createQuery(); + $sql = 'SELECT DISTINCT pT.* FROM tx_a2gproducts_domain_model_products AS pT ' + . 'JOIN tx_a2gproducts_domain_model_productvariants AS pvT ON pvT.product = pT.uid ' + . 'JOIN tx_a2gproducts_products_categories_mm AS mmT ON mmT.uid_local = pT.uid '; + $sqlWhere = 'WHERE pT.hidden=0 AND pT.deleted=0 AND pvT.hidden=0 AND pvT.deleted=0 AND pT.sys_language_uid IN (:dcSysLangUid,-1) '; + if(!empty($categoryUids)){ + $sqlWhere .= 'AND mmT.uid_foreign IN (' . implode(',', $categoryUids) . ') '; + } + $arguments = [ + ':dcSysLangUid' => $sys_language_uid + ]; + + if (trim($search) !== '') { + $sqlWhere .= 'AND pT.title LIKE :dcSearch '; + $arguments[':dcSearch'] = '%' . $search . '%'; + } + + $filtersSortet = []; + foreach ($filters as $filter) { + $filtersSortet[$filter->getUid()] = $filter; + } + $x = 1; + $i = 0; + + $sql1 = ' '; + $sqlWhere1 = ' '; + + foreach ($mainFilter AS $key => $filter) { + if($filtersSortet[$key] === null){ + $mainFilter[$key] = null; + } + } + $mainFilter = array_filter($mainFilter); + if (!empty($mainFilter)) { + $sqlWhere .= ' AND ( '; + foreach ($mainFilter AS $key => $filter) { + $i = 0; + if ($x > 1) { + $sqlWhere .= ' AND '; + } + $sqlWhere .= ' ( '; +// $sqlWhere1 .= ' ( '; + if (!empty($filter)) { + foreach ($filter AS $kay => $opt) { + if ($i > 0) { + $sqlWhere .= ' OR '; + } else { +// $sqlWhere .= ' ( fv' . $x . 'T.hidden = 0 OR fvpv' . $x . 'T.hidden = 0 OR sav' . $x . 'T.hidden = 0 OR savpv' . $x . 'T.hidden = 0 ) AND ( '; + } + $filterOpt = $this->filteroptionRepository->findByUid((int) $kay); + switch ($filtersSortet[$key]->getFilterType()) { + case 1: + // 'range ( uses min and max value )' + $sqlWhere .= ' ( fv' . $x . 'T.value ' . Filters::$dbOperations[$filtersSortet[$key]->getDbOperationMin()] . ' ' . $filterOpt->getValueMin() . ' '; + if ($filterOpt->getValueMax() > 0) { + $sqlWhere .= ' AND fv' . $x . 'T.value ' . Filters::$dbOperations[$filtersSortet[$key]->getDbOperationMax()] . ' ' . $filterOpt->getValueMax(); + } + $sqlWhere .= ' ) '; + break; + case 2: + // 'compare ( uses just min value )' + if (Filters::$dbOperations[$filtersSortet[$key]->getDbOperationMin()] === 'IN') { + $sqlWhere .= '( fv' . $x . 'T.value IN (' . $filterOpt->getValueMin() . ' ) '; + } else { + $sqlWhere .= '( fv' . $x . 'T.value ' . Filters::$dbOperations[$filtersSortet[$key]->getDbOperationMin()] . ' ' . $filterOpt->getValueMin() . ' ) '; + } + break; + case 3: + // uses no value + $sqlWhere .= '( ' + . '( fv' . $x . 'T.rel_filter_option = ' . (int) $kay . ' AND fv' . $x . 'T.hidden = 0 ) ' + . 'OR ( fvpv' . $x . 'T.rel_filter_option = ' . (int) $kay . ' AND fvpv' . $x . 'T.hidden = 0 ) ' +// . 'OR ( sav' . $x . 'T.rel_filter_option = ' . (int) $kay . ' AND sav' . $x . 'T.hidden = 0 ) ' + . 'OR ( savpv' . $x . 'T.rel_filter_option = ' . (int) $kay . ' AND savpv' . $x . 'T.hidden = 0 ) ' + . ') '; + break; + } + $i = 1; + } + +// $sqlWhere .= ' ) '; + } + $sql .= 'LEFT JOIN tx_a2gproducts_domain_model_filtervalues AS fv' . $x . 'T ON fv' . $x . 'T.products = pT.uid ' + . 'LEFT JOIN tx_a2gproducts_domain_model_filtervalues AS fvpv' . $x . 'T ON fvpv' . $x . 'T.productvariants = pvT.uid ' +// . 'LEFT JOIN tx_a2gproducts_domain_model_selectableattribute AS sav' . $x . 'T ON sav' . $x . 'T.products = pT.uid ' + . 'LEFT JOIN tx_a2gproducts_domain_model_selectableattribute AS savpv' . $x . 'T ON savpv' . $x . 'T.productvariants = pvT.uid '; + $arguments[':dcKey' . $x] = (int) $key; + $x = $x + 1; + $sqlWhere .= ' ) '; + } + $sqlWhere .= ' ) '; + } + + if ($random) { + $sqlWhere .= ' ORDER BY RAND()'; + } else { + $sqlWhere .= ' ORDER BY pT.sorting'; + } + + if ($limit > 0) { + $sqlWhere .= ' LIMIT :dcLimit '; + $arguments[':dcLimit'] = $limit; + } + if ($offset > 0) { + $sqlWhere .= ' OFFSET :dcOffset '; + $arguments[':dcOffset'] = $offset; + } + $query->statement($sql . $sqlWhere, $arguments); + return $query->execute(); + } + +} diff --git a/Classes/Domain/Traits/InjectCategoriesRepositoryTrait.php b/Classes/Domain/Traits/InjectCategoriesRepositoryTrait.php new file mode 100755 index 0000000..550443d --- /dev/null +++ b/Classes/Domain/Traits/InjectCategoriesRepositoryTrait.php @@ -0,0 +1,32 @@ +categoriesRepository = $categoriesRepository; + } + +} diff --git a/Classes/Domain/Traits/InjectContentObjectRendererTrait.php b/Classes/Domain/Traits/InjectContentObjectRendererTrait.php new file mode 100755 index 0000000..e80962c --- /dev/null +++ b/Classes/Domain/Traits/InjectContentObjectRendererTrait.php @@ -0,0 +1,33 @@ +contentObjectRenderer = $contentObjectRenderer; + } +} diff --git a/Classes/Domain/Traits/InjectFilterOptionsRepositoryTrait.php b/Classes/Domain/Traits/InjectFilterOptionsRepositoryTrait.php new file mode 100755 index 0000000..31bbf1a --- /dev/null +++ b/Classes/Domain/Traits/InjectFilterOptionsRepositoryTrait.php @@ -0,0 +1,35 @@ +filteroptionRepository = $filteroptionRepository; + } + +} diff --git a/Classes/Domain/Traits/InjectFiltersRepositoryTrait.php b/Classes/Domain/Traits/InjectFiltersRepositoryTrait.php new file mode 100755 index 0000000..e678c8f --- /dev/null +++ b/Classes/Domain/Traits/InjectFiltersRepositoryTrait.php @@ -0,0 +1,31 @@ +filtersRepository = $filtersRepository; + } +} diff --git a/Classes/Domain/Traits/InjectImageServiceTrait.php b/Classes/Domain/Traits/InjectImageServiceTrait.php new file mode 100755 index 0000000..3c7d4c3 --- /dev/null +++ b/Classes/Domain/Traits/InjectImageServiceTrait.php @@ -0,0 +1,35 @@ +imageService = $imageService; + } + +} diff --git a/Classes/Domain/Traits/InjectIngredientsRepositoryTrait.php b/Classes/Domain/Traits/InjectIngredientsRepositoryTrait.php new file mode 100755 index 0000000..b73e408 --- /dev/null +++ b/Classes/Domain/Traits/InjectIngredientsRepositoryTrait.php @@ -0,0 +1,27 @@ +ingredientsRepository = $ingredientsRepository; + } + +} diff --git a/Classes/Domain/Traits/InjectProductsRepositoryTrait.php b/Classes/Domain/Traits/InjectProductsRepositoryTrait.php new file mode 100755 index 0000000..d7ba8fa --- /dev/null +++ b/Classes/Domain/Traits/InjectProductsRepositoryTrait.php @@ -0,0 +1,32 @@ +productsRepository = $productsRepository; + } + +} diff --git a/Classes/Hreflang/EventListener/ProductsHrefLang.php b/Classes/Hreflang/EventListener/ProductsHrefLang.php new file mode 100755 index 0000000..0a1099c --- /dev/null +++ b/Classes/Hreflang/EventListener/ProductsHrefLang.php @@ -0,0 +1,51 @@ +cObj = $cObj; + $this->languageMenuProcessor = $languageMenuProcessor; + } + + + public function __invoke(ModifyHrefLangTagsEvent $event): void + { + $hrefLangs = $event->getHrefLangs(); + $request = $event->getRequest(); + + // Do anything you want with $hrefLangs + $hrefLangs = [ + 'en-US' => 'https://example.com', + 'nl-NL' => 'https://example.com/nl' + ]; + + // Override all hrefLang tags + $event->setHrefLangs($hrefLangs); + + // Or add a single hrefLang tag + $event->addHrefLang('de-DE', 'https://example.com/de'); + } +} diff --git a/Classes/PageTitle/A2gPageTitleProvider.php b/Classes/PageTitle/A2gPageTitleProvider.php new file mode 100755 index 0000000..9c2f433 --- /dev/null +++ b/Classes/PageTitle/A2gPageTitleProvider.php @@ -0,0 +1,22 @@ +title = $title; + } +} \ No newline at end of file diff --git a/Classes/Services/FeuserSessionService.php b/Classes/Services/FeuserSessionService.php new file mode 100755 index 0000000..a758615 --- /dev/null +++ b/Classes/Services/FeuserSessionService.php @@ -0,0 +1,79 @@ +keyPrefix = $keyPrefix; + } + + /** + * Returns the object stored in the user´s PHP session + * @param string $key + * @return type the stored object + */ + public function get(string $key) { + $sessionData = $GLOBALS['TSFE']->fe_user->getKey('ses', $this->keyPrefix . $key); + return unserialize($sessionData); + } + + /** + * Writes an object into the PHP session + * + * @param type $object any serializable object to store into the session + * @param string $key identifier from the store in the session + * @return FeuserSessionService + */ + public function set($object, string $key): FeuserSessionService { + $sessionData = serialize($object); + $GLOBALS['TSFE']->fe_user->setKey('ses', $this->keyPrefix . $key, $sessionData); + $GLOBALS['TSFE']->fe_user->storeSessionData(); + return $this; + } + + /** + * Cleans up the session: removes the stored object from the PHP session + * + * @param type $key identifier from the store in the session to clean + * @return FeuserSessionService + */ + public function clean($key): FeuserSessionService { + $GLOBALS['TSFE']->fe_user->setKey('ses', $this->keyPrefix . $key, NULL); + $GLOBALS['TSFE']->fe_user->storeSessionData(); + return $this; + } + + /** + * set a prefix for your session store keys + * + * @param string $prefixKey + * @return void + */ + public function setKeyPrefix(string $keyPrefix = ''): void { + $this->keyPrefix = $keyPrefix; + } + +} diff --git a/Classes/User/FilterValuesMatcher.php b/Classes/User/FilterValuesMatcher.php new file mode 100755 index 0000000..fde0c41 --- /dev/null +++ b/Classes/User/FilterValuesMatcher.php @@ -0,0 +1,127 @@ +conRegistration = $conPool->getConnectionForTable('tx_a2gproducts_domain_model_filtervalues'); + } + + /** + * @param type $parameters + * @param type $parentObject + * @return bool + */ + public function showOptionsSelect(&$parameters, $parentObject): bool { + try { + $sql = 'SELECT count(foT.uid) as count ' + . 'FROM tx_a2gproducts_domain_model_filteroptions AS foT ' + . 'JOIN tx_a2gproducts_domain_model_filters AS fT ON fT.uid = foT.filters ' + . 'WHERE fT.uid = ? AND fT.filter_type=3 AND foT.hidden = 0 AND foT.deleted=0'; + $stmt = $this->conRegistration->prepare($sql); + $stmt->bindValue(1, (int) $parameters['record']['rel_filters'][0]); + $stmt->execute(); + $tmp = $stmt->fetchAll(); + if ($tmp[0] !== null) { + return (bool) $tmp[0]['count']; + } else { + return false; + } + } catch (\Exception $e) { + return false; + } + } + + /** + * + * @param type $parameters + * @param type $parentObject + * @return bool + */ + public function showValueInput(&$parameters, $parentObject): bool { + + try { + $sql = 'SELECT count(foT.uid) as count ' + . 'FROM tx_a2gproducts_domain_model_filteroptions AS foT ' + . 'JOIN tx_a2gproducts_domain_model_filters AS fT ON fT.uid = foT.filters ' + . 'WHERE fT.uid = ? AND fT.filter_type IN ( 1,2 ) AND foT.hidden = 0 AND foT.deleted=0 AND foT.sys_language_uid = 0'; + $stmt = $this->conRegistration->prepare($sql); + $stmt->bindValue(1, (int) $parameters['record']['rel_filters'][0]); + $stmt->execute(); + $tmp = $stmt->fetchAll(); + if ($tmp[0] !== null) { + return (bool) $tmp[0]['count']; + } else { + return false; + } + } catch (\Exception $e) { + return false; + } + } + + /** + * + * @param type $parameters + * @param type $parentObject + * @return void + */ + public function title(&$parameters, $parentObject):void { + try { + if(array_key_exists('rel_filters', $parameters['row']){ + if(array_key_exists(0,$parameters['row']['rel_filters'])){ + $sql2 = 'SELECT fT.title AS title ' + . 'FROM tx_a2gproducts_domain_model_filters AS fT ' + . ' WHERE fT.uid = ? AND fT.deleted = 0 AND fT.hidden = 0'; + $stmt2 = $this->conRegistration->prepare($sql2); + $stmt2->bindValue(1, (int) $parameters['row']['rel_filters'][0]); + $stmt2->execute(); + $tmp2 = $stmt2->fetchAll(); + if (array_key_exists(0, $tmp2)) { + $out = $tmp2[0]['title']; + } else { + $out = ''; + } + $sql = 'SELECT fT.title AS title ' + . 'FROM tx_a2gproducts_domain_model_filteroptions AS fT ' + . ' WHERE fT.uid = ? AND fT.deleted = 0 AND fT.hidden = 0'; + $stmt = $this->conRegistration->prepare($sql); + $stmt->bindValue(1, (int) $parameters['row']['rel_filter_option'][0]); + $stmt->execute(); + $tmp = $stmt->fetchAll(); + if (array_key_exists(0, $tmp)) { + $out .= ': ' . $tmp[0]['title']; + } else { + $out .= ': ' . $parameters['row']['value']; + } + $parameters['title'] .= $out; + } + } + } catch (\Exception $e) { + + } + } + +} diff --git a/Classes/User/Tca.php b/Classes/User/Tca.php new file mode 100755 index 0000000..0cae3dc --- /dev/null +++ b/Classes/User/Tca.php @@ -0,0 +1,21 @@ +getQueryParams() ?? []; + if (!isset($queryParams['tx_a2gproducts_a2gproductsdetail']['product'])) { + return ''; + } + $value = $queryParams['tx_a2gproducts_a2gproductsdetail']['product']; + $record = BackendUtility::getRecord('tx_a2gproducts_domain_model_products', $value); + return $record['title']; + } + /** + * @param string + * @param array + * @return string + */ + public function ingredientBreadrumb(string $content, array $conf): string + { + $queryParams = $GLOBALS['TYPO3_REQUEST']->getQueryParams() ?? []; + if (!isset($queryParams['tx_a2gproducts_ingredientsdetail']['ingredient'])) { + return ''; + } + $value = $queryParams['tx_a2gproducts_ingredientsdetail']['ingredient']; + $record = BackendUtility::getRecord('tx_a2gproducts_domain_model_ingredients', $value); + return $record['title']; + } +} \ No newline at end of file diff --git a/Classes/Utility/CanonicalUtility.php b/Classes/Utility/CanonicalUtility.php new file mode 100755 index 0000000..030330d --- /dev/null +++ b/Classes/Utility/CanonicalUtility.php @@ -0,0 +1,68 @@ + 11.x + $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); + $main = GeneralUtility::_GET(self::$plugin); + if ($main[self::$uidParamName]) { + $uriBuilder = $this->objectManager->get(UriBuilder::class); + $uriBuilder->setCreateAbsoluteUri(true); + $uriBuilder->setArguments([self::$plugin => [self::$uidParamName => $main[self::$uidParamName]]]); + $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class); + $settings = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT); + if (isset($settings['plugin.'][self::$plugin.'.']['settings.']['canonical']) && $settings['plugin.'][self::$plugin.'.']['settings.']['canonical'] !== 0) { + $uriBuilder->setTargetPageUid($settings['plugin.'][self::$plugin.'.']['settings.']['canonical']); + $href = $uriBuilder->build(); + } + } + */ + } +} diff --git a/Classes/ViewHelpers/FilterActiveViewHelper.php b/Classes/ViewHelpers/FilterActiveViewHelper.php new file mode 100755 index 0000000..4239ad1 --- /dev/null +++ b/Classes/ViewHelpers/FilterActiveViewHelper.php @@ -0,0 +1,58 @@ +registerArgument('filter', 'array', 'The cart array', true); + $this->registerArgument('filterUid', 'int', 'The Filter Uid', true); + $this->registerArgument('optionUid', 'int', 'The Filter Option Uid', true); + } + + /** + * @param array $arguments + * @param \Closure $renderChildrenClosure + * @param RenderingContextInterface $renderingContext + * @return mixed + */ + public static function renderStatic( + array $arguments, + \Closure $renderChildrenClosure, + RenderingContextInterface $renderingContext + ) { + if (isset($arguments['filter'][$arguments['filterUid']][$arguments['optionUid']])) { + return 'checked'; + } + return ''; + } + +} diff --git a/Configuration/.htaccess b/Configuration/.htaccess new file mode 100755 index 0000000..896fbc5 --- /dev/null +++ b/Configuration/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all \ No newline at end of file diff --git a/Configuration/Extbase/Persistence/Classes.php b/Configuration/Extbase/Persistence/Classes.php new file mode 100755 index 0000000..ffa85c6 --- /dev/null +++ b/Configuration/Extbase/Persistence/Classes.php @@ -0,0 +1,20 @@ + [ + 'tableName' => 'tx_a2gtoolkit_masonry_item', + 'properties' => [ + 'title' => [ + 'fieldName' => 'title', + ], + 'itemClass' => [ + 'fieldName' => 'item_class', + ], + 'image' => [ + 'fieldName' => 'image', + ], + ], + ] +]; \ No newline at end of file diff --git a/Configuration/FlexForms/flexform_detail.xml b/Configuration/FlexForms/flexform_detail.xml new file mode 100755 index 0000000..f55b7dc --- /dev/null +++ b/Configuration/FlexForms/flexform_detail.xml @@ -0,0 +1,104 @@ + + + + + + Function + + array + + + + + group + db + pages + 1 + 1 + 1 + 1 + + + + + + input + 50 + trim + 0 + + + + + + select + selectMultipleSideBySide + + + tx_a2gproducts_domain_model_categories + + AND (tx_a2gproducts_domain_model_categories.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_a2gproducts_domain_model_categories.sys_language_uid= '-1') + + 99 + 0 + 10 + + + + + + group + db + pages + 1 + 1 + 0 + 1 + + + + + + select + selectSingle + + + Default + Default + + + StyleOne + StyleOne + + + + + + + + select + selectMultipleSideBySide + + + tx_a2gproducts_domain_model_categories + + AND (tx_a2gproducts_domain_model_categories.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_a2gproducts_domain_model_categories.sys_language_uid= '-1') + + 99 + 0 + 10 + + + + + + input + 80 + trim + + + + + + + \ No newline at end of file diff --git a/Configuration/FlexForms/flexform_ingredients_detail.xml b/Configuration/FlexForms/flexform_ingredients_detail.xml new file mode 100755 index 0000000..d55b59d --- /dev/null +++ b/Configuration/FlexForms/flexform_ingredients_detail.xml @@ -0,0 +1,64 @@ + + + + + + Function + + array + + + + + group + db + pages + 1 + 1 + 0 + 1 + + + + + + input + 50 + trim + 0 + + + + + + group + db + pages + 1 + 1 + 0 + 1 + + + + + + select + selectSingle + + + A2gProducts + A2gProducts + + + A2gShop + A2gShop + + + + + + + + + \ No newline at end of file diff --git a/Configuration/FlexForms/flexform_ingredients_list.xml b/Configuration/FlexForms/flexform_ingredients_list.xml new file mode 100755 index 0000000..9af846a --- /dev/null +++ b/Configuration/FlexForms/flexform_ingredients_list.xml @@ -0,0 +1,34 @@ + + + + + + Function + + array + + + + + group + db + pages + 1 + 1 + 1 + + + + + + input + 20 + 30 + int,trim + + + + + + + \ No newline at end of file diff --git a/Configuration/FlexForms/flexform_list.xml b/Configuration/FlexForms/flexform_list.xml new file mode 100755 index 0000000..fbfce3c --- /dev/null +++ b/Configuration/FlexForms/flexform_list.xml @@ -0,0 +1,104 @@ + + + + + + Function + + array + + + + + group + db + pages + 1 + 1 + 0 + 1 + + + + + + select + selectSingle + + + A2gProducts + A2gProducts + + + A2gShop + A2gShop + + + + + + + + select + selectMultipleSideBySide + + + tx_a2gproducts_domain_model_categories + + AND (tx_a2gproducts_domain_model_categories.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_a2gproducts_domain_model_categories.sys_language_uid= '-1') + + 99 + 0 + 10 + + + + + + input + 20 + 30 + int,trim + + + + + + select + selectSingle + + + Product + Product + + + + + + + + select + selectSingle + + + Default + Default + + + StyleOne + StyleOne + + + + + + + + check + + + + + + + \ No newline at end of file diff --git a/Configuration/Services.yml b/Configuration/Services.yml new file mode 100755 index 0000000..911c704 --- /dev/null +++ b/Configuration/Services.yml @@ -0,0 +1,21 @@ +services: + _defaults: + autowire: true + autoconfigure: true + public: false + + a2gproducts.cache: + class: TYPO3\CMS\Core\Cache\Frontend\PhpFrontend + # We can not use CacheManager, as it can not be + # injected/instantiated during ext_localconf.php loading + # factory: ['@TYPO3\CMS\Core\Cache\CacheManager', 'getCache'] + # therefore we use the static Bootstrap::createCache factory instead. + factory: ['TYPO3\CMS\Core\Core\Bootstrap', 'createCache'] + arguments: ['products'] + + A2G\A2gProducts\Hreflang\EventListener\ProductsHrefLang: + tags: + - name: event.listener + identifier: 'a2g-products/ProductsHrefLang' + after: 'typo3-seo/hreflangGenerator' + event: TYPO3\CMS\Frontend\Event\ModifyHrefLangTagsEvent \ No newline at end of file diff --git a/Configuration/TCA/Overrides/100_sys_template.php b/Configuration/TCA/Overrides/100_sys_template.php new file mode 100755 index 0000000..c8b45ea --- /dev/null +++ b/Configuration/TCA/Overrides/100_sys_template.php @@ -0,0 +1,30 @@ + 'flexform_list', + 'a2gproducts_a2gproductsdetail' => 'flexform_detail', + 'a2gproducts_ingredientslist' => 'flexform_ingredients_list', + 'a2gproducts_ingredientsdetail' => 'flexform_ingredients_detail' +]; + +foreach ($pluginSignatures as $pluginSignature => $flexform) { + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature]='pages,layout,select_key,recursive'; + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature]='pi_flexform'; + + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( + $pluginSignature, + 'FILE:EXT:a2g_products/Configuration/FlexForms/'.$flexform.'.xml' + ); +} + +/** + * typo3 12 + * +$pluginSignature = \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( + 'A2gMaps', + 'map', + 'Map' +); +$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] + = 'pi_flexform'; +ExtensionManagementUtility::addPiFlexFormValue( + $pluginSignature, + 'FILE:EXT:a2g_maps/Configuration/FlexForms/flexform_map.xml' +); +*/ \ No newline at end of file diff --git a/Configuration/TCA/Overrides/500_cropping.php b/Configuration/TCA/Overrides/500_cropping.php new file mode 100755 index 0000000..2ceb957 --- /dev/null +++ b/Configuration/TCA/Overrides/500_cropping.php @@ -0,0 +1,61 @@ + 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.default', + 'allowedAspectRatios' => [ + '16:10' => [ + 'title' => '16:10', + 'value' => 16 / 10 + ], + '16:9' => [ + 'title' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:ratio.16_9', + 'value' => 16 / 9 + ], + '4:3' => [ + 'title' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:ratio.4_3', + 'value' => 4 / 3 + ], + '1:1' => [ + 'title' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:ratio.1_1', + 'value' => 1.0 + ], + 'NaN' => [ + 'title' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:ratio.free', + 'value' => 0.0 + ], + ], + 'selectedRatio' => 'NaN', + 'cropArea' => [ + 'x' => 0.0, + 'y' => 0.0, + 'width' => 1.0, + 'height' => 1.0, + ] +]; +$largeCropSettings = $defaultCropSettings; +$largeCropSettings['title'] = 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.large'; +$mediumCropSettings = $defaultCropSettings; +$mediumCropSettings['title'] = 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.medium'; +$smallCropSettings = $defaultCropSettings; +$smallCropSettings['title'] = 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.small'; +$extrasmallCropSettings = $defaultCropSettings; +$extrasmallCropSettings['title'] = 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.extrasmall'; + +// Content Element Background Image +$GLOBALS['TCA']['tx_a2gproducts_domain_model_ingredients']['columns']['image']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['default'] = $defaultCropSettings; +$GLOBALS['TCA']['tx_a2gproducts_domain_model_ingredients']['columns']['images']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['default'] = $defaultCropSettings; + +$GLOBALS['TCA']['tx_a2gproducts_domain_model_products']['columns']['image']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['default'] = $defaultCropSettings; +$GLOBALS['TCA']['tx_a2gproducts_domain_model_products']['columns']['images']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['default'] = $defaultCropSettings; + +$GLOBALS['TCA']['tx_a2gproducts_domain_model_productvariants']['columns']['image']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['default'] = $defaultCropSettings; +$GLOBALS['TCA']['tx_a2gproducts_domain_model_productvariants']['columns']['images']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['default'] = $defaultCropSettings; + +//$GLOBALS['TCA']['tx_a2gproducts_domain_model_ingredients']['columns']['image']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['large'] = $largeCropSettings; +//$GLOBALS['TCA']['tx_a2gproducts_domain_model_ingredients']['columns']['image']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['medium'] = $mediumCropSettings; +//$GLOBALS['TCA']['tx_a2gproducts_domain_model_ingredients']['columns']['image']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['small'] = $smallCropSettings; +//$GLOBALS['TCA']['tx_a2gproducts_domain_model_ingredients']['columns']['image']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['extrasmall'] = $extrasmallCropSettings; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_brands.php b/Configuration/TCA/tx_a2gproducts_domain_model_brands.php new file mode 100755 index 0000000..28e6033 --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_brands.php @@ -0,0 +1,164 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_brands', + 'label' => 'title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'sortby' => 'sorting', + 'cruser_id' => 'cruser_id', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'thumbnail' => 'image', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'nr,title', + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/brand-image.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, path_segment, image, ' + . '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_brands', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_brands}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_brands}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038) + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim, required', + 'default' => '' + ], + ], + 'image' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:image', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_categories.php b/Configuration/TCA/tx_a2gproducts_domain_model_categories.php new file mode 100755 index 0000000..d04889e --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_categories.php @@ -0,0 +1,199 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_categories', + 'label' => 'title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'sortby' => 'sorting', + 'cruser_id' => 'cruser_id', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'title,description', + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/categories.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, rel_filters, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_categories', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_categories}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_categories}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038) + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim, required', + 'default' => '' + ], + ], + 'description' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:description', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'default' => '' + ], + ], + 'image' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:image', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'foreign_types' => [ + '0' => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ] + ], + 'foreign_match_fields' => [ + 'fieldname' => 'image', + 'tablenames' => 'tx_a2gproducts_domain_model_categories', + 'table_local' => 'sys_file', + ], + 'maxitems' => 1 + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + + ], + 'rel_filters' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_filters', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_a2gproducts_domain_model_filters', + 'foreign_table_where' => ' AND tx_a2gproducts_domain_model_filters.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1) ', + 'MM' => 'tx_a2gproducts_categories_filters_mm', + 'size' => 10, + 'autoSizeMax' => 30, + 'maxitems' => 9999, + 'multiple' => 0, + 'fieldControl' => [ + 'editPopup' => [ + 'disabled' => false, + ], + 'addRecord' => [ + 'disabled' => false, + ], + 'listModule' => [ + 'disabled' => true, + ], + ], + ], + + ], + + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_filteroptions.php b/Configuration/TCA/tx_a2gproducts_domain_model_filteroptions.php new file mode 100755 index 0000000..35d44de --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_filteroptions.php @@ -0,0 +1,102 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_filteroptions', + 'label' => 'title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'sortby' => 'sorting', + 'cruser_id' => 'cruser_id', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'hideTable' => false, + 'enablecolumns' => [ + 'disabled' => 'hidden' + ], + 'searchFields' => 'title', + 'hideTable' => true, + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/filter-option.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, value_min, value_max'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_filteroptions', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_filteroptions}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_filteroptions}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'default' => '' + ], + ], + 'value_min' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:value_min', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'double2' + ], + ], + 'value_max' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:value_max', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'double2' + ], + ], + 'filters' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_filters.php b/Configuration/TCA/tx_a2gproducts_domain_model_filters.php new file mode 100755 index 0000000..4a4eae7 --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_filters.php @@ -0,0 +1,180 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_filters', + 'label' => 'title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'sortby' => 'sorting', + 'cruser_id' => 'cruser_id', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'type' => 'rel_filter_option', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'title,filter_type', + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/filters.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, filter_type, db_operation_max, db_operation_min, rel_filter_option, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_filters', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_filters}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_filters}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038) + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'default' => '' + ], + ], + 'filter_type' => [ + 'exclude' => true, + 'onChange' => 'reload', + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:filter_type', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 3, + 'items' => [ +// [Filters::$dbType[1], 1], +// [Filters::$dbType[2], 2], + ['LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:filter_type.'.Filters::$dbType[3], 3] + ], + ], + ], + 'db_operation_max' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:db_operation_max', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'items' => [ + [Filters::$dbOperations[1], 1], + [Filters::$dbOperations[2], 2], + [Filters::$dbOperations[3], 3], + [Filters::$dbOperations[4], 4], + [Filters::$dbOperations[5], 5] + ], + ], + 'displayCond' => 'FIELD:filter_type:=:1', + ], + 'db_operation_min' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:db_operation_min', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'items' => [ + [Filters::$dbOperations[1], 1], + [Filters::$dbOperations[2], 2], + [Filters::$dbOperations[3], 3], + [Filters::$dbOperations[4], 4], + [Filters::$dbOperations[5], 5] + ], + ], + 'displayCond' => 'FIELD:filter_type:IN:1,2', + ], + 'rel_filter_option' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_filter_option', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gproducts_domain_model_filteroptions', + 'foreign_table_where' => 'AND tx_a2gproducts_domain_model_filters.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1)', + 'foreign_field' => 'filters', + 'maxitems' => 9999, + 'appearance' => [ + 'collapseAll' => 1, + 'expandSingle' => 1, + 'levelLinksPosition' => 'top', + 'showSynchronizationLink' => 1, + 'showPossibleLocalizationRecords' => 1, + 'showAllLocalizationLink' => 1 + ], + ], + + ], + + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_filtervalues.php b/Configuration/TCA/tx_a2gproducts_domain_model_filtervalues.php new file mode 100755 index 0000000..3eb83d0 --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_filtervalues.php @@ -0,0 +1,117 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_filtervalues', + 'label' => 'value', + 'label_userFunc' => 'A2G\\A2gProducts\\User\\FilterValuesMatcher->title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'type' => 'rel_filter_option', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'hideTable' => true, + 'enablecolumns' => [ + 'disabled' => 'hidden' + ], + 'searchFields' => '', + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/filter-option.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, value,rel_filter_option, rel_filters'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_filtervalues', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_filtervalues}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_filtervalues}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'value' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:value', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'double2' + ], + 'displayCond' => 'USER:A2G\\A2gProducts\\User\\FilterValuesMatcher->showValueInput', + ], + 'rel_filter_option' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_filter_option', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'tx_a2gproducts_domain_model_filteroptions', + 'foreign_table_where' => 'AND tx_a2gproducts_domain_model_filteroptions.filters = ###REC_FIELD_rel_filters### AND tx_a2gproducts_domain_model_filteroptions.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1)', + 'default' => 0, + 'minitems' => 0, + 'maxitems' => 1, + ], + 'displayCond' => 'USER:A2G\\A2gProducts\\User\\FilterValuesMatcher->showOptionsSelect', + ], + 'rel_filters' => [ + 'exclude' => true, + 'onChange' => 'reload', + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_filters', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'tx_a2gproducts_domain_model_filters', + 'foreign_table_where' => 'AND tx_a2gproducts_domain_model_filters.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1)', + 'default' => 0, + 'minitems' => 0, + 'maxitems' => 1, + ], + ], + 'products' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'productvariants' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_ingredients.php b/Configuration/TCA/tx_a2gproducts_domain_model_ingredients.php new file mode 100755 index 0000000..e75a66f --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_ingredients.php @@ -0,0 +1,308 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_ingredients', + 'label' => 'title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'sortby' => 'sorting', + 'cruser_id' => 'cruser_id', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'nr,title,description', + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/natural-ingredients.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_diffsource, hidden, title, path_segment, description,' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:images_tab, image, images, gallery,' + . '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038) + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'default' => '' + ], + ], + 'path_segment' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:slug', + 'config' => [ + 'type' => 'slug', + 'size' => 50, + 'generatorOptions' => [ + 'fields' => ['title'], + 'fieldSeparator' => '/', + 'prefixParentPageSlug' => true, + 'replacements' => [ + '/' => '', + ], + ], + 'fallbackCharacter' => '-', + 'eval' => 'uniqueInSite', + 'default' => '' + ], + ], + 'description' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:description', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim', + 'default' => '' + ] + ], + 'image' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:image', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'images' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:images', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'images', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'minitems' => 0, + 'maxitems' => 10, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'gallery' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_toolkit/Resources/Private/Language/Backend.xlf:masonry_item', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gtoolkit_masonry_item', + 'foreign_field' => 'a2g_ingredients', + 'appearance' => [ + 'useSortable' => true, + 'showSynchronizationLink' => true, + 'showAllLocalizationLink' => true, + 'showPossibleLocalizationRecords' => true, + 'expandSingle' => true, + 'enabledControls' => [ + 'localize' => true, + ] + ], + 'behaviour' => [ + 'mode' => 'select', + ] + ], + ], + 'rel_products' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_products', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_a2gproducts_domain_model_products', + 'foreign_table_where' => ' AND tx_a2gproducts_domain_model_products.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1) AND tx_a2gproducts_domain_model_products.pid=###CURRENT_PID### ', + 'MM' => 'tx_a2gproducts_products_ingredients_mm', + 'MM_opposite_field' => 'uid_foreign', + 'size' => 10, + 'autoSizeMax' => 30, + 'maxitems' => 20, + 'multiple' => 0, + 'fieldControl' => [ + 'editPopup' => [ + 'disabled' => false, + ], + 'addRecord' => [ + 'disabled' => false, + ], + 'listModule' => [ + 'disabled' => true, + ], + ], + ], + ], + 'rel_productvariants' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_productvariants', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_a2gproducts_domain_model_productvariants', + 'foreign_table_where' => ' AND tx_a2gproducts_domain_model_productvariants.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1) AND tx_a2gproducts_domain_model_productvariants.pid=###CURRENT_PID### ', + 'MM' => 'tx_a2gproducts_products_productvariants_mm', + 'MM_opposite_field' => 'uid_foreign', + 'size' => 10, + 'autoSizeMax' => 30, + 'maxitems' => 20, + 'multiple' => 0, + 'fieldControl' => [ + 'editPopup' => [ + 'disabled' => false, + ], + 'addRecord' => [ + 'disabled' => false, + ], + 'listModule' => [ + 'disabled' => true, + ], + ], + ], + ], + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_products.php b/Configuration/TCA/tx_a2gproducts_domain_model_products.php new file mode 100755 index 0000000..b9565cc --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_products.php @@ -0,0 +1,599 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_products', + 'label' => 'title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'sortby' => 'sorting', + 'cruser_id' => 'cruser_id', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'descriptionColumn' => 'description', + 'thumbnail' => 'image', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'nr,title,description', + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/package.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, nr, title, path_segment, rel_category, description, description_html, rel_brand,' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:images_tab, image, images,' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:ingredients_tab, rel_ingredients,' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:filters_tab, rel_filter_values, ' +// . '--div--;Product Attributes, rel_selectableattribute, ' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:product_variants_tab, rel_productvariants, ' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:seo_tab, seo_image1x1,seo_image4x3,seo_image16x9,' + . '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_products', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_products}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_products}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038) + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'nr' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:product_nr', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim, required', + 'default' => '' + ], + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim, required', + 'default' => '' + ], + ], + 'path_segment' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:slug', + 'config' => [ + 'type' => 'slug', + 'size' => 50, + 'generatorOptions' => [ + 'fields' => ['title'], + 'fieldSeparator' => '/', + 'prefixParentPageSlug' => true, + 'replacements' => [ + '/' => '', + ], + ], + 'fallbackCharacter' => '-', + 'eval' => 'uniqueInSite', + 'default' => '' + ], + ], + 'description' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:description', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim', + 'default' => '' + ] + ], + 'description_html' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:description_html', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim', + 'enableRichtext' => true, + 'default' => '' + ] + ], + 'image' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:image', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'images' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:images', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'images', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'minitems' => 0, + 'maxitems' => 10, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'gallery' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_toolkit/Resources/Private/Language/Backend.xlf:masonry_item', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gtoolkit_masonry_item', + 'foreign_field' => 'a2g_products', + 'appearance' => [ + 'useSortable' => true, + 'showSynchronizationLink' => true, + 'showAllLocalizationLink' => true, + 'showPossibleLocalizationRecords' => true, + 'expandSingle' => true, + 'enabledControls' => [ + 'localize' => true, + ] + ], + 'behaviour' => [ + 'mode' => 'select', + ] + ], + ], + 'seo_image1x1' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:seo_image1x1', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'foreign_match_fields' => [ + 'fieldname' => 'seo_image1x1', + 'tablenames' => 'tx_a2gproducts_domain_model_products', + 'table_local' => 'sys_file', + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'seo_image4x3' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:seo_image4x3', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'foreign_match_fields' => [ + 'fieldname' => 'seo_image4x3', + 'tablenames' => 'tx_a2gproducts_domain_model_products', + 'table_local' => 'sys_file', + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'seo_image16x9' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:seo_image16x9', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'foreign_match_fields' => [ + 'fieldname' => 'seo_image16x9', + 'tablenames' => 'tx_a2gproducts_domain_model_products', + 'table_local' => 'sys_file', + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'rel_category' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_category', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_a2gproducts_domain_model_categories', + 'foreign_table_where' => ' AND {#tx_a2gproducts_domain_model_categories}.{#sys_language_uid} IN (###REC_FIELD_sys_language_uid###,-1) AND {#tx_a2gproducts_domain_model_categories}.{#pid}=###CURRENT_PID### ', + 'MM' => 'tx_a2gproducts_products_categories_mm', + 'size' => 10, + 'autoSizeMax' => 30, + 'maxitems' => 20, + 'multiple' => false, + 'fieldControl' => [ + 'editPopup' => [ + 'disabled' => false, + ], + 'addRecord' => [ + 'disabled' => false, + ], + 'listModule' => [ + 'disabled' => true, + ], + ], + ], + ], + 'rel_filter_values' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_filter_values', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gproducts_domain_model_filtervalues', + 'foreign_field' => 'products', + 'foreign_table_where' => ' AND {#tx_a2gproducts_domain_model_filtervalues}.{#sys_language_uid} IN (###REC_FIELD_sys_language_uid###,-1) ', + 'maxitems' => 20, + 'appearance' => [ + 'collapseAll' => 0, + 'levelLinksPosition' => 'top', + 'showSynchronizationLink' => 1, + 'showPossibleLocalizationRecords' => 1, + 'showAllLocalizationLink' => 1 + ], + ], + ], + 'rel_selectableattribute' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_selectableattribute', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gproducts_domain_model_selectableattribute', + 'foreign_field' => 'products', + 'foreign_table_where' => ' AND {#tx_a2gproducts_domain_model_selectableattribute}.{#sys_language_uid} IN (###REC_FIELD_sys_language_uid###,-1) ', + 'maxitems' => 20, + 'appearance' => [ + 'collapseAll' => 0, + 'levelLinksPosition' => 'top', + 'showSynchronizationLink' => 1, + 'showPossibleLocalizationRecords' => 1, + 'showAllLocalizationLink' => 1 + ], + ], + ], + 'rel_ingredients' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_ingredients', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_a2gproducts_domain_model_ingredients', + 'foreign_table_where' => ' AND {#tx_a2gproducts_domain_model_ingredients}.{#sys_language_uid} IN (###REC_FIELD_sys_language_uid###,-1) AND {#tx_a2gproducts_domain_model_ingredients}.{#pid}=###CURRENT_PID### ', + 'MM' => 'tx_a2gproducts_products_ingredients_mm', + 'size' => 10, + 'autoSizeMax' => 30, + 'minitems' => 0, + 'maxitems' => 20, + 'multiple' => 1, + 'fieldControl' => [ + 'editPopup' => [ + 'disabled' => false, + ], + 'addRecord' => [ + 'disabled' => false, + ], + 'listModule' => [ + 'disabled' => true, + ], + ], + ], + ], + 'rel_productvariants' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_productvariants', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gproducts_domain_model_productvariants', + 'foreign_table_where' => ' AND tx_a2gproducts_domain_model_productvariants.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1) AND tx_a2gproducts_domain_model_productvariants.pid=###CURRENT_PID### ', + 'foreign_field' => 'product', + 'size' => 10, + 'autoSizeMax' => 30, + 'foreign_sortby' => 'sorting', + 'minitems' => 1, + 'maxitems' => 20, + 'appearance' => [ + 'collapseAll' => 1, + 'expandSingle' => 1, + ], + ], + ], + 'rel_brand' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_brand', + 'config' => [ + 'type' => 'group', + 'internal_type' => 'db', + 'allowed' => 'tx_a2gproducts_domain_model_brands', + 'maxitems' => 1, + 'minitems' => 0, + 'size' => 1, + 'default' => 0, + 'suggestOptions' => [ + 'default' => [ + 'additionalSearchFields' => 'title', + 'addWhere' => 'AND tx_a2gproducts_domain_model_brands.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1) AND tx_a2gproducts_domain_model_brands.pid=###CURRENT_PID###' + ] + ], + ], + ], + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_productvariants.php b/Configuration/TCA/tx_a2gproducts_domain_model_productvariants.php new file mode 100755 index 0000000..b67af83 --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_productvariants.php @@ -0,0 +1,665 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_productvariants', + 'label' => 'title', + 'label_userFunc' => \A2G\A2gProducts\User\Tca::class . '->productVariantTitle', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'sortby' => 'sorting', + 'cruser_id' => 'cruser_id', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'nr,title,description', + 'hideTable' => true, + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/fingerprint-outline-variant.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden,product, nr, title, path_segment, description, description_html,' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:images_tab, tab_icon, image, images,' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:ingredients_tab, rel_ingredients,' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:filters_tab, rel_category, rel_filter_values, ' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:selectabel_product_attribute_tab, rel_selectableattribute, ' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:seo_tab, seo_image1x1,seo_image4x3,seo_image16x9,' + . '--div--;LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:sizes_tab, rel_sizes,' + . '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_productvariants', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_productvariants}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_productvariants}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038) + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'nr' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:product_nr', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim, required', + 'default' => '' + ], + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'default' => '' + ], + ], + 'path_segment' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:slug', + 'config' => [ + 'type' => 'slug', + 'size' => 50, + 'generatorOptions' => [ + 'fields' => ['title'], + 'fieldSeparator' => '/', + 'prefixParentPageSlug' => true, + 'replacements' => [ + '/' => '', + ], + ], + 'fallbackCharacter' => '-', + 'default' => '' + ], + ], + 'description' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:description', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim', + 'default' => '' + ] + ], + 'description_html' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:description_html', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim', + 'enableRichtext' => true, + 'default' => '' + ] + ], + 'tab_icon' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tab_icon', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'tab_icon', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'maxitems' => 1 + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'image' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:image', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'maxitems' => 1 + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'images' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:images', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'images', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'maxitems' => 10 + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'gallery' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:gallery', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'images', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'foreign_types' => [ + '0' => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ] + ], + 'foreign_match_fields' => [ + 'fieldname' => 'gallery', + 'tablenames' => 'tx_a2gproducts_domain_model_productvariants', + 'table_local' => 'sys_file', + ], + 'maxitems' => 20 + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'seo_image1x1' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:seo_image1x1', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'foreign_match_fields' => [ + 'fieldname' => 'seo_image1x1', + 'tablenames' => 'tx_a2gproducts_domain_model_products', + 'table_local' => 'sys_file', + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'seo_image4x3' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:seo_image4x3', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'foreign_match_fields' => [ + 'fieldname' => 'seo_image4x3', + 'tablenames' => 'tx_a2gproducts_domain_model_products', + 'table_local' => 'sys_file', + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'seo_image16x9' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:seo_image16x9', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'image', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + title, + description, + alternative, + crop, + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [ + 'showitem' => ' + --palette--;;filePalette + ' + ], + ], + ], + 'foreign_match_fields' => [ + 'fieldname' => 'seo_image16x9', + 'tablenames' => 'tx_a2gproducts_domain_model_products', + 'table_local' => 'sys_file', + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], + 'rel_category' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_category', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_a2gproducts_domain_model_categories', + 'foreign_table_where' => ' AND {#tx_a2gproducts_domain_model_categories}.{#sys_language_uid} IN (###REC_FIELD_sys_language_uid###,-1) AND {#tx_a2gproducts_domain_model_categories}.{#pid}=###CURRENT_PID### ', + 'MM' => 'tx_a2gproducts_productvariants_categories_mm', + 'size' => 10, + 'autoSizeMax' => 30, + 'maxitems' => 20, + 'multiple' => 1, + 'fieldControl' => [ + 'editPopup' => [ + 'disabled' => false, + ], + 'addRecord' => [ + 'disabled' => false, + ], + 'listModule' => [ + 'disabled' => true, + ], + ], + ], + ], + 'rel_filter_values' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_filter_values', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gproducts_domain_model_filtervalues', + 'foreign_field' => 'productvariants', + 'foreign_table_where' => ' AND {#tx_a2gproducts_domain_model_filtervalues}.{#sys_language_uid} IN (###REC_FIELD_sys_language_uid###,-1) ', + 'maxitems' => 20, + 'appearance' => [ + 'collapseAll' => 0, + 'levelLinksPosition' => 'top', + 'showSynchronizationLink' => 1, + 'showPossibleLocalizationRecords' => 1, + 'showAllLocalizationLink' => 1 + ], + ], + ], + 'rel_selectableattribute' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_selectableattribute', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gproducts_domain_model_selectableattribute', + 'foreign_field' => 'productvariants', + 'foreign_table_where' => ' AND {#tx_a2gproducts_domain_model_selectableattribute}.{#sys_language_uid} IN (###REC_FIELD_sys_language_uid###,-1) ', + 'maxitems' => 20, + 'appearance' => [ + 'collapseAll' => 0, + 'levelLinksPosition' => 'top', + 'showSynchronizationLink' => 1, + 'showPossibleLocalizationRecords' => 1, + 'showAllLocalizationLink' => 1 + ], + ], + ], + 'rel_ingredients' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_ingredients', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'tx_a2gproducts_domain_model_ingredients', + 'foreign_table_where' => ' AND {#tx_a2gproducts_domain_model_ingredients}.{#sys_language_uid} IN (###REC_FIELD_sys_language_uid###,-1) AND {#tx_a2gproducts_domain_model_ingredients}.{#pid}=###CURRENT_PID### ', + 'MM' => 'tx_a2gproducts_ingredients_productvariants_mm', + 'size' => 10, + 'autoSizeMax' => 30, + 'minitems' => 0, + 'maxitems' => 20, + 'multiple' => 1, + 'fieldControl' => [ + 'editPopup' => [ + 'disabled' => false, + ], + 'addRecord' => [ + 'disabled' => false, + ], + 'listModule' => [ + 'disabled' => true, + ], + ], + ], + ], + 'product' => [ + 'config' => array( + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'tx_a2gproducts_domain_model_products', + ), + ], + 'rel_sizes' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_sizes', + 'config' => [ + 'type' => 'inline', + 'foreign_table' => 'tx_a2gproducts_domain_model_productvariantsizes', + 'foreign_table_where' => ' AND tx_a2gproducts_domain_model_productvariantsizes.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1) AND tx_a2gproducts_domain_model_productvariantsizes.pid=###CURRENT_PID### ', + 'foreign_field' => 'productvariant', + 'size' => 10, + 'autoSizeMax' => 30, + 'foreign_sortby' => 'sorting', + 'minitems' => 0, + 'maxitems' => 30, + 'appearance' => [ + 'collapseAll' => 1, + 'expandSingle' => 1, + ], + ], + ], + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_productvariantsizes.php b/Configuration/TCA/tx_a2gproducts_domain_model_productvariantsizes.php new file mode 100755 index 0000000..9776ffa --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_productvariantsizes.php @@ -0,0 +1,158 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_productvariantsizes', + 'label' => 'title', +// 'label_userFunc' => \A2G\A2gProducts\User\Tca::class . '->productVariantTitle', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'sortby' => 'sorting', + 'cruser_id' => 'cruser_id', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'delete' => 'deleted', + 'enablecolumns' => [ + 'disabled' => 'hidden', + 'starttime' => 'starttime', + 'endtime' => 'endtime', + ], + 'searchFields' => 'nr,title,description', + 'hideTable' => true, + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/fingerprint-outline-variant.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, nr, title, path_segment, description,' + . '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_productvariantsizes', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_productvariantsizes}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_productvariantsizes}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'starttime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'endtime' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', + 'config' => [ + 'type' => 'input', + 'renderType' => 'inputDateTime', + 'eval' => 'datetime,int', + 'default' => 0, + 'range' => [ + 'upper' => mktime(0, 0, 0, 1, 1, 2038) + ], + 'behaviour' => [ + 'allowLanguageSynchronization' => true + ] + ], + ], + 'nr' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:product_nr', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim, required', + 'default' => '' + ], + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'default' => '' + ], + ], + 'path_segment' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:slug', + 'config' => [ + 'type' => 'slug', + 'size' => 50, + 'generatorOptions' => [ + 'fields' => ['title'], + 'fieldSeparator' => '/', + 'prefixParentPageSlug' => true, + 'replacements' => [ + '/' => '', + ], + ], + 'fallbackCharacter' => '-', + 'default' => '' + ], + ], + 'description' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:description', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim', + 'default' => '' + ] + ], + 'productvariant' => [ + 'config' => array( + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'tx_a2gproducts_domain_model_productvariants', + ), + ], + ], +]; diff --git a/Configuration/TCA/tx_a2gproducts_domain_model_selectableattribute.php b/Configuration/TCA/tx_a2gproducts_domain_model_selectableattribute.php new file mode 100755 index 0000000..400ce7b --- /dev/null +++ b/Configuration/TCA/tx_a2gproducts_domain_model_selectableattribute.php @@ -0,0 +1,116 @@ + [ + 'title' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2gproducts_domain_model_selectableattribute', + 'label' => 'title', + 'label_userFunc' => 'A2G\\A2gProducts\\User\\FilterValuesMatcher->title', + 'tstamp' => 'tstamp', + 'crdate' => 'crdate', + 'cruser_id' => 'cruser_id', + 'type' => 'rel_filter_option', + 'versioningWS' => true, + 'languageField' => 'sys_language_uid', + 'transOrigPointerField' => 'l10n_parent', + 'transOrigDiffSourceField' => 'l10n_diffsource', + 'hideTable' => true, + 'enablecolumns' => [ + 'disabled' => 'hidden' + ], + 'searchFields' => '', + 'iconfile' => 'EXT:a2g_products/Resources/Public/Icons/tag.png' + ], + 'types' => [ + '1' => ['showitem' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title,rel_filter_option, rel_filters'], + ], + 'columns' => [ + 'sys_language_uid' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', + 'config' => [ + 'type' => 'language' + ], + ], + 'l10n_parent' => [ + 'displayCond' => 'FIELD:sys_language_uid:>:0', + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'default' => 0, + 'items' => [ + ['', 0], + ], + 'foreign_table' => 'tx_a2gproducts_domain_model_selectableattribute', + 'foreign_table_where' => 'AND {#tx_a2gproducts_domain_model_selectableattribute}.{#pid}=###CURRENT_PID### AND {#tx_a2gproducts_domain_model_selectableattribute}.{#sys_language_uid} IN (-1,0)', + ], + ], + 'l10n_diffsource' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'hidden' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', + 'config' => [ + 'type' => 'check', + 'renderType' => 'checkboxToggle', + 'items' => [ + [ + 0 => '', + 1 => '', + 'invertStateDisplay' => true + ] + ], + ], + ], + 'title' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:title', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim' + ] + ], + 'rel_filter_option' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_filter_option', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'tx_a2gproducts_domain_model_filteroptions', + 'foreign_table_where' => 'AND tx_a2gproducts_domain_model_filteroptions.filters = ###REC_FIELD_rel_filters### AND tx_a2gproducts_domain_model_filteroptions.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1)', + 'default' => 0, + 'minitems' => 0, + 'maxitems' => 1, + ], + 'displayCond' => 'USER:A2G\\A2gProducts\\User\\FilterValuesMatcher->showOptionsSelect', + ], + 'rel_filters' => [ + 'exclude' => true, + 'onChange' => 'reload', + 'label' => 'LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:rel_filters', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'tx_a2gproducts_domain_model_filters', + 'foreign_table_where' => 'AND tx_a2gproducts_domain_model_filters.filter_type = 3 AND tx_a2gproducts_domain_model_filters.sys_language_uid IN (###REC_FIELD_sys_language_uid###,-1)', + 'default' => 0, + 'minitems' => 0, + 'maxitems' => 1, + ], + ], + 'products' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + 'productvariants' => [ + 'config' => [ + 'type' => 'passthrough', + ], + ], + ], +]; diff --git a/Configuration/TsConfig/Page/All.tsconfig b/Configuration/TsConfig/Page/All.tsconfig new file mode 100755 index 0000000..ab2fac8 --- /dev/null +++ b/Configuration/TsConfig/Page/All.tsconfig @@ -0,0 +1,4 @@ +################## +#### TsConfig #### +################## + diff --git a/Configuration/TsConfig/Page/Wizards.tsconfig b/Configuration/TsConfig/Page/Wizards.tsconfig new file mode 100755 index 0000000..d956912 --- /dev/null +++ b/Configuration/TsConfig/Page/Wizards.tsconfig @@ -0,0 +1,46 @@ +################################ +#### CONTENT ELEMENT WIZARD #### +################################ +mod.wizards.newContentElement.wizardItems.a2gProducts { + after = common, menu, special, forms, plugins + header = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:wizard.group.products + elements { + a2gproductslist { + iconIdentifier = a2g_products-plugin-a2gproductslist + title = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_a2gproductslist.name + description = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_a2gproductslist.description + tt_content_defValues { + CType = list + list_type = a2gproducts_a2gproductslist + } + } + a2gproductsdetail { + iconIdentifier = a2g_products-plugin-a2gproductsdetail + title = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_a2gproductsdetail.name + description = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_a2gproductsdetail.description + tt_content_defValues { + CType = list + list_type = a2gproducts_a2gproductsdetail + } + } + ingredientslist { + iconIdentifier = a2g_products-plugin-ingredientslist + title = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_ingredientslist.name + description = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_ingredientslist.description + tt_content_defValues { + CType = list + list_type = a2gproducts_ingredientslist + } + } + ingredientsdetail { + iconIdentifier = a2g_products-plugin-ingredientsdetail + title = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_ingredientsdetail.name + description = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_ingredientsdetail.description + tt_content_defValues { + CType = list + list_type = a2gproducts_ingredientsdetail + } + } + } + show = * +} diff --git a/Configuration/TypoScript/Base/constants.typoscript b/Configuration/TypoScript/Base/constants.typoscript new file mode 100755 index 0000000..21498be --- /dev/null +++ b/Configuration/TypoScript/Base/constants.typoscript @@ -0,0 +1,14 @@ +plugin.tx_a2gproducts_a2gproducts { + view { + # cat=altogether products/file; type=string; label=Path to template root (FE) + templateRootPath = EXT:a2g_products/Resources/Private/Templates/ + # cat=altogether products/file; type=string; label=Path to template partials (FE) + partialRootPath = EXT:a2g_products/Resources/Private/Partials/ + # cat=altogether products/file; type=string; label=Path to template layouts (FE) + layoutRootPath = EXT:a2g_products/Resources/Private/Layouts/ + } + persistence { + # cat=altogether products//a; type=string; label=Default storage PID + storagePid = + } +} \ No newline at end of file diff --git a/Configuration/TypoScript/Base/setup.typoscript b/Configuration/TypoScript/Base/setup.typoscript new file mode 100755 index 0000000..d0452b7 --- /dev/null +++ b/Configuration/TypoScript/Base/setup.typoscript @@ -0,0 +1,115 @@ +plugin.tx_a2gproducts_a2gproductslist { + view { + templateRootPaths.0 = EXT:a2g_products/Resources/Private/Templates/ + templateRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.templateRootPath} + partialRootPaths.0 = EXT:a2g_products/Resources/Private/Partials/ + partialRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.partialRootPath} + layoutRootPaths.0 = EXT:a2g_products/Resources/Private/Layouts/ + layoutRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.layoutRootPath} + } + persistence { + storagePid = {$plugin.tx_a2gproducts_a2gproductslist.persistence.storagePid} + #recursive = 1 + } +} +plugin.tx_a2gproducts_a2gproductsdetail { + view { + templateRootPaths.0 = EXT:a2g_products/Resources/Private/Templates/ + templateRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.templateRootPath} + partialRootPaths.0 = EXT:a2g_products/Resources/Private/Partials/ + partialRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.partialRootPath} + layoutRootPaths.0 = EXT:a2g_products/Resources/Private/Layouts/ + layoutRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.layoutRootPath} + } + persistence { + storagePid = {$plugin.tx_a2gproducts_a2gproductsdetail.persistence.storagePid} + #recursive = 1 + } +} +plugin.tx_a2gproducts_ingredientslist { + view { + templateRootPaths.0 = EXT:a2g_products/Resources/Private/Templates/ + templateRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.templateRootPath} + partialRootPaths.0 = EXT:a2g_products/Resources/Private/Partials/ + partialRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.partialRootPath} + layoutRootPaths.0 = EXT:a2g_products/Resources/Private/Layouts/ + layoutRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.layoutRootPath} + } + persistence { + storagePid = {$plugin.tx_a2gproducts_a2gproducts.persistence.storagePid} + #recursive = 1 + } +} +plugin.tx_a2gproducts_ingredientsdetail { + view { + templateRootPaths.0 = EXT:a2g_products/Resources/Private/Templates/ + templateRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.templateRootPath} + partialRootPaths.0 = EXT:a2g_products/Resources/Private/Partials/ + partialRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.partialRootPath} + layoutRootPaths.0 = EXT:a2g_products/Resources/Private/Layouts/ + layoutRootPaths.1 = {$plugin.tx_a2gproducts_a2gproducts.view.layoutRootPath} + } + persistence { + storagePid = {$plugin.tx_a2gproducts_a2gproducts.persistence.storagePid} + #recursive = 1 + } +} + +page.includeJSFooter.rslider = EXT:a2g_products/Resources/Public/JavaScript/rSlider.min.js +page.includeJSFooter.rslider { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.a2gProductsList = EXT:a2g_products/Resources/Public/JavaScript/a2gProductsList.js +page.includeJSFooter.a2gProductsList { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.a2gProductsSwiperInit = EXT:a2g_products/Resources/Public/JavaScript/a2gProductsSwiper.init.js +page.includeJSFooter.a2gProductsSwiperInit { + disableCompression = 0 + excludeFromConcatenation = 0 +} + +page.includeCSS { + rslider = EXT:a2g_products/Resources/Public/Scss/rSlider.min.scss + a2gProductsList = EXT:a2g_products/Resources/Public/Scss/a2gProductsList.scss +} + +a2gProductList = PAGE +a2gProductList { + typeNum = 1629140329 + config { + disableAllHeaderCode = 1 + admPanel = 0 + additionalHeaders.10.header = Content-type:text/html + xhtml_cleaning = 0 + debug = 0 + no_cache = 1 + } + 10 = USER + 10 { + userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run + extensionName = A2gProducts + pluginName = A2gproductslist + vendorName = Altogether + controller = Products + settings < plugin.tx_a2gproducts_a2gproductslist.settings + persistence < plugin.tx_a2gproducts_a2gproductslist.persistence + view < plugin.tx_a2gproducts_a2gproductslist.view + } +} + +config.pageTitleProviders { + product { + provider = A2G\A2gProducts\PageTitle\A2gPageTitleProvider + before = seo + } + seo { + provider = TYPO3\CMS\Seo\PageTitle\SeoTitlePageTitleProvider + before = record + } +} + + + \ No newline at end of file diff --git a/Configuration/TypoScript/Breadcrumb/setup.typoscript b/Configuration/TypoScript/Breadcrumb/setup.typoscript new file mode 100755 index 0000000..22f9c83 --- /dev/null +++ b/Configuration/TypoScript/Breadcrumb/setup.typoscript @@ -0,0 +1,41 @@ +[traverse(request.getQueryParams(), 'tx_a2gproducts_a2gproductsdetail/product') > 0] +page { + 10 { + variables { + breadcrumbExtendedValue = COA + breadcrumbExtendedValue { + 10 = USER + 10 { + userFunc = A2G\A2gProducts\User\TypoScript->productBreadrumb + } + } + } + dataProcessing { + 30 { + special.range = 0|-2 + } + } + } +} +[end] + +[traverse(request.getQueryParams(), 'tx_a2gproducts_ingredientsdetail/ingredient') > 0] +page { + 10 { + variables { + breadcrumbExtendedValue = COA + breadcrumbExtendedValue { + 10 = USER + 10 { + userFunc = A2G\A2gProducts\User\TypoScript->ingredientBreadrumb + } + } + } + dataProcessing { + 30 { + special.range = 0|-2 + } + } + } +} +[end] diff --git a/Configuration/TypoScript/Canonical/setup.typoscript b/Configuration/TypoScript/Canonical/setup.typoscript new file mode 100755 index 0000000..0865232 --- /dev/null +++ b/Configuration/TypoScript/Canonical/setup.typoscript @@ -0,0 +1,48 @@ +[traverse(request.getQueryParams(), 'tx_a2gproducts_a2gproductsdetail/product') > 0] + page.headerData.20 = TEXT + page.headerData.20 { + typolink { + # hol die aktuelle Page Id + parameter.data = page:uid + # prüfe ob die Id wirklich eine Zahl ist + parameter.intval = 1 + useCacheHash = 1 + # füge zur URL alle Parameter hinzu + additionalParams.cObject = COA + additionalParams.cObject { + 10 = TEXT + 10.dataWrap = &tx_a2gproducts_a2gproductsdetail[product]={GP:tx_a2gproducts_a2gproductsdetail|product} + 10.if.isTrue.data = GP:tx_a2gproducts_a2gproductsdetail|product + } + forceAbsoluteUrl = 1 + returnLast = url + } + # bau mir den Meta-Tag zusammen + wrap = + } +[global] + + +[traverse(request.getQueryParams(), 'tx_a2gproducts_ingredientsdetail/ingredient') > 0] + page.headerData.20 = TEXT + page.headerData.20 { + typolink { + # hol die aktuelle Page Id + parameter.data = page:uid + # prüfe ob die Id wirklich eine Zahl ist + parameter.intval = 1 + useCacheHash = 1 + # füge zur URL alle Parameter hinzu + additionalParams.cObject = COA + additionalParams.cObject { + 10 = TEXT + 10.dataWrap = &tx_a2gproducts_ingredientsdetail[ingredient]={GP:tx_a2gproducts_ingredientsdetail|ingredient} + 10.if.isTrue.data = GP:tx_a2gproducts_ingredientsdetail|ingredient + } + forceAbsoluteUrl = 1 + returnLast = url + } + # bau mir den Meta-Tag zusammen + wrap = + } +[global] diff --git a/Configuration/TypoScript/GoogleAnalytics/constants.typoscript b/Configuration/TypoScript/GoogleAnalytics/constants.typoscript new file mode 100755 index 0000000..e69de29 diff --git a/Configuration/TypoScript/GoogleAnalytics/setup.typoscript b/Configuration/TypoScript/GoogleAnalytics/setup.typoscript new file mode 100755 index 0000000..0391b7a --- /dev/null +++ b/Configuration/TypoScript/GoogleAnalytics/setup.typoscript @@ -0,0 +1,46 @@ +page.includeJSFooter.gaCheckout = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaCheckout.js +page.includeJSFooter.gaCheckout { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.gaProduct = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaProduct.js +page.includeJSFooter.gaProduct { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.gaProducts = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaProducts.js +page.includeJSFooter.gaProducts { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.gaPromotion = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotion.js +page.includeJSFooter.gaPromotion { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.gaPromotions = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotions.js +page.includeJSFooter.gaPromotions { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.gaPurchase = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPurchase.js +page.includeJSFooter.gaPurchase { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.gaRefund = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefund.js +page.includeJSFooter.gaRefund { + disableCompression = 0 + excludeFromConcatenation = 0 +} +page.includeJSFooter.gaRefunds = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefunds.js +page.includeJSFooter.gaRefunds { + disableCompression = 0 + excludeFromConcatenation = 0 +} + +page.includeJSFooter.gaEcommerce = EXT:a2g_products/Resources/Public/JavaScript/GoogleAnalytics/A2gGaEcommerce.js +page.includeJSFooter.gaEcommerce { + disableCompression = 1 + excludeFromConcatenation = 1 +} diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript new file mode 100755 index 0000000..09ab258 --- /dev/null +++ b/Configuration/TypoScript/constants.typoscript @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript new file mode 100755 index 0000000..87a6b79 --- /dev/null +++ b/Configuration/TypoScript/setup.typoscript @@ -0,0 +1,3 @@ + + + diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..2071b23 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100755 index 0000000..0f24995 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# a2g_products + diff --git a/Resources/Private/.htaccess b/Resources/Private/.htaccess new file mode 100755 index 0000000..96d0729 --- /dev/null +++ b/Resources/Private/.htaccess @@ -0,0 +1,11 @@ +# Apache < 2.3 + + Order allow,deny + Deny from all + Satisfy All + + +# Apache >= 2.3 + + Require all denied + diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf new file mode 100755 index 0000000..be6ff3a --- /dev/null +++ b/Resources/Private/Language/de.locallang.xlf @@ -0,0 +1,36 @@ + + + +
+ + + detail + mehr erfahren + + + article nr + Artikel Nr + + + search + suchen + + + advanced search + erweiterte Suche + + + search + suche + + + related products + Produkte mit dieser Zutat + + + used ingredients + Verwendete Zutaten + + + + diff --git a/Resources/Private/Language/de.locallang_csh_tx_a2gproducts_domain_model_products.xlf b/Resources/Private/Language/de.locallang_csh_tx_a2gproducts_domain_model_products.xlf new file mode 100755 index 0000000..8e06c7b --- /dev/null +++ b/Resources/Private/Language/de.locallang_csh_tx_a2gproducts_domain_model_products.xlf @@ -0,0 +1,63 @@ + + + +
+ + + product nr + Produkt Nr + + + product title <br/> +for Search Engin Optimation ( SEO ) and link preview ( <a href="https://ogp.me/">open graph</a> ) + Produkt Titel / Name <br/> +für Suchmaschinenoptimierung ( SEO ) und Link-Vorschau ( <a href="https://ogp.me/">open graph</a> ) + + + description <br/> +for Search Engin Optimation ( SEO ) and link preview ( <a href="https://ogp.me/">open graph</a> ) + Produkt Beschreibung <br/> +für Suchmaschinenoptimierung ( SEO ) und Link-Vorschau ( <a href="https://ogp.me/">open graph</a> ) + + + product list image <br/> +for Search Engin Optimation ( SEO ) and link preview ( <a href="https://ogp.me/">open graph</a> ) + Produkt Listen Bild <br/> +für Suchmaschinenoptimierung ( SEO ) und Link-Vorschau ( <a href="https://ogp.me/">open graph</a> ) + + + images + Produkt Detail Seiten Bild Slider + + + relCategory + Produkt Kategorie ( Verwendet für Filter ) + + + relFilterValues + Filterbare Optionen +von dem FIlter aus der Kategorie + + + url segment generated from the product title + URL Segment generiert aus dem Produk-Titel + + + farmateable description + Formatierbare Beschreibung unter der Beschreibung + + + ingredients + Verwendete Inhaltsstoffe, Bauteile oder Zutaten + + + + + + + deliverycosts conditions per each product + Liefergebühren abzüge zuschläge pro Produkt + + + + diff --git a/Resources/Private/Language/de.locallang_db.xlf b/Resources/Private/Language/de.locallang_db.xlf new file mode 100755 index 0000000..b85255a --- /dev/null +++ b/Resources/Private/Language/de.locallang_db.xlf @@ -0,0 +1,308 @@ + + + +
+ + + Brands + Marken / Kollektionen + + + Products + Produkte + + + Products + Produkte + + + Nr + + + + Title + Titel + + + Description + Beschreibung + + + Image + Bild + + + Images + Bilder + + + Net Price + Netto Preis + + + Gross Price + Brutto Preis + + + Category + Kategorie + + + Filter Values + Filter Werte + + + Categories + Kategorien + + + Title + Titel + + + Description + Beschreibung + + + Image + Bild + + + Filters + Filter + + + Filters + Filter + + + Title + Titel + + + Filter Type + Filter Typ + + + Db Operation Max + Db Operation Max + + + Db Operation Min + Db Operation Min + + + Filter Option + Filter Option + + + Filter Options + Filter Optionen + + + Title + Titel + + + Value Min + min. Wert + + + Value Max + max. Wert + + + Filter Values + Filter Werte + + + Value + Wert + + + Filters + Filter + + + Altogether Products - Product List + Altogether Produkte - Produktliste + + + + Liste der Produkte mit filter und such Möglichkeit. + + + Altogether Products - Product Detail + Altogether Produkte - Produkt Detail Seite + + + + Detailseite eines Produktes + + + Altogether Products - Ingredients List + Altogether Produkte - Liste der Inhaltsstoffe + + + + + + + Altogether Products - Ingredients Detail + Altogether Produkte - Inhaltsstoffe Detail Seite + + + + + + + Ingredients + Inhaltstoffe + + + title + Titel + + + description + Beschreibung + + + image + Bild + + + Filters + Filter + + + min value + min. Wert + + + max value + max. Wert + + + filter type + Filter Typ + + + operation min + min. Operant + + + operation max + max. Operant + + + filter option + Filter Optionen + + + value + Wert + + + images + Bilder + + + products + Produkte + + + product nr + Produkt Nr. + + + category + Kateogie + + + filter values + Filter Werte + + + ingredients + Inhaltsstoffe + + + used ingredients + verwendete Zutaten + + + products with this ingredient + Produkte mit dieser Zutat + + + just use Filter Options + Filteroptionen verwenden + + + slug + Url Segment + + + Images + Bilder + + + Varainats + Varianten + + + Filters + Filter + + + Ingredients + Inhaltsstoffe + + + Sizes + Größen + + + Product-Variants + Produkt Varianten + + + Description ( RTE ) + Beschreibung ( RTE ) + + + Product Options + Produkt Optionen + + + Selectable Produkt Options + Wählbare Produkt Optionen + + + Brand + Marke + + + Brands + Marken + + + SEO Image 1x1 + + + + SEO Image 4x3 + + + + SEO Image 16x9 + + + + SEO + + + + + \ No newline at end of file diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf new file mode 100755 index 0000000..6cf8b21 --- /dev/null +++ b/Resources/Private/Language/locallang.xlf @@ -0,0 +1,29 @@ + + + +
+ + + detail + + + article nr + + + search + + + advanced search + + + search + + + related products + + + used ingredients + + + + diff --git a/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_categories.xlf b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_categories.xlf new file mode 100755 index 0000000..b79f22c --- /dev/null +++ b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_categories.xlf @@ -0,0 +1,20 @@ + + + +
+ + + title + + + description + + + image + + + relFilters + + + + diff --git a/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filteroptions.xlf b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filteroptions.xlf new file mode 100755 index 0000000..cdb69df --- /dev/null +++ b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filteroptions.xlf @@ -0,0 +1,17 @@ + + + +
+ + + title + + + valueMin + + + valueMax + + + + diff --git a/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filters.xlf b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filters.xlf new file mode 100755 index 0000000..80ea8af --- /dev/null +++ b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filters.xlf @@ -0,0 +1,23 @@ + + + +
+ + + title + + + filterType + + + dbOperationMax + + + dbOperationMin + + + relFilterOption + + + + diff --git a/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filtervalues.xlf b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filtervalues.xlf new file mode 100755 index 0000000..ad010ad --- /dev/null +++ b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_filtervalues.xlf @@ -0,0 +1,14 @@ + + + +
+ + + value + + + relFilters + + + + diff --git a/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_products.xlf b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_products.xlf new file mode 100755 index 0000000..7de6d7d --- /dev/null +++ b/Resources/Private/Language/locallang_csh_tx_a2gproducts_domain_model_products.xlf @@ -0,0 +1,47 @@ + + + +
+ + + product nr + + + product title <br/> +for Search Engin Optimation ( SEO ) and link preview ( <a href="https://ogp.me/">open graph</a> ) + + + description <br/> +for Search Engin Optimation ( SEO ) and link preview ( <a href="https://ogp.me/">open graph</a> ) + + + product list image <br/> +for Search Engin Optimation ( SEO ) and link preview ( <a href="https://ogp.me/">open graph</a> ) + + + images + + + relCategory + + + relFilterValues + + + url segment generated from the product title + + + farmateable description + + + ingredients + + + + + + deliverycosts conditions per each product + + + + diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf new file mode 100755 index 0000000..efa1036 --- /dev/null +++ b/Resources/Private/Language/locallang_db.xlf @@ -0,0 +1,221 @@ + + + +
+ + + Brands + + + Products + + + Products + + + Nr + + + Title + + + Description + + + Image + + + Images + + + Net Price + + + Gross Price + + + Category + + + Filter Values + + + Categories + + + Title + + + Description + + + Image + + + Filters + + + Filters + + + Title + + + Filter Type + + + Db Operation Max + + + Db Operation Min + + + Filter Option + + + Filter Options + + + Title + + + Value Min + + + Value Max + + + Filter Values + + + Value + + + Filters + + + Altogether Products - Product List + + + + + + Altogether Products - Product Detail + + + + + + Altogether Products - Ingredients List + + + + + + Altogether Products - Ingredients Detail + + + + + + Ingredients + + + title + + + description + + + image + + + Filters + + + min value + + + max value + + + filter type + + + operation min + + + operation max + + + filter option + + + value + + + images + + + products + + + product nr + + + category + + + filter values + + + ingredients + + + used ingredients + + + products with this ingredient + + + just use Filter Options + + + slug + + + Images + + + SEO + + + Sizes + + + Varainats + + + Filters + + + Ingredients + + + Product-Variants + + + Description ( RTE ) + + + Product Options + + + Selectable Produkt Options + + + Tab Icon + + + + diff --git a/Resources/Private/Layouts/Ajax.html b/Resources/Private/Layouts/Ajax.html new file mode 100755 index 0000000..211755d --- /dev/null +++ b/Resources/Private/Layouts/Ajax.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html new file mode 100755 index 0000000..64e85e9 --- /dev/null +++ b/Resources/Private/Layouts/Default.html @@ -0,0 +1,5 @@ + +
+ +
+ diff --git a/Resources/Private/Partials/ContentElements/Masonry.html b/Resources/Private/Partials/ContentElements/Masonry.html new file mode 100755 index 0000000..07c41e9 --- /dev/null +++ b/Resources/Private/Partials/ContentElements/Masonry.html @@ -0,0 +1,54 @@ + + + +
+ + +
+
+ + + + + + + + + + + 300 + + + 350 + + + 650 + + + 970 + + + 1280 + + + {item.image.data.width} + + + a2g-{item.image.properties.alternative} + + + +
+
+
+
+ diff --git a/Resources/Private/Partials/Default/AjaxList.html b/Resources/Private/Partials/Default/AjaxList.html new file mode 100755 index 0000000..4061f5d --- /dev/null +++ b/Resources/Private/Partials/Default/AjaxList.html @@ -0,0 +1,2 @@ + + diff --git a/Resources/Private/Partials/Default/List.html b/Resources/Private/Partials/Default/List.html new file mode 100755 index 0000000..fa83376 --- /dev/null +++ b/Resources/Private/Partials/Default/List.html @@ -0,0 +1,12 @@ + +
+
+ +
+
+
+ +
+
+
+ diff --git a/Resources/Private/Partials/Default/Products/List/Filter.html b/Resources/Private/Partials/Default/Products/List/Filter.html new file mode 100755 index 0000000..b8aacf6 --- /dev/null +++ b/Resources/Private/Partials/Default/Products/List/Filter.html @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + +
+
+ + +
+ +
+
+
+
+
+
+ + + +
+ diff --git a/Resources/Private/Partials/Default/Products/List/List.html b/Resources/Private/Partials/Default/Products/List/List.html new file mode 100755 index 0000000..eb9f819 --- /dev/null +++ b/Resources/Private/Partials/Default/Products/List/List.html @@ -0,0 +1,24 @@ + + + + + + + +
+ +
+
+
+
+ + + + + +
+ + + +
+ \ No newline at end of file diff --git a/Resources/Private/Partials/Default/Products/Properties.html b/Resources/Private/Partials/Default/Products/Properties.html new file mode 100755 index 0000000..2783c36 --- /dev/null +++ b/Resources/Private/Partials/Default/Products/Properties.html @@ -0,0 +1,58 @@ + + + {_all} + + +

{product.title}

+ : {product.nr} +
+ +
+ + + + + +
+
+ +
+
+ diff --git a/Resources/Private/Partials/Default/Show.html b/Resources/Private/Partials/Default/Show.html new file mode 100755 index 0000000..3acb47e --- /dev/null +++ b/Resources/Private/Partials/Default/Show.html @@ -0,0 +1,42 @@ + + +

Single View for Products

+ + + + + + Back to list + diff --git a/Resources/Private/Partials/FilterElements/Checkbox.html b/Resources/Private/Partials/FilterElements/Checkbox.html new file mode 100755 index 0000000..e6fe818 --- /dev/null +++ b/Resources/Private/Partials/FilterElements/Checkbox.html @@ -0,0 +1,20 @@ + +
+
+ {filter.title} +
+
+ +
+ + +
+
+
+
+ diff --git a/Resources/Private/Partials/FilterElements/FilterGroups.html b/Resources/Private/Partials/FilterElements/FilterGroups.html new file mode 100755 index 0000000..5ff967c --- /dev/null +++ b/Resources/Private/Partials/FilterElements/FilterGroups.html @@ -0,0 +1,46 @@ + + + + + + + + + + +
+
+ +
+
+ +
+
+ + +
+
+ + +
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+
+ + +
+ diff --git a/Resources/Private/Partials/FilterElements/RangeSlider.html b/Resources/Private/Partials/FilterElements/RangeSlider.html new file mode 100755 index 0000000..c627c24 --- /dev/null +++ b/Resources/Private/Partials/FilterElements/RangeSlider.html @@ -0,0 +1,16 @@ + + + + + TODO supply a title + + + + +
TODO write content
+ + diff --git a/Resources/Private/Partials/FilterElements/Selectbox.html b/Resources/Private/Partials/FilterElements/Selectbox.html new file mode 100755 index 0000000..c627c24 --- /dev/null +++ b/Resources/Private/Partials/FilterElements/Selectbox.html @@ -0,0 +1,16 @@ + + + + + TODO supply a title + + + + +
TODO write content
+ + diff --git a/Resources/Private/Partials/Image.html b/Resources/Private/Partials/Image.html new file mode 100755 index 0000000..044695f --- /dev/null +++ b/Resources/Private/Partials/Image.html @@ -0,0 +1,80 @@ + + + + {variant.breakpoint as integer} + {variant.width as integer} + + + + {variant.aspectRatio as float} + {width / aspectRatio} + {height as integer} + + {f:if(condition: breakpoint, then: 'media="(min-width: {breakpoint}px)"')} + + + + {sizeConfig.multiplier as float} + {sizeWidth * width} + + + + {sizeConfig.multiplier as float} + {sizeHeight * height} + {f:uri.image(image: file, cropVariant: name, width: '{sizeWidth}c', height: '{sizeHeight}c',absolute:'true')} + + + + + {f:uri.image(image: file, cropVariant: 'default', width: maxWidth, absolute:'true')} + + + {f:uri.image(image: file, cropVariant: 'default', width: sizeWidth, absolute:'true')} + + + + + {srcset}{sizeUrl} {sizeKey}{f:if(condition: iteration.isLast, else: ',')} + + + f:format.raw()} srcset="{srcset}"> + + + + + + {defaultAspectRatio as float} + {defaultWidth / aspectRatio} + {defaultHeight as integer}c + + + + + + + + + + + + + + + + + + + + + + + + + {file.properties.alternative} + + + {file.properties.alternative} + + + + diff --git a/Resources/Private/Partials/ListElements/CardContent.html b/Resources/Private/Partials/ListElements/CardContent.html new file mode 100755 index 0000000..1de7414 --- /dev/null +++ b/Resources/Private/Partials/ListElements/CardContent.html @@ -0,0 +1,42 @@ + +
+ + + +
+ +
+
+
+
+
+
{product.title}
+

+ + {product.description} + +

+
+
    + +
  • + {values.relFilters.title} : + + + {values.relFilterOption.title} + + + {values.value} + + +
  • +
    +
+
+ + + +
+
+ + \ No newline at end of file diff --git a/Resources/Private/Partials/ListElements/Ingredients.html b/Resources/Private/Partials/ListElements/Ingredients.html new file mode 100755 index 0000000..8a3d374 --- /dev/null +++ b/Resources/Private/Partials/ListElements/Ingredients.html @@ -0,0 +1,24 @@ + +
+
+ + +
+ +
+
+
+
{ingredient.title}
+

+ + {ingredient.description} + +

+
+ +
+ diff --git a/Resources/Private/Partials/ListElements/LoadMoreButton.html b/Resources/Private/Partials/ListElements/LoadMoreButton.html new file mode 100755 index 0000000..a32318f --- /dev/null +++ b/Resources/Private/Partials/ListElements/LoadMoreButton.html @@ -0,0 +1,7 @@ + +
+ +
+ \ No newline at end of file diff --git a/Resources/Private/Partials/ListElements/NoProductFound.html b/Resources/Private/Partials/ListElements/NoProductFound.html new file mode 100755 index 0000000..29b439d --- /dev/null +++ b/Resources/Private/Partials/ListElements/NoProductFound.html @@ -0,0 +1,5 @@ + +
+ no product found +
+ \ No newline at end of file diff --git a/Resources/Private/Partials/Slider/Images.html b/Resources/Private/Partials/Slider/Images.html new file mode 100755 index 0000000..40572fe --- /dev/null +++ b/Resources/Private/Partials/Slider/Images.html @@ -0,0 +1,22 @@ + +
+
+ +
+ {image.alt} +
+
+
+
+
+
+
+
+ +
+ {image.alt} +
+
+
+
+ diff --git a/Resources/Private/Partials/Slider/Ingredients.html b/Resources/Private/Partials/Slider/Ingredients.html new file mode 100755 index 0000000..d8a3bfd --- /dev/null +++ b/Resources/Private/Partials/Slider/Ingredients.html @@ -0,0 +1,23 @@ + + + + + +
+
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ \ No newline at end of file diff --git a/Resources/Private/Partials/Slider/Products.html b/Resources/Private/Partials/Slider/Products.html new file mode 100755 index 0000000..8e3ce27 --- /dev/null +++ b/Resources/Private/Partials/Slider/Products.html @@ -0,0 +1,22 @@ + + + + +
+
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ diff --git a/Resources/Private/Partials/StyleOne/AjaxList.html b/Resources/Private/Partials/StyleOne/AjaxList.html new file mode 100755 index 0000000..4061f5d --- /dev/null +++ b/Resources/Private/Partials/StyleOne/AjaxList.html @@ -0,0 +1,2 @@ + + diff --git a/Resources/Private/Partials/StyleOne/List.html b/Resources/Private/Partials/StyleOne/List.html new file mode 100755 index 0000000..c962f45 --- /dev/null +++ b/Resources/Private/Partials/StyleOne/List.html @@ -0,0 +1,6 @@ + + +
+ +
+ diff --git a/Resources/Private/Partials/StyleOne/Products/List/Filter.html b/Resources/Private/Partials/StyleOne/Products/List/Filter.html new file mode 100755 index 0000000..23b5d14 --- /dev/null +++ b/Resources/Private/Partials/StyleOne/Products/List/Filter.html @@ -0,0 +1,48 @@ + + + + + + + + + + + +
+
+ + +
+
+ +
+
+ +
+
+ + +
+ +
+
+
+
+
+
+ +
+
+ +
+
+
+
+ + + +
+ diff --git a/Resources/Private/Partials/StyleOne/Products/List/List.html b/Resources/Private/Partials/StyleOne/Products/List/List.html new file mode 100755 index 0000000..1ba1ffa --- /dev/null +++ b/Resources/Private/Partials/StyleOne/Products/List/List.html @@ -0,0 +1,23 @@ + + + + + + +
+ +
+
+
+
+ + + + + +
+ + + +
+ \ No newline at end of file diff --git a/Resources/Private/Partials/StyleOne/Products/Properties.html b/Resources/Private/Partials/StyleOne/Products/Properties.html new file mode 100755 index 0000000..c8ee948 --- /dev/null +++ b/Resources/Private/Partials/StyleOne/Products/Properties.html @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + {products.nr} +
+ + + {products.title} +
+ + + {products.description} +
+ + + + + + + + +
+ + + + + + + +
+ + + {products.price} +
+ + +
+ +
+ {values.relFilters.title} : + + + {values.relFilterOption.title} + + + {values.value} + + +
+
+
+{products} + diff --git a/Resources/Private/Partials/StyleOne/Show.html b/Resources/Private/Partials/StyleOne/Show.html new file mode 100755 index 0000000..4910b52 --- /dev/null +++ b/Resources/Private/Partials/StyleOne/Show.html @@ -0,0 +1,51 @@ + +

Single View for Products

+ + + + + + + Back to list
+ New Products + diff --git a/Resources/Private/Templates/Ingredients/List.html b/Resources/Private/Templates/Ingredients/List.html new file mode 100755 index 0000000..27c7f48 --- /dev/null +++ b/Resources/Private/Templates/Ingredients/List.html @@ -0,0 +1,13 @@ + + + + +
+ +
+ +
+
+
+
+ diff --git a/Resources/Private/Templates/Ingredients/Show.html b/Resources/Private/Templates/Ingredients/Show.html new file mode 100755 index 0000000..3be20da --- /dev/null +++ b/Resources/Private/Templates/Ingredients/Show.html @@ -0,0 +1,87 @@ + + + + +

{ingredient.title}

+
+ + + +
+
+ {ingredient.title} +
+
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+
+
+
+
+ + +
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ + + +
+
+ +
+
+
+ +
+ + + + + +
+
+
+
+
+
+

+ {ingredient.description} +

+
+ +
+ + +
+

+
+ +
+ diff --git a/Resources/Private/Templates/Products/AjaxList.html b/Resources/Private/Templates/Products/AjaxList.html new file mode 100755 index 0000000..930edf7 --- /dev/null +++ b/Resources/Private/Templates/Products/AjaxList.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Resources/Private/Templates/Products/List.html b/Resources/Private/Templates/Products/List.html new file mode 100755 index 0000000..2d3d948 --- /dev/null +++ b/Resources/Private/Templates/Products/List.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/Resources/Private/Templates/Products/Show.html b/Resources/Private/Templates/Products/Show.html new file mode 100755 index 0000000..03c39d6 --- /dev/null +++ b/Resources/Private/Templates/Products/Show.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/Resources/Public/Icons/Extension.png b/Resources/Public/Icons/Extension.png new file mode 100755 index 0000000..a190977 Binary files /dev/null and b/Resources/Public/Icons/Extension.png differ diff --git a/Resources/Public/Icons/a2g.gif b/Resources/Public/Icons/a2g.gif new file mode 100755 index 0000000..c725214 Binary files /dev/null and b/Resources/Public/Icons/a2g.gif differ diff --git a/Resources/Public/Icons/brand-image.png b/Resources/Public/Icons/brand-image.png new file mode 100755 index 0000000..2feec39 Binary files /dev/null and b/Resources/Public/Icons/brand-image.png differ diff --git a/Resources/Public/Icons/categories.png b/Resources/Public/Icons/categories.png new file mode 100755 index 0000000..e793c1a Binary files /dev/null and b/Resources/Public/Icons/categories.png differ diff --git a/Resources/Public/Icons/filter-option.png b/Resources/Public/Icons/filter-option.png new file mode 100755 index 0000000..cc6bd08 Binary files /dev/null and b/Resources/Public/Icons/filter-option.png differ diff --git a/Resources/Public/Icons/filters.png b/Resources/Public/Icons/filters.png new file mode 100755 index 0000000..25f15e1 Binary files /dev/null and b/Resources/Public/Icons/filters.png differ diff --git a/Resources/Public/Icons/fingerprint-outline-variant.png b/Resources/Public/Icons/fingerprint-outline-variant.png new file mode 100755 index 0000000..cadc374 Binary files /dev/null and b/Resources/Public/Icons/fingerprint-outline-variant.png differ diff --git a/Resources/Public/Icons/natural-ingredients.png b/Resources/Public/Icons/natural-ingredients.png new file mode 100755 index 0000000..1acc5c4 Binary files /dev/null and b/Resources/Public/Icons/natural-ingredients.png differ diff --git a/Resources/Public/Icons/online-shopping.png b/Resources/Public/Icons/online-shopping.png new file mode 100755 index 0000000..1e8dcb7 Binary files /dev/null and b/Resources/Public/Icons/online-shopping.png differ diff --git a/Resources/Public/Icons/package.png b/Resources/Public/Icons/package.png new file mode 100755 index 0000000..cb0f007 Binary files /dev/null and b/Resources/Public/Icons/package.png differ diff --git a/Resources/Public/Icons/tag.png b/Resources/Public/Icons/tag.png new file mode 100755 index 0000000..cc5845f Binary files /dev/null and b/Resources/Public/Icons/tag.png differ diff --git a/Resources/Public/JavaScript/GoogleAnalytics/A2gGaEcommerce.js b/Resources/Public/JavaScript/GoogleAnalytics/A2gGaEcommerce.js new file mode 100755 index 0000000..b158f52 --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/A2gGaEcommerce.js @@ -0,0 +1,17 @@ +/** + * A2gGaEcommerce + */ +var A2gGaEcommerce = function () { + 'use strict'; + var Constructor = function () { + +// id, name, price = 0.0, quantity = 0, currency = '', categories = [], listId = 'all_products', listName = 'All Products', position= 0, brand = '', variant = '', locationId = '', affiliation = 'altogether store', discount = 0.0, coupon = '') { + +// GaProduct test +var gaProduct = new GaProduct('test_id', 'test_name', 323.23, 3, 'EUR', ['category1', 'category2'], 'all_products', 'All Products', 1, 'test brand', 'test variant', '', 'altogether store'); +gaProduct.selectItem(); + +console.log(gaProduct); + }; + return Constructor; +}(GaCheckout, GaProduct, GaProducts, GaPromotion, GaPromotions, GaPurchase, GaRefund, GaRefunds) diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaCheckout.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaCheckout.js new file mode 100755 index 0000000..034dcc4 --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaCheckout.js @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2021 Raphael Martin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaCheckout + */ +var GaCheckout = function () { + 'use strict'; + var Constructor = function () { + }; + Constructor.prototype.checkout = function (step, option, GaProductsObject, url) { + if (typeof ga === 'function' && typeof dataLayer === 'object' && typeof GaProductsObject === 'object' && GaProductsObject instanceof GaProducts) { + var products = []; + for (var i = 0; i < GaProductsObject.arr.length; i++) { + products.push({ + 'name': GaProductsObject.arr[i].name, // Name or ID is required. + 'id': GaProductsObject.arr[i].id, + 'price': GaProductsObject.arr[i].price, + 'brand': GaProductsObject.arr[i].brand, + 'category': GaProductsObject.arr[i].category, + 'variant': GaProductsObject.arr[i].variant, + 'quantity': GaProductsObject.arr[i].quantity + }); + } + dataLayer.push({ + 'event': 'checkout', + 'ecommerce': { + 'checkout': { + 'actionField': {'step': step, 'option': option}, + 'products': products + } + }, + 'eventCallback': function(){ + document.location = url; + } + }); + } else { + console.log('GaCheckout.checkout requiers ga and dataLayer'); + } + }; + Constructor.prototype.checkoutOption = function (step, option) { + if (typeof ga === 'function' && typeof dataLayer === 'object') { + dataLayer.push({ + 'event': 'checkoutOption', + 'ecommerce': { + 'checkout': { + 'actionField': {'step': step, 'option': option} + } + } + }); + } else { +// console.log('checkoutOption requiers ga and dataLayer'); + } + }; + return Constructor; +}(); + + diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaCheckout.min.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaCheckout.min.js new file mode 100755 index 0000000..28aa364 --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaCheckout.min.js @@ -0,0 +1 @@ +var GaCheckout=function(){"use strict";var t=function(){};return t.prototype.checkout=function(t,e,a,o){if("function"==typeof ga&&"object"==typeof dataLayer&&"object"==typeof a&&a instanceof GaProducts){for(var r=[],c=0;c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaProduct + */ +var GaProduct = function () { + 'use strict'; + var Constructor = function (id, name, price = 0.0, quantity = 0, currency = '', categories = [], listId = 'all_products', listName = 'All Products', position = 0, brand = '', variant = '', locationId = '', affiliation = 'altogether store', discount = 0.0, coupon = '') { + if (typeof ga === 'function' && typeof dataLayer === 'object' && typeof gtag === 'function') { + this.item_id = id; + this.item_name = name; + for (var i = 0; i < categories.length; i++) { + if (i === 0) { + this.item_category = categories[i]; + } + if (i === 1) { + this.item_category2 = categories[i]; + } + if (i === 2) { + this.item_category3 = categories[i]; + } + if (i === 3) { + this.item_category4 = categories[i]; + } + if (i === 4) { + this.item_category5 = categories[i]; + } + } + if (price > 0) { + this.price = price; + } + if (currency !== '') { + this.currency = currency; + } + if (quantity > 0) { + this.quantity = quantity; + } + if (position > 0) { + this.index = position; + } + if (brand !== '') { + this.item_brand = brand; + } + if (variant !== '') { + this.item_variant = variant; + } + if (listId !== '') { + this.item_list_id = listId; + } + if (listName !== '') { + this.item_list_name = listName; + } + if (locationId !== '') { + this.location_id = locationId; + } + if (affiliation !== '') { + this.affiliation = affiliation; + } + if (discount > 0.00) { + this.discount = discount; + } + if (coupon !== '') { + this.coupon = coupon; + } + } else { + console.log('ga datalayer or gtag missing'); + } + }; + Constructor.prototype.selectItem = function () { + gtag('event', 'select_item', { + item_list_id: this.listId, + item_list_name: this.listName, + items: [JSON.stringify(this)] + }); + }; + Constructor.prototype.viewItem = function () { + gtag('event', 'view_item', { + currency: this.currency, + value: this.price, + items: [JSON.stringify(this)] + }); + }; + Constructor.prototype.addToCart = function (currencyCode = 'EUR') { + if (typeof ga === 'function' && typeof dataLayer === 'object') { + dataLayer.push({ + 'event': 'addToCart', + 'ecommerce': { + 'currencyCode': currencyCode.toUpperCase(), + 'add': { + 'products': [{ + 'name': this.name, // Name or ID is required. + 'id': this.id, + 'price': this.price, + 'brand': this.brand, + 'category': this.category, + 'variant': this.variant, + 'position': this.position + }] + } + } + }); + } else { +// console.log('GaProduct.addToCart requiers ga and dataLayer'); + } + }; + Constructor.prototype.removeFromCart = function () { + if (typeof ga === 'function' && typeof dataLayer === 'object') { + dataLayer.push({ + 'event': 'removeFromCart', + 'ecommerce': { + 'remove': { + 'products': [{ + 'name': this.name, // Name or ID is required. + 'id': this.id, + 'price': this.price, + 'brand': this.brand, + 'category': this.category, + 'variant': this.variant, + 'position': this.position + }] + } + } + }); + } else { +// console.log('GaProduct.removeFromCart requiers ga and dataLayer'); + } + }; + return Constructor; +}(); diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaProduct.min.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaProduct.min.js new file mode 100755 index 0000000..f95d9ca --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaProduct.min.js @@ -0,0 +1 @@ +function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var GaProduct=function(){"use strict";function t(t,e,i,o,a,n){var r=6 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaProducts + */ +var GaProducts = function () { + 'use strict'; + var Constructor = function (itemListId, itemListName, GaProductObject) { + this.item_list_id = itemListId; + this.item_list_name = itemListName; + this.arr = []; + if (typeof (GaProductObject) === 'object' && GaProductObject instanceof GaProduct) { + this.arr.push(GaProductObject); + } + }; + Constructor.prototype.push = function (GaProductObject) { + if (typeof (GaProductObject) === 'object' && GaProductObject instanceof GaProduct) { + this.arr.push(GaProductObject); + } else { + console.log('GaProductObject must be a instanceof GaProduct'); + } + }; + Constructor.prototype.viewItemList = function () { + gtag("event", "view_item_list", { + item_list_id: this.item_list_id, + item_list_name: this.item_list_name, + items: JSON.stringify(this.arr) + }); + }; + Constructor.prototype.impressions = function (currencyCode = 'EUR', list = 'Search Results') { + if (typeof ga === 'function' && typeof dataLayer === 'object' && this.arr.length > 0) { + var products = []; + for (var i = 0; i < this.arr.length; i++) { + products.push({ + 'name': this.arr[i].name, // Name or ID is required. + 'id': this.arr[i].id, + 'price': this.arr[i].price, + 'brand': this.arr[i].brand, + 'category': this.arr[i].category, + 'variant': this.arr[i].variant, + 'list': list, + 'position': this.arr[i].position + }); + } + dataLayer.push({ + 'ecommerce': { + 'currencyCode': currencyCode, + 'impressions': products + } + }); + } else { + console.log('GaProducts.productClick requiers ga and dataLayer'); + } + }; + Constructor.prototype.addToCart = function (currencyCode = 'EUR') { + if (typeof ga === 'function' && typeof dataLayer === 'object' && this.arr.length > 0) { + var products = []; + for (var i = 0; i < this.arr.length; i++) { + products.push({ + 'name': this.arr[i].name, // Name or ID is required. + 'id': this.arr[i].id, + 'price': this.arr[i].price, + 'brand': this.arr[i].brand, + 'category': this.arr[i].category, + 'variant': this.arr[i].variant, + 'quantity': this.arr[i].quantity + }); + } + dataLayer.push({ + 'event': 'addToCart', + 'ecommerce': { + 'currencyCode': currencyCode.toUpperCase(), + 'add': { + 'products': products + } + } + }); + } else { + console.log('GaProducts.addToCart requiers ga and dataLayer'); + } + }; + Constructor.prototype.removeFromCart = function () { + if (typeof ga === 'function' && typeof dataLayer === 'object' && this.arr.length > 0) { + var products = []; + for (var i = 0; i < this.arr.length; i++) { + products.push({ + 'name': this.arr[i].name, // Name or ID is required. + 'id': this.arr[i].id, + 'price': this.arr[i].price, + 'brand': this.arr[i].brand, + 'category': this.arr[i].category, + 'variant': this.arr[i].variant, + 'quantity': this.arr[i].quantity + }); + } + dataLayer.push({ + 'event': 'removeFromCart', + 'ecommerce': { + 'remove': { + 'products': products + } + } + }); + } else { + console.log('GaProducts.removeFromCart requiers ga and dataLayer'); + } + }; + return Constructor; +}(GaProduct); diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaProducts.min.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaProducts.min.js new file mode 100755 index 0000000..9a98e1b --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaProducts.min.js @@ -0,0 +1 @@ +function _typeof(r){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var GaProducts=function(){"use strict";function r(r){this.arr=[],"object"===_typeof(r)&&r instanceof GaProduct?this.arr.push(r):console.log("GaProductObject must be a instanceof GaProduct")}return r.prototype.push=function(r){"object"===_typeof(r)&&r instanceof GaProduct?this.arr.push(r):console.log("GaProductObject must be a instanceof GaProduct")},r.prototype.impressions=function(){var r=0 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaPromotion + */ +var GaPromotion = function () { + 'use strict'; + var Constructor = function (id, name, creative, position) { + this.id = id; + this.name = name; + this.creative = creative; + this.position = position; + }; + Constructor.prototype.promotionClick = function (url) { + if (typeof ga === 'function' && typeof dataLayer === 'object') { + var promotions = []; + promotions.push({ + 'id': this.id, // Name or ID is required. + 'name': this.name, + 'creative': this.creative, + 'position': this.position + }); + dataLayer.push({ + 'event': 'promotionClick', + 'ecommerce': { + 'promoClick': { + 'promotions': promotions + } + }, + 'eventCallback': function(){ + document.location = url; + } + }); + } else { +// console.log('GaPromotion.promotionClick requiers ga and dataLayer'); + } + }; + return Constructor; +}(); diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotion.min.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotion.min.js new file mode 100755 index 0000000..6c46864 --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotion.min.js @@ -0,0 +1 @@ +function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var GaPromotion=function(){"use strict";function t(t,o,e,n){this.id=t,this.name=o,this.creative=e,this.position=n}return t.prototype.promotionClick=function(t){var o;"function"==typeof ga&&"object"===("undefined"==typeof dataLayer?"undefined":_typeof(dataLayer))&&((o=[]).push({id:this.id,name:this.name,creative:this.creative,position:this.position}),dataLayer.push({event:"promotionClick",ecommerce:{promoClick:{promotions:o}},eventCallback:function(){document.location=t}}))},t}(); \ No newline at end of file diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotions.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotions.js new file mode 100755 index 0000000..9d4408e --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotions.js @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 Raphael Martin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaPromotions + */ +var GaPromotions = function () { + 'use strict'; + var Constructor = function (GaPromotionObject) { + this.arr = []; + if (typeof (GaPromotionObject) === 'object' && GaPromotionObject instanceof GaPromotion) { + this.arr.push(GaPromotionObject); + } else { + console.log('GaPromotionObject must be a instanceof GaPromotion'); + } + }; + Constructor.prototype.push = function (GaProductObject) { + if (typeof (GaProductObject) === 'object' && GaProductObject instanceof GaProduct) { + this.arr.push(GaProductObject); + } else { + console.log('GaProductObject must be a instanceof GaProduct'); + } + }; + Constructor.prototype.promoView = function () { + if (typeof ga === 'function' && typeof dataLayer === 'object' && this.arr.length > 0) { + var promotions = []; + for (var i = 0; i < this.arr.length; i++) { + promotions.push({ + 'id': this.arr[i].id, // Name or ID is required. + 'name': this.arr[i].name, + 'creative': this.arr[i].creative, + 'position': this.arr[i].position + }); + } + dataLayer.push({ + 'ecommerce': { + 'promoView': { + 'promotions': promotions + } + } + }); + } else { +// console.log('GaPromotions.promoView requiers ga and dataLayer'); + } + }; + return Constructor; +}(GaPromotion); diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotions.min.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotions.min.js new file mode 100755 index 0000000..cdd5ce5 --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPromotions.min.js @@ -0,0 +1 @@ +function _typeof(o){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}var GaPromotions=function(){"use strict";function o(o){this.arr=[],"object"===_typeof(o)&&o instanceof GaPromotion?this.arr.push(o):console.log("GaPromotionObject must be a instanceof GaPromotion")}return o.prototype.push=function(o){"object"===_typeof(o)&&o instanceof GaProduct?this.arr.push(o):console.log("GaProductObject must be a instanceof GaProduct")},o.prototype.promoView=function(){if("function"==typeof ga&&"object"===("undefined"==typeof dataLayer?"undefined":_typeof(dataLayer))&&0 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaPurchase + */ +var GaPurchase = function () { + 'use strict'; + var Constructor = function (id, affiliation, revenue, tax, shipping, coupon) { + this.id = id; + this.affiliation = affiliation; + this.revenue = revenue; + this.tax = tax; + this.shipping = shipping; + this.coupon = coupon; + }; + Constructor.prototype.purchase = function (GaProductsObject) { + if (typeof ga === 'function' && typeof dataLayer === 'object' && typeof GaProductsObject === 'object' && GaProductsObject instanceof GaProducts) { + var products = []; + for (var i = 0; i < GaProductsObject.arr.length; i++) { + products.push({ + 'name': GaProductsObject.arr[i].name, // Name or ID is required. + 'id': GaProductsObject.arr[i].id, + 'price': GaProductsObject.arr[i].price, + 'brand': GaProductsObject.arr[i].brand, + 'category': GaProductsObject.arr[i].category, + 'variant': GaProductsObject.arr[i].variant, + 'quantity': GaProductsObject.arr[i].quantity + }); + } + dataLayer.push({ + 'event': 'checkout', + 'ecommerce': { + 'purchase': { + 'actionField': { + 'id': this.id, // Transaction ID. Required for purchases and refunds. + 'affiliation': this.affiliation, + 'revenue': this.revenue, // Total transaction value (incl. tax and shipping) + 'tax': this.tax, + 'shipping': this.shipping, + 'coupon': this.coupon + }, + 'products': products + } + } + }); + } else { +// console.log('GaPurchase.purchase requiers ga and dataLayer'); + } + }; + return Constructor; +}(GaProducts); \ No newline at end of file diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPurchase.min.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPurchase.min.js new file mode 100755 index 0000000..ca96f95 --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaPurchase.min.js @@ -0,0 +1 @@ +function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var GaPurchase=function(){"use strict";function t(t,e,i,o,r,n){this.id=t,this.affiliation=e,this.revenue=i,this.tax=o,this.shipping=r,this.coupon=n}return t.prototype.purchase=function(t){if("function"==typeof ga&&"object"===("undefined"==typeof dataLayer?"undefined":_typeof(dataLayer))&&"object"===_typeof(t)&&t instanceof GaProducts){for(var e=[],i=0;i + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaRefund + */ +var GaRefund = function () { + 'use strict'; + var Constructor = function (id) { + this.id = id; + }; + Constructor.prototype.refund = function () { + if (typeof ga === 'function' && typeof dataLayer === 'object') { + dataLayer.push({ + 'event': 'checkout', + 'ecommerce': { + 'refund': { + 'actionField': { + 'id': this.id + } + } + } + }); + } else { +// console.log('GaRefund.refund requiers ga and dataLayer'); + } + }; + return Constructor; +}(); \ No newline at end of file diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefund.min.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefund.min.js new file mode 100755 index 0000000..6f9c40d --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefund.min.js @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 Raphael Martin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaRefund + */ +var GaRefund = function () { + 'use strict'; + var Constructor = function (id) { + this.id = id; + }; + Constructor.prototype.refund = function () { + if (typeof ga === 'function' && typeof dataLayer === 'object') { + dataLayer.push({ + 'event': 'checkout', + 'ecommerce': { + 'refund': { + 'actionField': { + 'id': this.id + } + } + } + }); + } else { +// console.log('GaRefund.refund requiers ga and dataLayer'); + } + }; + return Constructor; +}(); \ No newline at end of file diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefunds.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefunds.js new file mode 100755 index 0000000..71322e9 --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefunds.js @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2021 Raphael Martin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * GaRefunds + */ +var GaRefunds = function () { + 'use strict'; + var Constructor = function (gaRefundObject) { + + if (typeof (gaRefundObject) === 'object' && gaRefundObject instanceof GaRefund) { + this.gaRefund = gaRefundObject; + } else { + console.log('GaProductObject must be a instanceof GaProduct'); + } + }; + Constructor.prototype.refund = function (GaProductsObject) { + if (typeof ga === 'function' && typeof dataLayer === 'object' && typeof GaProductsObject === 'object' && GaProductsObject instanceof GaProducts) { + var products = []; + for (var i = 0; i < GaProductsObject.arr.length; i++) { + products.push({ + 'id': GaProductsObject.arr[i].id, + 'quantity': GaProductsObject.arr[i].quantity + }); + } + dataLayer.push({ + 'event': 'checkout', + 'ecommerce': { + 'refund': { + 'actionField': { + 'id': this.gaRefund.id + }, + 'products': products + } + } + }); + } else { +// console.log('GaRefunds.refund requiers ga and dataLayer'); + } + }; + return Constructor; +}(GaProducts, GaRefund); \ No newline at end of file diff --git a/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefunds.min.js b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefunds.min.js new file mode 100755 index 0000000..b4d00e3 --- /dev/null +++ b/Resources/Public/JavaScript/GoogleAnalytics/google-analytics/GaRefunds.min.js @@ -0,0 +1 @@ +var GaRefunds=function(){"use strict";var t=function(t){"object"==typeof t&&t instanceof GaRefund?this.gaRefund=t:console.log("GaProductObject must be a instanceof GaProduct")};return t.prototype.refund=function(t){if("function"==typeof ga&&"object"==typeof dataLayer&&"object"==typeof t&&t instanceof GaProducts){for(var e=[],a=0;a= 0 && matches.item(i) !== el) { + } + ; + } while ((i < 0) && (el = el.parentElement)); + return el; + }; +} + +var a2gProductsList = { + wrapClass: 'altogether-products', + filterInputClass: 'a2g-filter-input', + ajaxFormClass: 'a2g-ajax-form', + ajaxContentClass: 'a2g-ajax-content', + ajaxLoadMoreInputClass: 'a2g-ajax-loads', + ajaxLoadMoreBtnClass: 'a2g-ajax-loadmore-btn', + ajaxLoadMoreBtnWrapClass: 'a2g-ajax-loadmore-btn-wrap', + ajaxSpinnerClass: 'a2g-ajax-spinner', + ajaxLoadingSpinner: '
', + checkIfFilterIsFilledOnInit: function () { + + }, + initFormSubmit: function (_this, ajaxForms, i) { + ajaxForms[i].querySelector('.' + _this.ajaxFormClass).addEventListener("submit", function (e) { + e.preventDefault(); + _this.formSubmitAction(_this, this); + return false; + }); + }, + formSubmitAction: function(_this, activeForm){ + var activeContent = activeForm.closest('.' + _this.wrapClass).querySelector('.' + _this.ajaxContentClass); + activeContent.innerHTML = _this.ajaxLoadingSpinner; + activeForm.querySelector('.' + _this.ajaxLoadMoreInputClass).value = 0; + jQuery.ajax({ + async: 'true', + url: $(activeForm).attr('action'), + type: 'POST', + data: $(activeForm).serializeArray(), + dataType: 'html', + success: function (result) { + activeForm.closest('.' + _this.wrapClass).querySelector('.' + _this.ajaxContentClass).innerHTML = result; + _this.initLoadMore(_this, activeContent.querySelector('.' + _this.ajaxLoadMoreBtnClass)); + if (typeof (a2gShop) === 'object') { + a2gShop.cart.setCartActions(a2gShop.cart, activeContent.getElementsByClassName(a2gShop.cart.productWrapClass)); + } + }, + error: function (error) { + // console.log(error); + }, + done: function () { + } + }); + }, + initLoadMore: function (_this, btn) { + if (btn !== null) { + + btn.addEventListener("click", function () { + var activeForm = this.closest('.' + _this.wrapClass).querySelector('.' + _this.ajaxFormClass), + activeContent = this.closest('.' + _this.wrapClass).querySelector('.' + _this.ajaxContentClass); + activeContent.innerHTML += _this.ajaxLoadingSpinner; + activeContent.removeChild(activeContent.querySelector('.' + _this.ajaxLoadMoreBtnWrapClass)); + activeForm.querySelector('.' + _this.ajaxLoadMoreInputClass).value = parseInt(activeForm.querySelector('.' + _this.ajaxLoadMoreInputClass).value) + 1; + jQuery.ajax({ + async: 'true', + url: $(activeForm).attr('action'), + type: 'POST', + data: $(activeForm).serializeArray(), + dataType: 'html', + success: function (result) { + activeContent.removeChild(activeContent.querySelector('.' + _this.ajaxSpinnerClass)); + activeContent.innerHTML += result; + _this.initLoadMore(_this, activeContent.querySelector('.' + _this.ajaxLoadMoreBtnClass)); + if (typeof (a2gShop) === 'object') { + a2gShop.cart.setCartActions(a2gShop.cart, activeContent.getElementsByClassName(a2gShop.cart.productWrapClass)); + } + }, + error: function (error) { + // console.log(error); + }, + done: function () { + } + }); + }); + } + }, + init: function () { + var _this = this, ajaxForms = document.getElementsByClassName(_this.wrapClass), inputs = []; + document.addEventListener('DOMContentLoaded', function () { + for (var i = 0; i < ajaxForms.length; i++) { + inputs[i] = ajaxForms[i].getElementsByClassName(_this.filterInputClass); + for (var j = 0; j < inputs[i]; j++){ + inputs[i].checked = false; + } + if (ajaxForms[i].querySelector('.' + _this.ajaxFormClass) !== null) { + _this.initFormSubmit(_this, ajaxForms, i); + _this.initLoadMore(_this, ajaxForms[i].querySelector('.' + _this.ajaxLoadMoreBtnClass)); + } + } + }); + } +}; +a2gProductsList.init(); + +var a2gUri = { + encode: function(uri){ + return encodeURIComponent(uri); + }, + mailto: function(mailto, subject, body){ + var _this = a2gUri; + if(typeof(mailto) === 'string' && typeof(subject) === 'string' && typeof(body) === 'string'){ + return 'mailto:'+mailto+'?subject='+_this.encode(subject)+'&body='+_this.encode(body); + } else if(typeof(mailto) === 'string' && typeof(subject) === 'string'){ + return 'mailto:'+_this.encode(mailto)+'?subject='+_this.encode(subject); + } else if(typeof(mailto) === 'string'){ + return 'mailto:'+mailto; + } + } +}; + +var a2gProductsDetail = { + class: { + wrap: 'a2g-product-detail', + variant: { + tab: 'a2g-product-variant-tab' + }, + request: { + mail: 'a2g-product-request-mail' + } + }, + setRequestBtnLink: function(subject, body) { + var _this = a2gProductsDetail; + var btns = document.getElementsByClassName(_this.class.request.mail); + for( var i = 0; i < btns.length; i++){ + btns[i].setAttribute('href', a2gUri.mailto(btns[i].dataset.mailto, subject, body)); + } + }, + getVariantTabTriggerElement: function() { + var _this = a2gProductsDetail, triggerEle = document.querySelector('.'+_this.class.variant.tab+'[data-href="' + window.location.href + '"]'); + if (triggerEle === null) { + triggerEle = document.querySelector('.'+_this.class.variant.tab+'[data-href="' + window.location.pathname + '"]'); + } + return triggerEle; + }, + fromHistoryBack: false, + init: function(){ + var _this = a2gProductsDetail; + if (document.getElementsByClassName(_this.class.wrap)[0] !== null) { + var tabEl = document.getElementsByClassName(_this.class.variant.tab); + for (var i = 0; i < tabEl.length; i++) { + tabEl[i].addEventListener('shown.bs.tab', function (event) { + if (!_this.fromHistoryBack) { + history.pushState({ + id: 'homepage-article' + }, 'altogether product detail', this.dataset.href); + } + _this.fromHistoryBack = false; + _this.setRequestBtnLink(this.dataset.subject, this.dataset.href); + }); + } + window.addEventListener('popstate', function (event) { + var triggerEle = a2gProductsDetail.getVariantTabTriggerElement(); + if (triggerEle !== null) { + _this.fromHistoryBack = true; + triggerEle.click(); + } + }); + var triggerEle = a2gProductsDetail.getVariantTabTriggerElement(); + if (triggerEle !== null) { + if (!triggerEle.classList.contains('active')) { + triggerEle.click(); + } + } + } + } + +} + +a2gProductsDetail.init(); \ No newline at end of file diff --git a/Resources/Public/JavaScript/a2gProductsSwiper.init.js b/Resources/Public/JavaScript/a2gProductsSwiper.init.js new file mode 100755 index 0000000..80c7bdf --- /dev/null +++ b/Resources/Public/JavaScript/a2gProductsSwiper.init.js @@ -0,0 +1,86 @@ +var a2gProductsSwiper = { + a2gCardSwiper: null, + initCardSwiper: function (_this) { + _this.a2gCardSwiper = new Swiper(".a2g-products-swiper-card", { + slidesPerView: 1, + spaceBetween: 10, + autoHeight: false, + loop: true, + init: true, + freeMode: false, + observer: true, + resizeObserver: true, + setWrapperSize: true, + preloadImages: true, + autoplay: { + delay: 7000, + disableOnInteraction: true + }, + pagination: { + el: ".swiper-pagination", + clickable: true + }, + breakpoints: { + 640: { + slidesPerView: 2, + spaceBetween: 15 + }, + 1024: { + slidesPerView: 3, + spaceBetween: 30 + } + } + }); + + }, + a2gImageSwiper: null, + a2gImageThumbSwiper: null, + initImageSwiper: function (_this) { + var sliders = document.getElementsByClassName("a2g-products-swiper-images-wrap"); + _this.a2gImageThumbSwiper = []; + _this.a2gImageSwiper = []; + for (var i = 0; i < sliders.length; i++) { + _this.a2gImageThumbSwiper[i] = new Swiper('#' + sliders[i].querySelector(".a2g-products-swiper-images-thumb").id, { + loop: true, + spaceBetween: 10, + slidesPerView: 4, + freeMode: false, + autoHeight: false, + watchSlidesProgress: true, + setWrapperSize: true, + preloadImages: true, + observer: true, + resizeObserver: true + }); + _this.a2gImageSwiper[i] = new Swiper('#' + sliders[i].querySelector(".a2g-products-swiper-images").id, { + loop: true, + spaceBetween: 10, + autoHeight: true, + freeMode: false, + observer: true, + resizeObserver: true, + setWrapperSize: true, + preloadImages: true, + effect: 'slide', + thumbs: { + swiper: _this.a2gImageThumbSwiper[i] + } + }); + } + }, + init: function () { + var _this = this; + _this.initCardSwiper(_this); + _this.initImageSwiper(_this); + document.addEventListener('DOMContentLoaded', function () { + _this.a2gCardSwiper.init(); + for (var i = 0; i < _this.a2gImageThumbSwiper.length; i++) { + _this.a2gImageSwiper[i].init(); + _this.a2gImageThumbSwiper[i].init(); + } + }); + + } +}; + +a2gProductsSwiper.init(); \ No newline at end of file diff --git a/Resources/Public/JavaScript/rSlider.min.js b/Resources/Public/JavaScript/rSlider.min.js new file mode 100755 index 0000000..c960803 --- /dev/null +++ b/Resources/Public/JavaScript/rSlider.min.js @@ -0,0 +1,11 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + * + * https://github.com/slawomir-zaziablo/range-slider + * + */ + + +!function(){"use strict";var t=function(t){this.input=null,this.inputDisplay=null,this.slider=null,this.sliderWidth=0,this.sliderLeft=0,this.pointerWidth=0,this.pointerR=null,this.pointerL=null,this.activePointer=null,this.selected=null,this.scale=null,this.step=0,this.tipL=null,this.tipR=null,this.timeout=null,this.valRange=!1,this.values={start:null,end:null},this.conf={target:null,values:null,set:null,range:!1,width:null,scale:!0,labels:!0,tooltip:!0,step:null,disabled:!1,onChange:null},this.cls={container:"rs-container",background:"rs-bg",selected:"rs-selected",pointer:"rs-pointer",scale:"rs-scale",noscale:"rs-noscale",tip:"rs-tooltip"};for(var i in this.conf)t.hasOwnProperty(i)&&(this.conf[i]=t[i]);this.init()};t.prototype.init=function(){return"object"==typeof this.conf.target?this.input=this.conf.target:this.input=document.getElementById(this.conf.target.replace("#","")),this.input?(this.inputDisplay=getComputedStyle(this.input,null).display,this.input.style.display="none",this.valRange=!(this.conf.values instanceof Array),!this.valRange||this.conf.values.hasOwnProperty("min")&&this.conf.values.hasOwnProperty("max")?this.createSlider():console.log("Missing min or max value...")):console.log("Cannot find target element...")},t.prototype.createSlider=function(){return this.slider=i("div",this.cls.container),this.slider.innerHTML='
',this.selected=i("div",this.cls.selected),this.pointerL=i("div",this.cls.pointer,["dir","left"]),this.scale=i("div",this.cls.scale),this.conf.tooltip&&(this.tipL=i("div",this.cls.tip),this.tipR=i("div",this.cls.tip),this.pointerL.appendChild(this.tipL)),this.slider.appendChild(this.selected),this.slider.appendChild(this.scale),this.slider.appendChild(this.pointerL),this.conf.range&&(this.pointerR=i("div",this.cls.pointer,["dir","right"]),this.conf.tooltip&&this.pointerR.appendChild(this.tipR),this.slider.appendChild(this.pointerR)),this.input.parentNode.insertBefore(this.slider,this.input.nextSibling),this.conf.width&&(this.slider.style.width=parseInt(this.conf.width)+"px"),this.sliderLeft=this.slider.getBoundingClientRect().left,this.sliderWidth=this.slider.clientWidth,this.pointerWidth=this.pointerL.clientWidth,this.conf.scale||this.slider.classList.add(this.cls.noscale),this.setInitialValues()},t.prototype.setInitialValues=function(){if(this.disabled(this.conf.disabled),this.valRange&&(this.conf.values=s(this.conf)),this.values.start=0,this.values.end=this.conf.range?this.conf.values.length-1:0,this.conf.set&&this.conf.set.length&&n(this.conf)){var t=this.conf.set;this.conf.range?(this.values.start=this.conf.values.indexOf(t[0]),this.values.end=this.conf.set[1]?this.conf.values.indexOf(t[1]):null):this.values.end=this.conf.values.indexOf(t[0])}return this.createScale()},t.prototype.createScale=function(t){this.step=this.sliderWidth/(this.conf.values.length-1);for(var e=0,s=this.conf.values.length;ethis.conf.values.length-1&&(i=this.conf.values.length-1),this.conf.range?(this.activePointer===this.pointerL&&(this.values.start=i),this.activePointer===this.pointerR&&(this.values.end=i)):this.values.end=i,this.setValues()}},t.prototype.drop=function(){this.activePointer=null},t.prototype.setValues=function(t,i){var e=this.conf.range?"start":"end";return t&&this.conf.values.indexOf(t)>-1&&(this.values[e]=this.conf.values.indexOf(t)),i&&this.conf.values.indexOf(i)>-1&&(this.values.end=this.conf.values.indexOf(i)),this.conf.range&&this.values.start>this.values.end&&(this.values.start=this.values.end),this.pointerL.style.left=this.values[e]*this.step-this.pointerWidth/2+"px",this.conf.range?(this.conf.tooltip&&(this.tipL.innerHTML=this.conf.values[this.values.start],this.tipR.innerHTML=this.conf.values[this.values.end]),this.input.value=this.conf.values[this.values.start]+","+this.conf.values[this.values.end],this.pointerR.style.left=this.values.end*this.step-this.pointerWidth/2+"px"):(this.conf.tooltip&&(this.tipL.innerHTML=this.conf.values[this.values.end]),this.input.value=this.conf.values[this.values.end]),this.values.end>this.conf.values.length-1&&(this.values.end=this.conf.values.length-1),this.values.start<0&&(this.values.start=0),this.selected.style.width=(this.values.end-this.values.start)*this.step+"px",this.selected.style.left=this.values.start*this.step+"px",this.onChange()},t.prototype.onClickPiece=function(t){if(!this.conf.disabled){var i=Math.round((t.clientX-this.sliderLeft)/this.step);return i>this.conf.values.length-1&&(i=this.conf.values.length-1),i<0&&(i=0),this.conf.range&&i-this.values.start<=this.values.end-i?this.values.start=i:this.values.end=i,this.slider.classList.remove("sliding"),this.setValues()}},t.prototype.onChange=function(){var t=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){if(t.conf.onChange&&"function"==typeof t.conf.onChange)return t.conf.onChange(t.input.value)},500)},t.prototype.onResize=function(){return this.sliderLeft=this.slider.getBoundingClientRect().left,this.sliderWidth=this.slider.clientWidth,this.updateScale()},t.prototype.disabled=function(t){this.conf.disabled=t,this.slider.classList[t?"add":"remove"]("disabled")},t.prototype.getValue=function(){return this.input.value},t.prototype.destroy=function(){this.input.style.display=this.inputDisplay,this.slider.remove()};var i=function(t,i,e){var s=document.createElement(t);return i&&(s.className=i),e&&2===e.length&&s.setAttribute("data-"+e[0],e[1]),s},e=function(t,i,e){for(var s=i.split(" "),n=0,l=s.length;n' +/usr/share/koala/bin/sass:22:in `load' +/usr/share/koala/bin/sass:22:in `
' +*/ +body:before { + white-space: pre; + font-family: monospace; + content: "Error: $color: \"var(--bs-primary-rgb)\" is not a color for `rgba'\A on line 41 of /home/raphy/NetBeansProjects/altogether_DEV/public/typo3conf/ext/bootstrap_package/Resources/Public/Contrib/bootstrap5/scss/_functions.scss\A from line 11 of /home/raphy/NetBeansProjects/altogether_DEV/public/typo3conf/ext/a2g_products/Resources/Public/Scss/a2gProductsList.scss"; } diff --git a/Resources/Public/Scss/a2gProductsList.scss b/Resources/Public/Scss/a2gProductsList.scss new file mode 100755 index 0000000..aa4f7b5 --- /dev/null +++ b/Resources/Public/Scss/a2gProductsList.scss @@ -0,0 +1,51 @@ +/* +To change this license header, choose License Headers in Project Properties. +To change this template file, choose Tools | Templates +and open the template in the editor. +*/ +/* + Created on : Aug 11, 2021, 11:24:31 AM + Author : Raphael Martin +*/ +@import "../../../../bootstrap_package/Resources/Public/Contrib/bootstrap5/scss/_functions.scss"; +@import "../../../../bootstrap_package/Resources/Public/Contrib/bootstrap5/scss/_variables.scss"; +@import "../../../../bootstrap_package/Resources/Public/Contrib/bootstrap5/scss/mixins"; + +.frame-background-secondary{ + .altogether-products{ + .btn-secondary{ + @include button-variant($primary, $primary); + color: $dark; + } + } +} + +.frame-background-primary{ + .altogether-products{ + .btn-primary{ + @include button-variant($secondary, $secondary); + color: $light; + } + } +} +.a2g-product-card-group-element-columns-2 { + @include media-breakpoint-up('md') { + --cardgroup-columns: 2; + } +} +.a2g-product-card-group-element-columns-3 { + @include media-breakpoint-up('md') { + --cardgroup-columns: 2; + } + @include media-breakpoint-up('lg') { + --cardgroup-columns: 3; + } +} +.a2g-product-card-group-element-columns-3-sm { + @include media-breakpoint-up('sm') { + --cardgroup-columns: 2; + } + @include media-breakpoint-up('lg') { + --cardgroup-columns: 3; + } +} \ No newline at end of file diff --git a/Resources/Public/Scss/rSlider.min.scss b/Resources/Public/Scss/rSlider.min.scss new file mode 100755 index 0000000..c5618bc --- /dev/null +++ b/Resources/Public/Scss/rSlider.min.scss @@ -0,0 +1 @@ +.rs-container *{box-sizing:border-box;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.rs-container{font-family:Arial,Helvetica,sans-serif;height:45px;position:relative}.rs-container .rs-bg,.rs-container .rs-selected{background-color:#eee;border:1px solid #ededed;height:10px;left:0;position:absolute;top:5px;width:100%;border-radius:3px}.rs-container .rs-selected{background-color:#00b3bc;border:1px solid #00969b;transition:all .2s linear;width:0}.rs-container.disabled .rs-selected{background-color:#ccc;border-color:#bbb}.rs-container .rs-pointer{background-color:#fff;border:1px solid #bbb;border-radius:4px;cursor:pointer;height:20px;left:-10px;position:absolute;top:0;transition:all .2s linear;width:30px;box-shadow:inset 0 0 1px #FFF,inset 0 1px 6px #ebebeb,1px 1px 4px rgba(0,0,0,.1)}.rs-container.disabled .rs-pointer{border-color:#ccc;cursor:default}.rs-container .rs-pointer::after,.rs-container .rs-pointer::before{content:'';position:absolute;width:1px;height:9px;background-color:#ddd;left:12px;top:5px}.rs-container .rs-pointer::after{left:auto;right:12px}.rs-container.sliding .rs-pointer,.rs-container.sliding .rs-selected{transition:none}.rs-container .rs-scale{left:0;position:absolute;top:5px;white-space:nowrap}.rs-container .rs-scale span{float:left;position:relative}.rs-container .rs-scale span::before{background-color:#ededed;content:"";height:8px;left:0;position:absolute;top:10px;width:1px}.rs-container.rs-noscale span::before{display:none}.rs-container.rs-noscale span:first-child::before,.rs-container.rs-noscale span:last-child::before{display:block}.rs-container .rs-scale span:last-child{margin-left:-1px;width:0}.rs-container .rs-scale span ins{color:#333;display:inline-block;font-size:12px;margin-top:20px;text-decoration:none}.rs-container.disabled .rs-scale span ins{color:#999}.rs-tooltip{color:#333;width:auto;min-width:60px;height:30px;background:#fff;border:1px solid #00969b;border-radius:3px;position:absolute;transform:translate(-50%,-35px);left:13px;text-align:center;font-size:13px;padding:6px 10px 0}.rs-container.disabled .rs-tooltip{border-color:#ccc;color:#999} \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100755 index 0000000..3e18786 --- /dev/null +++ b/composer.json @@ -0,0 +1,47 @@ +{ + "name": "altogether/a2g-products", + "type": "typo3-cms-extension", + "description": "", + "authors": [ + { + "name": "Raphael Martin", + "role": "Developer" + } + ], + "license": "GPL-2.0-or-later", + "require": { + "typo3/cms-core": "^10.4" + }, + "require-dev": { + "typo3/testing-framework": "^6.8" + }, + "autoload": { + "psr-4": { + "A2G\\A2gProducts\\": "Classes" + } + }, + "autoload-dev": { + "psr-4": { + "A2G\\A2gProducts\\Tests\\": "Tests" + } + }, + "replace": { + "typo3-ter/a2g-products": "self.version" + }, + "config": { + "vendor-dir": ".Build/vendor", + "bin-dir": ".Build/bin" + }, + "scripts": { + "post-autoload-dump": [ + "TYPO3\\TestingFramework\\Composer\\ExtensionTestEnvironment::prepare" + ] + }, + "extra": { + "typo3/cms": { + "cms-package-dir": "{$vendor-dir}/typo3/cms", + "web-dir": ".Build/public", + "extension-key": "a2g_products" + } + } +} \ No newline at end of file diff --git a/ext_emconf.php b/ext_emconf.php new file mode 100755 index 0000000..d36ef52 --- /dev/null +++ b/ext_emconf.php @@ -0,0 +1,30 @@ + 'altogether Products', + 'description' => '', + 'category' => 'plugin', + 'author' => 'Raphael Martin', + 'author_email' => 'raphy.martin@gmail.com', + 'state' => 'alpha', + 'clearCacheOnLoad' => 0, + 'version' => '1.0.0', + 'constraints' => [ + 'depends' => [ + 'typo3' => '10.4.0-12.1.99', + 'a2g_toolkit' => '1.0.1-1.5.99' + ], + 'conflicts' => [], + 'suggests' => [], + ], +]; diff --git a/ext_localconf.php b/ext_localconf.php new file mode 100755 index 0000000..dd25457 --- /dev/null +++ b/ext_localconf.php @@ -0,0 +1,131 @@ +'); + +call_user_func(static function() { + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'A2gProducts', + 'A2gproductslist', + [ + \A2G\A2gProducts\Controller\ProductsController::class => 'list, ajaxList, show' + ], + // non-cacheable actions + [ + \A2G\A2gProducts\Controller\ProductsController::class => '' + ] + ); + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'A2gProducts', + 'A2gproductsdetail', + [ + \A2G\A2gProducts\Controller\ProductsController::class => 'show' + ], + // non-cacheable actions + [ + \A2G\A2gProducts\Controller\ProductsController::class => '' + ] + ); + + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'A2gProducts', + 'Ingredientslist', + [ + \A2G\A2gProducts\Controller\IngredientsController::class => 'list, show' + ], + // non-cacheable actions + [ + \A2G\A2gProducts\Controller\IngredientsController::class => '' + ] + ); + \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( + 'A2gProducts', + 'Ingredientsdetail', + [ + \A2G\A2gProducts\Controller\IngredientsController::class => 'show' + ], + // non-cacheable actions + [ + \A2G\A2gProducts\Controller\IngredientsController::class => '' + ] + ); + + + // wizards + /* + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( + 'mod { + wizards.newContentElement.wizardItems.plugins { + elements { + a2gproductslist { + iconIdentifier = a2g_products-plugin-a2gproductslist + title = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_a2gproductslist.name + description = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_a2gproductslist.description + tt_content_defValues { + CType = list + list_type = a2gproducts_a2gproductslist + } + } + a2gproductsdetail { + iconIdentifier = a2g_products-plugin-a2gproductsdetail + title = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_a2gproductsdetail.name + description = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_a2gproductsdetail.description + tt_content_defValues { + CType = list + list_type = a2gproducts_a2gproductsdetail + } + } + ingredientslist { + iconIdentifier = a2g_products-plugin-ingredientslist + title = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_ingredientslist.name + description = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_ingredientslist.description + tt_content_defValues { + CType = list + list_type = a2gproducts_ingredientslist + } + } + ingredientsdetail { + iconIdentifier = a2g_products-plugin-ingredientsdetail + title = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_ingredientsdetail.name + description = LLL:EXT:a2g_products/Resources/Private/Language/locallang_db.xlf:tx_a2g_products_ingredientsdetail.description + tt_content_defValues { + CType = list + list_type = a2gproducts_ingredientsdetail + } + } + } + show = * + } + }' + ); + */ + + $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); + $iconRegistry->registerIcon( + 'a2g_products-plugin-a2gproductslist', + \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, + ['source' => 'EXT:a2g_products/Resources/Public/Icons/online-shopping.png'] + ); + $iconRegistry->registerIcon( + 'a2g_products-plugin-a2gproductsdetail', + \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, + ['source' => 'EXT:a2g_products/Resources/Public/Icons/online-shopping.png'] + ); + $iconRegistry->registerIcon( + 'a2g_products-plugin-ingredientslist', + \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, + ['source' => 'EXT:a2g_products/Resources/Public/Icons/natural-ingredients.png'] + ); + $iconRegistry->registerIcon( + 'a2g_products-plugin-ingredientsdetail', + \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, + ['source' => 'EXT:a2g_products/Resources/Public/Icons/natural-ingredients.png'] + ); +}); + +/*************** + * Register "a2g" as global fluid namespace + */ +$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['a2gprod'][] = 'A2G\\A2gProducts\\ViewHelpers'; diff --git a/ext_tables.php b/ext_tables.php new file mode 100755 index 0000000..63890e1 --- /dev/null +++ b/ext_tables.php @@ -0,0 +1,52 @@ + 'flexform_list', + 'a2gproducts_a2gproductsdetail' => 'flexform_detail', + 'a2gproducts_ingredientslist' => 'flexform_ingredients_list', + 'a2gproducts_ingredientsdetail' => 'flexform_ingredients_detail' +]; + +foreach ($pluginSignatures as $pluginSignature => $flexform) { + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:a2g_products/Configuration/FlexForms/' . $flexform . '.xml'); +} +/** + * COMPOSER - load in ext used composer stuff + */ +//$composerAutoloadFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('webx_gs_map') . 'Resources/Private/PHP/autoload.php'; +//require_once($composerAutoloadFile); + +/** + * SIGNAL SLOT - Canonical + */ +//$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class); +//$signalSlotDispatcher->connect( +// \TYPO3\CMS\Seo\Canonical\CanonicalGenerator::class, +// 'beforeGeneratingCanonical', +// \A2G\A2gProducts\Utility\CanonicalUtility::class, +// 'setCanonical' +//); diff --git a/ext_tables.sql b/ext_tables.sql new file mode 100755 index 0000000..255e41a --- /dev/null +++ b/ext_tables.sql @@ -0,0 +1,170 @@ +CREATE TABLE tx_a2gproducts_domain_model_brands ( + title varchar(120) NOT NULL DEFAULT '', + image int(11) unsigned NOT NULL DEFAULT '0', + page_uid int(11) unsigned NOT NULL DEFAULT '0' +); + +CREATE TABLE tx_a2gproducts_domain_model_products ( + nr varchar(80) NOT NULL DEFAULT '', + title varchar(120) NOT NULL DEFAULT '', + path_segment varchar(80) DEFAULT '' NOT NULL, + description text NOT NULL DEFAULT '', + description_html text NOT NULL DEFAULT '', + image int(11) unsigned NOT NULL DEFAULT '0', + images int(11) unsigned NOT NULL DEFAULT '0', + gallery int(11) unsigned NOT NULL DEFAULT '0', + seo_image1x1 int(11) unsigned NOT NULL DEFAULT '0', + seo_image4x3 int(11) unsigned NOT NULL DEFAULT '0', + seo_image16x9 int(11) unsigned NOT NULL DEFAULT '0', + rel_category int(11) unsigned NOT NULL DEFAULT '0', + rel_filter_values int(11) unsigned NOT NULL DEFAULT '0', + rel_selectableattribute int(11) unsigned NOT NULL DEFAULT '0', + rel_ingredients int(11) unsigned NOT NULL DEFAULT '0', + rel_productvariants int(11) unsigned NOT NULL DEFAULT '0', + rel_brand int(11) unsigned NOT NULL DEFAULT '0' +); + +CREATE TABLE tx_a2gproducts_domain_model_productvariants ( + nr varchar(80) NOT NULL DEFAULT '', + title varchar(120) NOT NULL DEFAULT '', + path_segment varchar(80) DEFAULT '' NOT NULL, + description text NOT NULL DEFAULT '', + description_html text NOT NULL DEFAULT '', + image int(11) unsigned NOT NULL DEFAULT '0', + images int(11) unsigned NOT NULL DEFAULT '0', + gallery int(11) unsigned NOT NULL DEFAULT '0', + seo_image1x1 int(11) unsigned NOT NULL DEFAULT '0', + seo_image4x3 int(11) unsigned NOT NULL DEFAULT '0', + seo_image16x9 int(11) unsigned NOT NULL DEFAULT '0', + rel_category int(11) unsigned NOT NULL DEFAULT '0', + rel_filter_values int(11) unsigned NOT NULL DEFAULT '0', + rel_selectableattribute int(11) unsigned NOT NULL DEFAULT '0', + rel_ingredients int(11) unsigned NOT NULL DEFAULT '0', + product int(11) unsigned NOT NULL DEFAULT '0', + rel_brand int(11) NOT NULL DEFAULT '0', + rel_sizes int(11) NOT NULL DEFAULT '0', + tab_icon int(11) unsigned NOT NULL DEFAULT '0' +); +CREATE TABLE tx_a2gproducts_domain_model_productvariantsizes ( + nr varchar(80) NOT NULL DEFAULT '', + title varchar(120) NOT NULL DEFAULT '', + path_segment varchar(80) DEFAULT '' NOT NULL, + description text NOT NULL DEFAULT '', + productvariant int(11) unsigned NOT NULL DEFAULT '0' +); + + +CREATE TABLE tx_a2gproducts_domain_model_categories ( + title varchar(80) NOT NULL DEFAULT '', + description varchar(255) NOT NULL DEFAULT '', + image int(11) unsigned NOT NULL DEFAULT '0', + rel_filters int(11) unsigned NOT NULL DEFAULT '0' +); + +CREATE TABLE tx_a2gproducts_domain_model_filters ( + title varchar(80) NOT NULL DEFAULT '', + filter_type int(11) NOT NULL DEFAULT '0', + filter_output_type int(11) NOT NULL DEFAULT '0', + db_operation_max int(11) NOT NULL DEFAULT '0', + db_operation_min int(11) NOT NULL DEFAULT '0', + rel_filter_option int(11) unsigned NOT NULL DEFAULT '0' +); + +CREATE TABLE tx_a2gproducts_domain_model_filteroptions ( + filters int(11) unsigned DEFAULT '0' NOT NULL, + title varchar(255) NOT NULL DEFAULT '', + value_min double(11,2) NOT NULL DEFAULT '0.00', + value_max double(11,2) NOT NULL DEFAULT '0.00' +); + +CREATE TABLE tx_a2gproducts_domain_model_filtervalues ( + products int(11) unsigned DEFAULT '0' NOT NULL, + productvariants int(11) unsigned DEFAULT '0' NOT NULL, + value double(11,2) NOT NULL DEFAULT '0.00', + rel_filters int(11) unsigned DEFAULT '0', + rel_filter_option int(11) unsigned DEFAULT '0' +); + +CREATE TABLE tx_a2gproducts_products_categories_mm ( + uid_local int(11) unsigned DEFAULT '0' NOT NULL, + uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, + sorting int(11) unsigned DEFAULT '0' NOT NULL, + sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, + + PRIMARY KEY (uid_local,uid_foreign), + KEY uid_local (uid_local), + KEY uid_foreign (uid_foreign) +); + +CREATE TABLE tx_a2gproducts_productvariants_categories_mm ( + uid_local int(11) unsigned DEFAULT '0' NOT NULL, + uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, + sorting int(11) unsigned DEFAULT '0' NOT NULL, + sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, + + PRIMARY KEY (uid_local,uid_foreign), + KEY uid_local (uid_local), + KEY uid_foreign (uid_foreign) +); + +CREATE TABLE tx_a2gproducts_categories_filters_mm ( + uid_local int(11) unsigned DEFAULT '0' NOT NULL, + uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, + sorting int(11) unsigned DEFAULT '0' NOT NULL, + sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, + + PRIMARY KEY (uid_local,uid_foreign), + KEY uid_local (uid_local), + KEY uid_foreign (uid_foreign) +); + +CREATE TABLE tx_a2gproducts_domain_model_ingredients( + title varchar(80) NOT NULL DEFAULT '', + path_segment varchar(80) DEFAULT '' NOT NULL, + description text NOT NULL DEFAULT '', + image int(11) unsigned NOT NULL DEFAULT '0', + images int(11) unsigned NOT NULL DEFAULT '0', + gallery int(11) unsigned NOT NULL DEFAULT '0', + rel_products int(11) unsigned NOT NULL DEFAULT '0', + rel_productvariants int(11) unsigned NOT NULL DEFAULT '0' +); + +CREATE TABLE tx_a2gproducts_products_ingredients_mm ( + uid_local int(11) unsigned DEFAULT '0' NOT NULL, + uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, + sorting int(11) unsigned DEFAULT '0' NOT NULL, + sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, + + PRIMARY KEY (uid_local,uid_foreign), + KEY uid_local (uid_local), + KEY uid_foreign (uid_foreign) +); + +CREATE TABLE tx_a2gproducts_productvarinats_ingredients_mm ( + uid_local int(11) unsigned DEFAULT '0' NOT NULL, + uid_foreign int(11) unsigned DEFAULT '0' NOT NULL, + sorting int(11) unsigned DEFAULT '0' NOT NULL, + sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL, + + PRIMARY KEY (uid_local,uid_foreign), + KEY uid_local (uid_local), + KEY uid_foreign (uid_foreign) +); + +CREATE TABLE sys_file ( + images int(11) unsigned DEFAULT '0' NOT NULL +); + +CREATE TABLE tx_a2gtoolkit_masonry_item ( + a2g_ingredients int(11) unsigned DEFAULT '0' NOT NULL, + a2g_products int(11) unsigned DEFAULT '0' NOT NULL, + a2g_productvariants int(11) unsigned DEFAULT '0' NOT NULL, +); + +CREATE TABLE tx_a2gproducts_domain_model_selectableattribute ( + products int(11) unsigned DEFAULT '0' NOT NULL, + productvariants int(11) unsigned DEFAULT '0' NOT NULL, + rel_filters int(11) unsigned DEFAULT '0', + rel_filter_option int(11) unsigned DEFAULT '0', + title varchar(80) DEFAULT '' NOT NULL, +); \ No newline at end of file