Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFWEB-2947: Add landing page campaign feature #466

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## Unreleased
### Add
- Add landing page campaign
## [v4.2.2] - 2023.11.10
### Add
- Add campaigns to category view page
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ Here you can disabled them, if you do not use utilize this part of FACT-Finder f

**Note:** Paging has been added cause with infinite scrolling enabled in ff-record list, this custom element is redundant

**Note:** Page id in Landing page campaign base on Magento CMS page Identifier name

### Custom Elements Options
![Custom Elements Options](docs/assets/custom-elements-options.png "Custom Elements Options")
In this section you can find specific custom elements attributes, the values of which, you can configure.
Expand Down
Binary file modified docs/assets/optional-custom-elements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/etc/adminhtml/system/components.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>

<field id="campaign_landing_page" translate="label" type="select" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Landing Page Campaigns</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>

<field id="recommendation" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Recommendations</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
Expand Down
20 changes: 17 additions & 3 deletions src/view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
</block>

<referenceContainer name="after.body.start">
<block class="Magento\Framework\View\Element\Template" name="factfinder.communication" ifconfig="factfinder/general/is_enabled" template="Omikron_Factfinder::ff/communication.phtml" before="-">
<block class="Magento\Framework\View\Element\Template" name="factfinder.communication" ifconfig="factfinder/components/campaign_landing_page" template="Omikron_Factfinder::ff/communication.phtml" before="-">
<arguments>
<argument name="view_model" xsi:type="object">Omikron\Factfinder\ViewModel\Communication</argument>
<argument name="ppp" xsi:type="helper" helper="Omikron\Factfinder\ViewModel\Cart::getItemIds" />
</arguments>
</block>
<block class="Magento\Framework\View\Element\Template" name="factfinder.communication.ppp" ifconfig="factfinder/general/is_enabled" template="Omikron_Factfinder::ff/products-per-page-configuration.phtml" after="factfinder.communication">
<block class="Magento\Framework\View\Element\Template" name="factfinder.communication.ppp" ifconfig="factfinder/components/campaign_landing_page" template="Omikron_Factfinder::ff/products-per-page-configuration.phtml" after="factfinder.communication">
<arguments>
<argument name="view_model" xsi:type="object">Omikron\Factfinder\ViewModel\ProductsPerPage</argument>
</arguments>
</block>
<block class="Magento\Framework\View\Element\Template" name="factfinder.search.redirect" ifconfig="factfinder/general/is_enabled" template="Omikron_Factfinder::ff/search-redirect.phtml" after="factfinder.communication" />
<block class="Magento\Framework\View\Element\Template" name="factfinder.search.redirect" ifconfig="factfinder/components/campaign_landing_page" template="Omikron_Factfinder::ff/search-redirect.phtml" after="factfinder.communication" />
</referenceContainer>

<referenceBlock name="top.search">
Expand All @@ -38,5 +38,19 @@
</referenceBlock>

<block class="Omikron\Factfinder\Block\Ssr\RecordList" name="factfinder.ssr.recordlist" template="Omikron_Factfinder::ff/ssr/record-list.phtml" />

<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="factfinder.campaignlandingpage" ifconfig="factfinder/general/is_enabled" template="Omikron_Factfinder::ff/campaign-landing-page.phtml" />
<referenceBlock name="factfinder.feedbacktext">
<arguments>
<argument name="flag" xsi:type="string">is-landing-page-campaign</argument>
</arguments>
</referenceBlock>
<block class="Magento\Framework\View\Element\Template" name="factfinder.campaign.pushed.products" template="Omikron_Factfinder::ff/campaign-pushed-products.phtml">
<arguments>
<argument name="flag" xsi:type="string">is-landing-page-campaign</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
7 changes: 7 additions & 0 deletions src/view/frontend/templates/ff/campaign-landing-page.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/** @var Magento\Framework\View\Element\Template $block */
$objectManagerCms = \Magento\Framework\App\ObjectManager::getInstance();
$cmsPage = $objectManagerCms->get('\Magento\Cms\Model\Page');
?>

<ff-campaign-landing-page page-id="<?= $cmsPage->getIdentifier() ?>"></ff-campaign-landing-page>
Loading