-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e8328a6
Showing
78 changed files
with
4,945 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/.idea/ | ||
/generated/ | ||
/var/ | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2014-2024 Softwareentwicklung Andreas Knollmann | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Infrangible Catalog Attribute Landing Page | ||
|
||
## Introduction | ||
|
||
This module adds the possibility to define an attribute based landing pages. | ||
|
||
## License | ||
|
||
Infrangible Catalog Attribute Landing Page is licensed under the MIT License - see the LICENSE file for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"require": [ | ||
"webserver_php_magento-module-demo.json", | ||
"database_magento2-module-demo.json", | ||
"elasticsearch_magento-module-demo.json", | ||
"mailcatcher_magento.json", | ||
"magento2-module-demo.json" | ||
], | ||
"global": { | ||
"systemName": "infrangible_m2_catalog_attribute-landing-page" | ||
}, | ||
"ws": { | ||
"webServerType": "apache_php", | ||
"webServerVersion": "2.4", | ||
"phpVersion": "8.2", | ||
"containerVolumes": [ | ||
"../src:/var/www/magento/htdocs/app/code/Infrangible/CatalogAttributeLandingPage:www-data" | ||
] | ||
}, | ||
"db": { | ||
"databaseType": "mysql", | ||
"databaseVersion": "5.7" | ||
}, | ||
"es": { | ||
"elasticsearchVersion": "7.9" | ||
}, | ||
"mc": { | ||
"mailCatcherVersion": "0.6" | ||
}, | ||
"ms": { | ||
"magentoVersion": "2.4.6-p3", | ||
"magentoEdition": "community" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "infrangible/m2-catalog-attribute-landing-page", | ||
"description": "Infrangible Magento 2 Catalog Attribute Landing Page", | ||
"type": "magento2-module", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"keywords": [ | ||
"Magento" | ||
], | ||
"homepage": "https://github.com/infrangible-dev/m2-catalog-attribute-landing-page", | ||
"authors": [ | ||
{ | ||
"name": "Andreas Knollmann", | ||
"email": "a.knollmann@seak.dev", | ||
"homepage": "https://www.seak.dev", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": ">=7.1", | ||
"magento/framework": "~102.0.0|~103.0.0", | ||
"infrangible/m2-backend-widget": "~2.0", | ||
"fewedev/base": ">=1.4.0" | ||
}, | ||
"autoload": { | ||
"files": [ | ||
"src/registration.php" | ||
], | ||
"psr-4": { | ||
"Infrangible\\CatalogAttributeLandingPage\\": "src" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Infrangible\CatalogAttributeLandingPage\Block\Adminhtml\Group; | ||
|
||
use Exception; | ||
|
||
/** | ||
* @author Andreas Knollmann | ||
* @copyright 2014-2024 Softwareentwicklung Andreas Knollmann | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT | ||
*/ | ||
class Form | ||
extends \Infrangible\BackendWidget\Block\Form | ||
{ | ||
/** | ||
* @param \Magento\Framework\Data\Form $form | ||
* | ||
* @throws Exception | ||
*/ | ||
protected function prepareFields(\Magento\Framework\Data\Form $form) | ||
{ | ||
$fieldSet = $form->addFieldset('general', ['legend' => __('General')]); | ||
|
||
$this->addTextField($fieldSet, 'url_key', __('Url Key')->render(), true); | ||
$this->addTextField($fieldSet, 'headline', __('Headline')->render(), true); | ||
$this->addTextareaField($fieldSet, 'description', __('Description')->render()); | ||
$this->addCmsBlockSelectField($fieldSet, 'cms_block_id'); | ||
|
||
$fieldSet = $form->addFieldset('attribute', ['legend' => __('Attribute')]); | ||
|
||
$this->addEavAttributeField($fieldSet, 'attribute_id1', __('Attribute #1')->render(), true); | ||
$this->addEavAttributeField($fieldSet, 'attribute_id2', __('Attribute #2')->render()); | ||
$this->addEavAttributeField($fieldSet, 'attribute_id3', __('Attribute #3')->render()); | ||
$this->addEavAttributeField($fieldSet, 'attribute_id4', __('Attribute #4')->render()); | ||
$this->addEavAttributeField($fieldSet, 'attribute_id5', __('Attribute #5')->render()); | ||
|
||
$fieldSet = $form->addFieldset('availability', ['legend' => __('Availability')]); | ||
|
||
$this->addStoreMultiselectField($fieldSet, 'store_ids'); | ||
$this->addYesNoField($fieldSet, 'active', __('Active')->render()); | ||
|
||
$fieldSet = $form->addFieldset('seo', ['legend' => __('SEO')]); | ||
|
||
$this->addTextField($fieldSet, 'page_title', __('Page Title')->render()); | ||
$this->addTextareaField($fieldSet, 'meta_description', __('Meta Description')->render()); | ||
$this->addTextareaField($fieldSet, 'meta_keywords', __('Meta Keywords')->render()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Infrangible\CatalogAttributeLandingPage\Block\Adminhtml\Group; | ||
|
||
use Exception; | ||
use Magento\Framework\Data\Collection\AbstractDb; | ||
|
||
/** | ||
* @author Andreas Knollmann | ||
* @copyright 2014-2024 Softwareentwicklung Andreas Knollmann | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT | ||
*/ | ||
class Grid | ||
extends \Infrangible\BackendWidget\Block\Grid | ||
{ | ||
protected function prepareCollection(AbstractDb $collection): void | ||
{ | ||
} | ||
|
||
/** | ||
* @throws Exception | ||
*/ | ||
protected function prepareFields(): void | ||
{ | ||
$this->addTextColumn('url_key', __('Url Key')->render()); | ||
$this->addTextColumn('headline', __('Headline')->render()); | ||
$this->addEavAttributeColumn('attribute_id1', __('Attribute #1')->render()); | ||
$this->addEavAttributeColumn('attribute_id2', __('Attribute #2')->render()); | ||
$this->addEavAttributeColumn('attribute_id3', __('Attribute #3')->render()); | ||
$this->addEavAttributeColumn('attribute_id4', __('Attribute #4')->render()); | ||
$this->addEavAttributeColumn('attribute_id5', __('Attribute #5')->render()); | ||
$this->addYesNoColumn('active', __('Active')->render()); | ||
$this->addStoreStructureColumn('store_ids'); | ||
$this->addDatetimeColumn('created_at', __('Created At')->render()); | ||
$this->addDatetimeColumn('updated_at', __('Updated At')->render()); | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getHiddenFieldNames(): array | ||
{ | ||
return ['attribute_id2', 'attribute_id3', 'attribute_id4', 'attribute_id5']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php /** @noinspection PhpDeprecationInspection */ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Infrangible\CatalogAttributeLandingPage\Block\Adminhtml\Page; | ||
|
||
use Exception; | ||
|
||
/** | ||
* @author Andreas Knollmann | ||
* @copyright 2014-2024 Softwareentwicklung Andreas Knollmann | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT | ||
*/ | ||
class Form | ||
extends \Infrangible\BackendWidget\Block\Form | ||
{ | ||
/** | ||
* @throws Exception | ||
*/ | ||
protected function prepareFields(\Magento\Framework\Data\Form $form): void | ||
{ | ||
$fieldSet = $form->addFieldset('general', ['legend' => __('General')]); | ||
|
||
$this->addTextField($fieldSet, 'url_key', __('Url Key')->render(), true); | ||
$this->addTextField($fieldSet, 'headline', __('Headline')->render(), true); | ||
$this->addTextareaField($fieldSet, 'description', __('Description')->render()); | ||
$this->addCmsBlockSelectField($fieldSet, 'cms_block_id'); | ||
$this->addCmsBlockSelectField($fieldSet, 'additional_cms_block_id', __('Additional Block')->render()); | ||
$this->addCmsBlockSelectField($fieldSet, 'seo_cms_block_id', __('SEO Block')->render()); | ||
$this->addWysiwygField($fieldSet, 'image', __('Image')->render()); | ||
$this->addWysiwygField($fieldSet, 'logo', __('Logo')->render()); | ||
$this->addWysiwygField($fieldSet, 'thumbnail', __('Thumbnail')->render()); | ||
|
||
$fieldSet = $form->addFieldset('attribute1', ['legend' => __('Attribute #1')]); | ||
|
||
$this->addEavAttributeFieldWithUpdate($fieldSet, 'attribute_id1', __('Attribute')->render(), ['value1'], true, | ||
true); | ||
$this->addEavAttributeValueField( | ||
$fieldSet, 'attribute_id1', 'value1', __('Attribute Value')->render(), true, true); | ||
|
||
$fieldSet = $form->addFieldset('attribute2', ['legend' => __('Attribute #2')]); | ||
|
||
$this->addEavAttributeFieldWithUpdate($fieldSet, 'attribute_id2', __('Attribute')->render(), ['value2']); | ||
$this->addEavAttributeValueField($fieldSet, 'attribute_id2', 'value2', __('Attribute Value')->render()); | ||
|
||
$fieldSet = $form->addFieldset('attribute3', ['legend' => __('Attribute #3')]); | ||
|
||
$this->addEavAttributeFieldWithUpdate($fieldSet, 'attribute_id3', __('Attribute')->render(), ['value3']); | ||
$this->addEavAttributeValueField($fieldSet, 'attribute_id3', 'value3', __('Attribute Value')->render()); | ||
|
||
$fieldSet = $form->addFieldset('attribute4', ['legend' => __('Attribute #4')]); | ||
|
||
$this->addEavAttributeFieldWithUpdate($fieldSet, 'attribute_id4', __('Attribute')->render(), ['value4']); | ||
$this->addEavAttributeValueField($fieldSet, 'attribute_id4', 'value4', __('Attribute Value')->render()); | ||
|
||
$fieldSet = $form->addFieldset('attribute5', ['legend' => __('Attribute #5')]); | ||
|
||
$this->addEavAttributeFieldWithUpdate($fieldSet, 'attribute_id5', __('Attribute')->render(), ['value5']); | ||
$this->addEavAttributeValueField($fieldSet, 'attribute_id5', 'value5', __('Attribute Value')->render()); | ||
|
||
$fieldSet = $form->addFieldset('attribute_set', ['legend' => __('Attribute Set')]); | ||
|
||
$this->addEavAttributeSetField($fieldSet, 'attribute_set_id', __('Attribute Set')->render()); | ||
|
||
$fieldSet = $form->addFieldset('order', ['legend' => __('Attribute Order')]); | ||
|
||
$this->addAttributeSortByField( | ||
$fieldSet, 'attribute_orders', __('Available Attributes')->render(), false, true); | ||
$this->addAttributeSortByField($fieldSet, 'attribute_order', __('Attribute')->render()); | ||
|
||
$attributeOrderDirection = [ | ||
['value' => '', 'label' => '-- Please select --'], | ||
['value' => 'asc', 'label' => 'Ascending'], | ||
['value' => 'desc', 'label' => 'Descending']]; | ||
|
||
$this->addOptionsField( | ||
$fieldSet, 'attribute_order_direction', __('Direction')->render(), $attributeOrderDirection, ''); | ||
|
||
$fieldSet = $form->addFieldset('availability', ['legend' => __('Availability')]); | ||
|
||
$this->addStoreMultiselectField($fieldSet, 'store_ids'); | ||
$this->addYesNoField($fieldSet, 'active', __('Active')->render()); | ||
$this->addYesNoField($fieldSet, 'check_active', __('Check Active')->render()); | ||
|
||
$fieldSet = $form->addFieldset('seo', ['legend' => __('SEO')]); | ||
|
||
$this->addTextField($fieldSet, 'page_title', __('Page Title')->render()); | ||
$this->addTextareaField($fieldSet, 'meta_description', __('Meta Description')->render()); | ||
$this->addTextareaField($fieldSet, 'meta_keywords', __('Meta Keywords')->render()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Infrangible\CatalogAttributeLandingPage\Block\Adminhtml\Page; | ||
|
||
use Exception; | ||
use Magento\Framework\Data\Collection\AbstractDb; | ||
|
||
/** | ||
* @author Andreas Knollmann | ||
* @copyright 2014-2024 Softwareentwicklung Andreas Knollmann | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT | ||
*/ | ||
class Grid | ||
extends \Infrangible\BackendWidget\Block\Grid | ||
{ | ||
protected function prepareCollection(AbstractDb $collection): void | ||
{ | ||
} | ||
|
||
/** | ||
* @throws Exception | ||
*/ | ||
protected function prepareFields(): void | ||
{ | ||
$this->addTextColumn('url_key', __('Url Key')->render()); | ||
$this->addTextColumn('headline', __('Headline')->render()); | ||
$this->addEavAttributeColumn('attribute_id1', __('Attribute #1')->render()); | ||
$this->addEavAttributeValueColumn('value1', 'attribute_id1', __('Value #1')->render(), true); | ||
$this->addEavAttributeColumn('attribute_id2', __('Attribute #2')->render()); | ||
$this->addEavAttributeValueColumn('value2', 'attribute_id2', __('Value #2')->render(), true); | ||
$this->addEavAttributeColumn('attribute_id3', __('Attribute #3')->render()); | ||
$this->addEavAttributeValueColumn('value3', 'attribute_id3', __('Value #3')->render(), true); | ||
$this->addEavAttributeColumn('attribute_id4', __('Attribute #4')->render()); | ||
$this->addEavAttributeValueColumn('value4', 'attribute_id4', __('Value #4')->render(), true); | ||
$this->addEavAttributeColumn('attribute_id5', __('Attribute #5')->render()); | ||
$this->addEavAttributeValueColumn('value5', 'attribute_id5', __('Value #5')->render(), true); | ||
$this->addEavAttributeSetColumn('attribute_set_id', __('Attribute Set')->render()); | ||
$this->addYesNoColumn('active', __('Active')->render()); | ||
$this->addStoreStructureColumn('store_ids'); | ||
$this->addDatetimeColumn('created_at', __('Created At')->render()); | ||
$this->addDatetimeColumn('updated_at', __('Updated At')->render()); | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getHiddenFieldNames(): array | ||
{ | ||
return [ | ||
'attribute_id2', | ||
'value2', | ||
'attribute_id3', | ||
'value3', | ||
'attribute_id4', | ||
'value4', | ||
'attribute_id5', | ||
'value5' | ||
]; | ||
} | ||
} |
Oops, something went wrong.