diff --git a/app/code/Kai/Banner.zip b/app/code/Kai/Banner.zip new file mode 100755 index 00000000..0a484283 Binary files /dev/null and b/app/code/Kai/Banner.zip differ diff --git a/app/code/Kai/Banner/Api/BannerRepository.php b/app/code/Kai/Banner/Api/BannerRepository.php new file mode 100755 index 00000000..9b52ab45 --- /dev/null +++ b/app/code/Kai/Banner/Api/BannerRepository.php @@ -0,0 +1,177 @@ +kaiBannerModel = $kaiBannerModel; + $this->kaiBannerResourceModel = $kaiBannerResourceModel; + $this->kaiBannerCollection = $kaiBannerCollection; + $this->authorization(); + } + + private function authorization() + { + $headers = apache_request_headers(); + $apiKey = \Kai\Banner\Api\Helper::API_KEY; + + foreach ($headers as $key => $value) { + $key = strtolower($key); + if ('api_key' === $key && $value === $apiKey) { + return true; + } + } + + header('HTTP/1.1 401 Unauthorized'); + header('Accept: application/json'); + header('Content-Type: application/json'); + die( + json_encode(['message' => 'unauthorized']) + ); + } + + private function responseOk(array $data) + { + header('HTTP/1.1 200 Ok'); + header('Accept: application/json'); + header('Content-Type: application/json'); + die(json_encode($data)); + } + + private function responseFail(array $data) + { + header('HTTP/1.1 400 Bad request'); + header('Accept: application/json'); + header('Content-Type: application/json'); + die(json_encode($data)); + } + + private function responseMethodFail() + { + header('HTTP/1.1 400 bad request'); + header('Accept: application/json'); + header('Content-Type: application/json'); + die(json_encode([ + 'status' => false, + 'message' => 'Param ?method=... not exist!' + ])); + } + + public function getData() + { + $method = $_GET['method'] ?? null; + + if ($method === 'show') { + $id = $_GET['id'] ?? 0; + return $this->responseOk([ + 'status' => true, + 'data' => $this + ->kaiBannerCollection + ->getItemById($id) + ->getData() + ]); + } + + if ($method === 'all') { + return $this->responseOk([ + 'status' => true, + 'data' => $this + ->kaiBannerCollection + ->getData() + ]); + } + + if ($method === 'delete') { + $id = $_GET['id'] ?? 0; + $model = $this->kaiBannerModel->setId($id); + + try { + $this->kaiBannerResourceModel->delete($model); + return $this->responseOk([ + 'status' => true, + ]); + } catch (\Exception $ex) { + $this->kaiBannerResourceModel->rollBack(); + return $this->responseFail([ + 'status' => false, + 'message' => $ex->getMessage() + ]); + } + } + + return $this->responseMethodFail(); + } + + public function postData() + { + $method = $_GET['method'] ?? null; + parse_str( + string: file_get_contents('php://input'), + result: $payload + ); + + if ($method === 'create') { + $model = $this->kaiBannerModel; + try { + foreach ($payload as $key => $value) { + $model->setData($key, $value); + } + $this->kaiBannerResourceModel->save($model); + + return $this->responseOk([ + 'status' => true, + 'data' => $this + ->kaiBannerCollection + ->getItemById($model->getId()) + ->getData() + ]); + } catch (\Exception $ex) { + return $this->responseFail([ + 'status' => false, + 'message' => $ex->getMessage() + ]); + } + } + + if ($method === 'update') { + $id = $_GET['id'] ?? 0; + $model = $this->kaiBannerModel->setId($id); + + try { + foreach ($payload as $key => $value) { + $model->setData($key, $value); + } + $this->kaiBannerResourceModel->save($model); + + return $this->responseOk([ + 'status' => true, + 'data' => $this + ->kaiBannerCollection + ->getItemById($model->getId()) + ->getData() + ]); + } catch (\Exception $ex) { + return $this->responseFail([ + 'status' => false, + 'message' => $ex->getMessage() + ]); + } + } + + return $this->responseMethodFail(); + } +} diff --git a/app/code/Kai/Banner/Api/BannerRepositoryInterface.php b/app/code/Kai/Banner/Api/BannerRepositoryInterface.php new file mode 100755 index 00000000..bfb34914 --- /dev/null +++ b/app/code/Kai/Banner/Api/BannerRepositoryInterface.php @@ -0,0 +1,23 @@ +urlInterface = $urlInterface; + $this->kaiBanner = $kaiBanner; + $this->kaiBannerResourceModel = $kaiBannerResourceModel; + $this->kaiBannerCollection = $kaiBannerCollection; + parent::__construct($context, $data); + } + + public function getSecretKey() + { + return $this->urlInterface->getSecretKey(); + } + + public function getApiKey() + { + return \Kai\Banner\Api\Helper::API_KEY; + } + + public function getAll() + { + return $this->kaiBannerCollection->getData(); + } +} diff --git a/app/code/Kai/Banner/Controller/Adminhtml/Index/Index.php b/app/code/Kai/Banner/Controller/Adminhtml/Index/Index.php new file mode 100755 index 00000000..f194e530 --- /dev/null +++ b/app/code/Kai/Banner/Controller/Adminhtml/Index/Index.php @@ -0,0 +1,24 @@ +resultPageFactory = $resultPageFactory; + parent::__construct($context); + } + + public function execute() + { + $resultPage = $this->resultPageFactory->create(); + $resultPage->getConfig()->getTitle()->prepend(__('Banner')); + return $resultPage; + } +} diff --git a/app/code/Kai/Banner/Model/KaiBanner.php b/app/code/Kai/Banner/Model/KaiBanner.php new file mode 100755 index 00000000..ecbc2642 --- /dev/null +++ b/app/code/Kai/Banner/Model/KaiBanner.php @@ -0,0 +1,36 @@ +_init( + resourceModel: KaiBannerResourceModel::class + ); + } + +} + +final class KaiBannerFactory extends Factory +{ + protected $objectManager; + protected $instanceName; + + public function __construct(ObjectManagerInterface $objectManager, $instanceName = KaiBanner::class) + { + $this->objectManager = $objectManager; + $this->instanceName = $instanceName; + } + + public function create(array $arguments = [], AbstractDb $resource = null) + { + return $this->objectManager->create($this->instanceName, $arguments, $resource); + } +} diff --git a/app/code/Kai/Banner/Model/KaiBannerCollection.php b/app/code/Kai/Banner/Model/KaiBannerCollection.php new file mode 100755 index 00000000..41e6233e --- /dev/null +++ b/app/code/Kai/Banner/Model/KaiBannerCollection.php @@ -0,0 +1,17 @@ +_init( + model: KaiBanner::class, + resourceModel: KaiBannerResourceModel::class + ); + } +} diff --git a/app/code/Kai/Banner/Model/KaiBannerResourceModel.php b/app/code/Kai/Banner/Model/KaiBannerResourceModel.php new file mode 100755 index 00000000..b7e22a14 --- /dev/null +++ b/app/code/Kai/Banner/Model/KaiBannerResourceModel.php @@ -0,0 +1,15 @@ +_init( + mainTable:'kai_banner', + idFieldName:'id' + ); + } +} diff --git a/app/code/Kai/Banner/Model/KaiBannerValues.php b/app/code/Kai/Banner/Model/KaiBannerValues.php new file mode 100755 index 00000000..7073f97e --- /dev/null +++ b/app/code/Kai/Banner/Model/KaiBannerValues.php @@ -0,0 +1,64 @@ +collection = $collection; + } + + public function getAllOptions() + { + $data = $this->collection->getData(); + $options = [ + [ + 'label' => 'Select option!', + 'value' => '', + ] + ]; + + foreach ($data as $record) { + $options[] = [ + 'label' => $record['id'], + 'value' => $record['title'], + ]; + }; + + $this->_options = $options; + return $options; + } + + public function getOptionText($value) + { + foreach ($this->getAllOptions() as $option) { + if ($option['value'] == $value) { + return $option['label']; + } + } + return false; + } + + public function getFlatColumns() + { + $attributeCode = $this->getAttribute()->getAttributeCode(); + return [ + $attributeCode => [ + 'unsigned' => false, + 'default' => null, + 'extra' => null, + 'type' => Table::TYPE_INTEGER, + 'nullable' => true, + 'comment' => 'Kai Banner ' . $attributeCode . ' column', + ], + ]; + } +} diff --git a/app/code/Kai/Banner/Model/Serialize/Serializer/Json.php b/app/code/Kai/Banner/Model/Serialize/Serializer/Json.php new file mode 100755 index 00000000..9af00dd5 --- /dev/null +++ b/app/code/Kai/Banner/Model/Serialize/Serializer/Json.php @@ -0,0 +1,36 @@ +_eavSetupFactory = $eavSetupFactory; + $this->_attributeRepositoryInterface = $attributeRepositoryInterface; + $this->_attributeSetupFactory = $attributeSetupFactory; + } + + public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + { + try { + $this->_attributeRepositoryInterface->get(Product::ENTITY, 'kai_banner'); + } catch (\Exception $ex) { + + $setup->startSetup(); + $eavSetup = $this->_eavSetupFactory->create(['setup' => $setup]); + $eavSetup->addAttribute( + Product::ENTITY, + 'kai_banner', + [ + 'input' => 'select', + 'type' => 'varchar', + 'label' => 'Banner', + 'required' => false, + 'visible' => true, + 'user_defined' => true, + 'searchable' => false, + 'filterable' => false, + 'comparable' => false, + 'used_in_product_listing' => true, + 'apply_to' => '', + 'source' => \Kai\Banner\Model\KaiBannerValues::class, + 'global' => ScopedAttributeInterface::SCOPE_GLOBAL, + 'group' => 'General', + ] + ); + $setup->endSetup(); + } + } +} diff --git a/app/code/Kai/Banner/Setup/UpgradeSchema.php b/app/code/Kai/Banner/Setup/UpgradeSchema.php new file mode 100755 index 00000000..414a018b --- /dev/null +++ b/app/code/Kai/Banner/Setup/UpgradeSchema.php @@ -0,0 +1,94 @@ +startSetup(); + + $tableName = $installer->getTable('kai_banner'); + + if ($installer->tableExists($tableName)) { + $installer->getConnection()->dropTable($tableName); + } + + $table = $installer->getConnection() + ->newTable($tableName) + ->addColumn( + 'id', + Table::TYPE_INTEGER, + null, + [ + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ], + 'ID' + ) + ->addColumn( + 'title', + Table::TYPE_TEXT, + null, + ['nullable' => false, 'default' => ''], + 'Title' + ) + ->addColumn( + 'html', + Table::TYPE_TEXT, + null, + ['nullable' => true, 'default' => ''], + 'htmlentities($str)' + ) + ->addColumn( + 'redirect', + Table::TYPE_TEXT, + null, + ['nullable' => true, 'default' => ''], + 'URL redirect' + ) + ->addColumn( + 'created_at', + Table::TYPE_TIMESTAMP, + null, + [ + 'nullable' => true, + 'default' => Table::TIMESTAMP_INIT, + ], + 'Created At' + ) + ->addColumn( + 'updated_at', + Table::TYPE_TIMESTAMP, + null, + [ + 'nullable' => true, + 'default' => Table::TIMESTAMP_INIT_UPDATE, + ], + 'Updated At' + ) + ->addColumn( + 'status', + Table::TYPE_SMALLINT, + null, + [ + 'nullable' => false, + 'default' => '0', + ], + 'Status' + )->setComment('Kai Banner Module'); + $installer->getConnection()->createTable($table); + $installer->endSetup(); + } +} diff --git a/app/code/Kai/Banner/etc/adminhtml/acl.xml b/app/code/Kai/Banner/etc/adminhtml/acl.xml new file mode 100755 index 00000000..7d4c29d1 --- /dev/null +++ b/app/code/Kai/Banner/etc/adminhtml/acl.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/app/code/Kai/Banner/etc/adminhtml/menu.xml b/app/code/Kai/Banner/etc/adminhtml/menu.xml new file mode 100755 index 00000000..0ac5d9fc --- /dev/null +++ b/app/code/Kai/Banner/etc/adminhtml/menu.xml @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/app/code/Kai/Banner/etc/adminhtml/routes.xml b/app/code/Kai/Banner/etc/adminhtml/routes.xml new file mode 100755 index 00000000..f77e81e8 --- /dev/null +++ b/app/code/Kai/Banner/etc/adminhtml/routes.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/app/code/Kai/Banner/etc/di.xml b/app/code/Kai/Banner/etc/di.xml new file mode 100755 index 00000000..445bac41 --- /dev/null +++ b/app/code/Kai/Banner/etc/di.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/app/code/Kai/Banner/etc/module.xml b/app/code/Kai/Banner/etc/module.xml new file mode 100755 index 00000000..484439d5 --- /dev/null +++ b/app/code/Kai/Banner/etc/module.xml @@ -0,0 +1,4 @@ + + + + diff --git a/app/code/Kai/Banner/etc/webapi.xml b/app/code/Kai/Banner/etc/webapi.xml new file mode 100755 index 00000000..8a2be1d5 --- /dev/null +++ b/app/code/Kai/Banner/etc/webapi.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/app/code/Kai/Banner/registration.php b/app/code/Kai/Banner/registration.php new file mode 100755 index 00000000..e2330539 --- /dev/null +++ b/app/code/Kai/Banner/registration.php @@ -0,0 +1,6 @@ + + + + + + + + diff --git a/app/code/Kai/Banner/view/adminhtml/templates/index.phtml b/app/code/Kai/Banner/view/adminhtml/templates/index.phtml new file mode 100755 index 00000000..fc6859b2 --- /dev/null +++ b/app/code/Kai/Banner/view/adminhtml/templates/index.phtml @@ -0,0 +1,299 @@ + "ID", + "name" => "id", + "type" => "text", + "hidden" => false, + "disabled" => true, + ], + [ + "label" => "Title", + "name" => "title", + "type" => "text", + "hidden" => false, + "disabled" => false, + ], + [ + "label" => "HTML", + "name" => "html", + "type" => "textarea", + "hidden" => false, + "disabled" => false, + ], + [ + "label" => "Redirect", + + "name" => "redirect", + "type" => "text", + "hidden" => false, + "disabled" => false, + ], + [ + "label" => "Created At", + "name" => "created_at", + "type" => "text", + "hidden" => false, + "disabled" => true, + ], + [ + "label" => "Updated At", + "name" => "updated_at", + "type" => "text", + "hidden" => false, + "disabled" => true, + ], + [ + "label" => "Status", + "name" => "status", + "type" => "text", + "hidden" => false, + "disabled" => true, + ], + [ + "label" => "Operation", + "type" => "text", + "hidden" => true, + "disabled" => true, + ], +]; +?> + + + + +
+ + + + + + + + + + + + + getAll() as $row): ?> + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + +
+
+
+ + + + + + diff --git a/app/code/Kai/Banner/view/frontend/layout/default.xml b/app/code/Kai/Banner/view/frontend/layout/default.xml new file mode 100755 index 00000000..a152e50c --- /dev/null +++ b/app/code/Kai/Banner/view/frontend/layout/default.xml @@ -0,0 +1,13 @@ + + + + + + + Kai - Banner + kai/banner/index + + + + + diff --git a/app/code/Kai/Helloworld/Controller/Index/Index.php b/app/code/Kai/Helloworld/Controller/Index/Index.php new file mode 100755 index 00000000..513165a5 --- /dev/null +++ b/app/code/Kai/Helloworld/Controller/Index/Index.php @@ -0,0 +1,23 @@ +resultPageFactory = $resultPageFactory; + } + + public function execute() + { + $resultPage = $this->resultPageFactory->create(); + return $resultPage; + } +} diff --git a/app/code/Kai/Helloworld/etc/module.xml b/app/code/Kai/Helloworld/etc/module.xml new file mode 100755 index 00000000..b724a917 --- /dev/null +++ b/app/code/Kai/Helloworld/etc/module.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/app/code/Kai/Helloworld/registration.php b/app/code/Kai/Helloworld/registration.php new file mode 100755 index 00000000..a3d13bb5 --- /dev/null +++ b/app/code/Kai/Helloworld/registration.php @@ -0,0 +1,6 @@ + + + + + + + + + diff --git a/app/code/Kai/Helloworld/view/frontend/layout/module_index_index.xml b/app/code/Kai/Helloworld/view/frontend/layout/module_index_index.xml new file mode 100755 index 00000000..c1198019 --- /dev/null +++ b/app/code/Kai/Helloworld/view/frontend/layout/module_index_index.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/app/code/Kai/Helloworld/view/frontend/templates/module_index_index.phtml b/app/code/Kai/Helloworld/view/frontend/templates/module_index_index.phtml new file mode 100755 index 00000000..93190772 --- /dev/null +++ b/app/code/Kai/Helloworld/view/frontend/templates/module_index_index.phtml @@ -0,0 +1 @@ +

