From 6dbbf10736cbc573decdeffc3be55670dbe202ff Mon Sep 17 00:00:00 2001 From: Oli J Date: Thu, 8 Sep 2022 11:46:43 +0700 Subject: [PATCH] Update Version 1.1.0 --- Block/Widgets/Faq.php | 49 +++++++ README.md | 19 +-- composer.json | 2 +- etc/adminhtml/system.xml | 6 +- etc/widget.xml | 56 +++++++- view/frontend/templates/faq.phtml | 209 +++++++++++++++++++++++------- 6 files changed, 283 insertions(+), 58 deletions(-) diff --git a/Block/Widgets/Faq.php b/Block/Widgets/Faq.php index 77fd67c..d3d27a2 100644 --- a/Block/Widgets/Faq.php +++ b/Block/Widgets/Faq.php @@ -99,4 +99,53 @@ public function isEnabled() { return ($this->advancedWidgetHelper->getConfig('hyvafaq/general/is_enabled') == '1' ? true : false); } + + public function isEnabledStructuredData() + { + return ($this->advancedWidgetHelper->getConfig('hyvafaq/general/is_enabled_structured_data') == '1' ? true : false); + } + + public function getHeroicons($openCloseIcons, $isShowQuestionOnDesktop = 0) + { + $funcs = []; + $icons = []; + switch ($openCloseIcons) { + case 1: + $funcs['type'] = 'chevron'; + if ($isShowQuestionOnDesktop){ + $icons[] = ['name' => 'chevronDownHtml', 'class' => '']; + }else{ + $icons[] = ['name' => 'chevronUpHtml', 'class' => '']; + } + $funcs['icons'] = $icons; + break; + case 2: + $funcs['type'] = 'plus-minus'; + $icons[] = ['name' => 'plusHtml', 'class' => ':not(.active)']; + $icons[] = ['name' => 'minusHtml', 'class' => '.active']; + $funcs['icons'] = $icons; + break; + case 3: + $funcs['type'] = 'plus-x'; + $icons[] = ['name' => 'plusHtml', 'class' => ':not(.active)']; + $icons[] = ['name' => 'xHtml', 'class' => '.active']; + $funcs['icons'] = $icons; + break; + case 4: + $funcs['type'] = 'plusCircle-minusCircle'; + $icons[] = ['name' => 'plusCircleHtml', 'class' => ':not(.active)']; + $icons[] = ['name' => 'minusCircleHtml', 'class' => '.active']; + $funcs['icons'] = $icons; + break; + case 5: + $funcs['type'] = 'plusCircle-xCircle'; + $icons[] = ['name' => 'plusCircleHtml', 'class' => ':not(.active)']; + $icons[] = ['name' => 'xCircleHtml', 'class' => '.active']; + $funcs['icons'] = $icons; + break; + } + + return $funcs; + + } } \ No newline at end of file diff --git a/README.md b/README.md index e8ac62d..909c126 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ Compatible with * Add 1 - x question groups * Add 1 - x questions and answers in each question group * Choose if question groups are shown as open or closed as default on page load on desktop (always closed on mobile) +* Option to show/hide Question Group Title +* Option to keep only one question open +* Choose icons for open/close questions +* Option to add JSON-LD structured data for FAQs ## Further Info, Extension Description & Manual @@ -63,7 +67,7 @@ The code is licensed under the [MIT License (MIT)](https://github.com/JaJuMa-Gmb ## Other [Magento 2 Extensions](ttps://www.jajuma.de/en/jajuma-develop/magento-extensions) by [JaJuMa](https://www.jajuma.de/) - * :framed_picture: Performance & UX:
[Ultimate Image Optimizer for Magento 2](https://www.jajuma.de/en/jajuma-develop/extensions/ultimate-image-optimizer-extension-for-magento-2)
+* :framed_picture: Performance & UX:
[Ultimate Image Optimizer for Magento 2](https://www.jajuma.de/en/jajuma-develop/extensions/ultimate-image-optimizer-extension-for-magento-2)
AVIF & WebP Images, Lazy Loading, High-Resolution / Retina images * :framed_picture: Performance & UX:
[WebP Optimized Images for Magento 2](https://www.jajuma.de/en/jajuma-develop/extensions/webp-optimized-images-extension-for-magento-2#portfolio-content)
@@ -96,17 +100,14 @@ The code is licensed under the [MIT License (MIT)](https://github.com/JaJuMa-Gmb * :thought_balloon: UX & Marketing:
[Customer Satisfaction Feedback for Magento 2](https://www.jajuma.de/en/jajuma-develop/extensions/category-grid-callouts-extension-for-magento-2)
Collect Valuable Feedback From Your Customers & Understand How To Satisfy Your Customers - * :triangular_flag_on_post: :free: UI & UX:
[Awesome Hyvä for Hyvä Themes](https://www.jajuma.de/en/jajuma-develop/extensions/font-awesome-icons-for-hyva-themes-extension)
- Font Awesome 5 & 6 Icons for your [Hyvä Themes](https://www.jajuma.de/de/jajuma-shop/online-shop-mit-magento-2-und-hyva-themes) Store - * :ok_man: :free: User Experience:
[Customer Navigation Manager for Magento 2](https://www.jajuma.de/en/jajuma-develop/extensions/customer-navigation-manager-extension-for-magento-2)
Easily manage the links in your Customer Account - * :heavy_division_sign: :free: Accounting:
[Dynamic Shipping Tax for Magento 2](https://www.jajuma.de/en/jajuma-develop/extensions/dynamic-shipping-tax-extension-for-magento-2)
- Dynamic Shipping Tax Calculation - - * :question: :free: Content:
[Hyvä FAQ Widget for Hyvä Themes](https://www.jajuma.de/en/jajuma-develop/extensions/dynamic-shipping-tax-extension-for-magento-2)
- FAQ Widget for your [Hyvä Themes](https://www.jajuma.de/de/jajuma-shop/online-shop-mit-magento-2-und-hyva-themes) Store + * :triangular_flag_on_post: :free: UI & UX:
[Awesome Hyvä for Hyvä Themes](https://www.jajuma.de/en/jajuma-develop/extensions/font-awesome-icons-for-hyva-themes-extension)
+ Font Awesome 5 & 6 Icons for your [Hyvä Themes](https://www.jajuma.de/de/jajuma-shop/online-shop-mit-magento-2-und-hyva-themes) Store + + * :heavy_division_sign: :free: Accounting:
[Dynamic Shipping Tax for Magento 2](https://www.jajuma.de/en/jajuma-develop/extensions/font-awesome-icons-for-hyva-themes-extension)
+ Dynamic shipping tax calculation based on products in cart ## Other [Services](https://www.jajuma.de/en/jajuma/company-magento-ecommerce-agency-stuttgart) by [JaJuMa](https://www.jajuma.de/) diff --git a/composer.json b/composer.json index 1aeae04..d620acd 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "jajuma/hyva-faq", "description": "FAQ Widget for Hyvä Themes", "type": "magento2-module", - "version": "1.0.3", + "version": "1.1.0", "license": "MIT", "authors": [ { diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index d57edad..e562c26 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -100,7 +100,7 @@ 224.517V336H106.692V115.336H74L91.2077 64H158.026V174.716ZM272.988 109.567L286.407 69.7565H239.485L226.132 109.567H272.988ZM235.338 64H294.409L277.112 115.336H218.13L235.338 64Z"> Hyvä Theme Demo -
Installed Version: 1.0.3
+
Installed Version: 1.1.0

@@ -130,10 +130,10 @@ target="_blank">Category Grid Callouts Customer Satisfaction Feedback + Free: Customer Navigation Manager Free: Awesome Hyvä - Free: Customer Navigation Manager Free: Dynamic Shipping Tax diff --git a/etc/widget.xml b/etc/widget.xml index 0920c92..40529ec 100644 --- a/etc/widget.xml +++ b/etc/widget.xml @@ -14,7 +14,7 @@ FAQ Widget for Hyvä Themes by JaJuMa - + @@ -29,6 +29,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/view/frontend/templates/faq.phtml b/view/frontend/templates/faq.phtml index e49cf47..d7adb3b 100644 --- a/view/frontend/templates/faq.phtml +++ b/view/frontend/templates/faq.phtml @@ -16,83 +16,204 @@ use Jajuma\HyvaFaq\Block\Widgets\Faq; /** @var HeroiconsSolid $heroicons */ $isEnabled = $block->isEnabled(); +$isEnabledStructuredData = $block->getData('enable_structured_data'); $heroicons = $viewModels->require(HeroiconsSolid::class); $questionGroups = $block->getConditions(); $isShowQuestionOnDesktop = $block->getData('is_show_question_on_desktop'); +$displayQuestionGroupTitle = $block->getData('display_question_group_title'); +$keepOnlyOneQuestionOpen = $block->getData('keep_only_one_question_open'); +$openCloseIcons = $block->getData('open_close_icons'); $identifyNumber = rand(100,1000); +$questionIndex = 0; +$jsonLdArray = []; +$heroIconsData = $block->getHeroicons($openCloseIcons, $isShowQuestionOnDesktop); +$typeIcons = $heroIconsData['type']; +$icons = $heroIconsData['icons']; ?> + + $questionGroup): ?>
-
- - - - chevronDownHtml( - "w-6 h-6", - 25, - 25 - ) ?> - - chevronUpHtml( - "w-6 h-6", - 25, - 25 - ) ?> - - - -
-
-
+ +
+ + + +
+ +
+
$question): ?>
-
- - - chevronUpHtml( - "w-6 h-6", - 25, - 25 - ) ?> +
+ + -
-
+
- - +
- + + + + 0) :?> + + \ No newline at end of file