Hello from Kai_Helloworld!

diff --git a/app/code/Kai/Product/Block/Custom.php b/app/code/Kai/Product/Block/Custom.php new file mode 100755 index 00000000..b221902a --- /dev/null +++ b/app/code/Kai/Product/Block/Custom.php @@ -0,0 +1,27 @@ +registry = $registry; + } + + public function getCustomAttribute() + { + $product = $this->registry->registry('current_product'); + // Replace 'your_custom_attribute_code' with your actual attribute code + return $product->getData('kai_attribute'); + } +} diff --git a/app/code/Kai/Product/Block/Product/View/CustomTab.php b/app/code/Kai/Product/Block/Product/View/CustomTab.php new file mode 100755 index 00000000..1fc12790 --- /dev/null +++ b/app/code/Kai/Product/Block/Product/View/CustomTab.php @@ -0,0 +1,59 @@ +getLayout() + ->createBlock("Magento\Framework\View\Element\Template") + ->setTemplate("Kai_Product::product/view/header.phtml") + ->toHtml(); + } + + public function getProductName() + { + $product = $this->getProduct(); + if ($product) { + $product->getName(); + } + return $product; + } + + public function getImage() + { + $product = $this->getProduct(); + + if ($product) { + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $helperImport = $objectManager->get('\Magento\Catalog\Helper\Image'); + + $imageUrl = $helperImport->init($product, 'product_page_image_small') + ->setImageFile($product->getSmallImage()) // image,small_image,thumbnail + ->resize(380) + ->getUrl(); + return $imageUrl; + } + return null; + } + + public function getPrice() + { + $product = $this->getProduct(); + if ($product) { + return $product->getFormattedPrice(); + } + return null; + } + + public function getCustomAttribute() + { + $product = $this->getProduct(); + // Replace 'your_custom_attribute_code' with your actual attribute code + return $product->getData('kai_attribute'); + } +} diff --git a/app/code/Kai/Product/Controller/Index/Index.php b/app/code/Kai/Product/Controller/Index/Index.php new file mode 100755 index 00000000..4d9016cf --- /dev/null +++ b/app/code/Kai/Product/Controller/Index/Index.php @@ -0,0 +1,23 @@ +resultPageFactory = $resultPageFactory; + } + + public function execute() + { + $resultPage = $this->resultPageFactory->create(); + return $resultPage; + } +} diff --git a/app/code/Kai/Product/Setup/InstallData.php b/app/code/Kai/Product/Setup/InstallData.php new file mode 100755 index 00000000..d21cb13f --- /dev/null +++ b/app/code/Kai/Product/Setup/InstallData.php @@ -0,0 +1,52 @@ +eavSetupFactory = $eavSetupFactory; + } + + public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + { + $setup->startSetup(); + + $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); + $eavSetup->addAttribute( + Product::ENTITY, + 'kai_attribute', + [ + 'type' => 'varchar', + 'label' => 'Kai Attribute', + 'input' => 'text', + 'required' => false, + 'visible' => true, + 'user_defined' => true, + 'searchable' => false, + 'filterable' => false, + 'comparable' => false, + 'used_in_product_listing' => true, + 'apply_to' => '', + 'global' => ScopedAttributeInterface::SCOPE_GLOBAL, + 'group' => 'General', + ] + ); + + $setup->endSetup(); + } +} diff --git a/app/code/Kai/Product/etc/catalog_attributes.xml b/app/code/Kai/Product/etc/catalog_attributes.xml new file mode 100755 index 00000000..8dfde04f --- /dev/null +++ b/app/code/Kai/Product/etc/catalog_attributes.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/app/code/Kai/Product/etc/frontend/routes.xml b/app/code/Kai/Product/etc/frontend/routes.xml new file mode 100755 index 00000000..af375a63 --- /dev/null +++ b/app/code/Kai/Product/etc/frontend/routes.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/code/Kai/Product/etc/module.xml b/app/code/Kai/Product/etc/module.xml new file mode 100755 index 00000000..92abcaf7 --- /dev/null +++ b/app/code/Kai/Product/etc/module.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/app/code/Kai/Product/registration.php b/app/code/Kai/Product/registration.php new file mode 100755 index 00000000..ba69dd76 --- /dev/null +++ b/app/code/Kai/Product/registration.php @@ -0,0 +1,6 @@ + + + + + + + + + diff --git a/app/code/Kai/Product/view/frontend/layout/catalog_product_view.xml b/app/code/Kai/Product/view/frontend/layout/catalog_product_view.xml new file mode 100755 index 00000000..9d48b576 --- /dev/null +++ b/app/code/Kai/Product/view/frontend/layout/catalog_product_view.xml @@ -0,0 +1,20 @@ + + + + + + + + 🛒🛒 Kai Tab + + + + + + + + + + + + diff --git a/app/code/Kai/Product/view/frontend/layout/module_index_index.xml b/app/code/Kai/Product/view/frontend/layout/module_index_index.xml new file mode 100755 index 00000000..d04a9a47 --- /dev/null +++ b/app/code/Kai/Product/view/frontend/layout/module_index_index.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/app/code/Kai/Product/view/frontend/templates/product/view/custom_attribute.phtml b/app/code/Kai/Product/view/frontend/templates/product/view/custom_attribute.phtml new file mode 100755 index 00000000..de883fc7 --- /dev/null +++ b/app/code/Kai/Product/view/frontend/templates/product/view/custom_attribute.phtml @@ -0,0 +1,7 @@ + +getCustomAttribute()): ?> +
+ escapeHtml(__('Custom Attribute Label hello')) ?>: + escapeHtml($block->getCustomAttribute()) ?> +
+ diff --git a/app/code/Kai/Product/view/frontend/templates/product/view/custom_tab.phtml b/app/code/Kai/Product/view/frontend/templates/product/view/custom_tab.phtml new file mode 100755 index 00000000..3be6c6b2 --- /dev/null +++ b/app/code/Kai/Product/view/frontend/templates/product/view/custom_tab.phtml @@ -0,0 +1,22 @@ +headerHTML() ?> + +
+
+
+ + <?= $block->getProduct()->getName() ?> + +
+
+

getProduct()->getName() ?>

+

getCustomAttribute() ?>

+
+

getPrice() ?>

+
+ +
+
+
diff --git a/app/code/Kai/Product/view/frontend/templates/product/view/header.phtml b/app/code/Kai/Product/view/frontend/templates/product/view/header.phtml new file mode 100755 index 00000000..878ddf55 --- /dev/null +++ b/app/code/Kai/Product/view/frontend/templates/product/view/header.phtml @@ -0,0 +1,148 @@ + diff --git a/app/code/Kai/Product/view/frontend/templates/sample.phtml b/app/code/Kai/Product/view/frontend/templates/sample.phtml new file mode 100755 index 00000000..e7175a5d --- /dev/null +++ b/app/code/Kai/Product/view/frontend/templates/sample.phtml @@ -0,0 +1 @@ +

Hello Product by Kai!

diff --git a/app/code/Kai/Widget/Block/Widget/MyWidget.php b/app/code/Kai/Widget/Block/Widget/MyWidget.php new file mode 100755 index 00000000..cdcf440b --- /dev/null +++ b/app/code/Kai/Widget/Block/Widget/MyWidget.php @@ -0,0 +1,10 @@ + + + + diff --git a/app/code/Kai/Widget/etc/widget.xml b/app/code/Kai/Widget/etc/widget.xml new file mode 100755 index 00000000..3000a4e1 --- /dev/null +++ b/app/code/Kai/Widget/etc/widget.xml @@ -0,0 +1,13 @@ + + + + + Add widget. + + + + Description of the parameter 1. + + + + diff --git a/app/code/Kai/Widget/registration.php b/app/code/Kai/Widget/registration.php new file mode 100755 index 00000000..457d2521 --- /dev/null +++ b/app/code/Kai/Widget/registration.php @@ -0,0 +1,6 @@ + + +

Kai Widget Hello, I am a custom widget!

+ diff --git a/app/code/Kai/Widget/view/layout/my_module_index_index.xml b/app/code/Kai/Widget/view/layout/my_module_index_index.xml new file mode 100755 index 00000000..14ad8afd --- /dev/null +++ b/app/code/Kai/Widget/view/layout/my_module_index_index.xml @@ -0,0 +1,11 @@ + + + + + + vendor_module_mywidget + + + + +