Skip to content
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
6 changes: 5 additions & 1 deletion src/Model/LandingPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ public function getLandingPageDataWithoutStore(): array
{
$fields = [
LandingPageInterface::PAGE_ID,
LandingPageInterface::NAME,
LandingPageInterface::CREATED_AT,
LandingPageInterface::UPDATED_AT,
LandingPageInterface::OVERVIEW_PAGE_ID,
Expand All @@ -605,6 +604,10 @@ public function getLandingPageDataWithoutStore(): array
LandingPageInterface::STORE_ID,
];

if ($this->getData(LandingPageInterface::STORE_ID) === 0) {
$fields[] = LandingPageInterface::NAME;
}

return array_combine(
$fields,
array_map(fn($field) => $this->getData($field), $fields)
Expand All @@ -619,6 +622,7 @@ public function getLandingPageDataForStore(): array
$fields = [
LandingPageInterface::ACTIVE,
LandingPageInterface::STORE_ID,
LandingPageInterface::NAME,
LandingPageInterface::URL_PATH,
LandingPageInterface::CATEGORY_ID,
LandingPageInterface::HEADING,
Expand Down
3 changes: 2 additions & 1 deletion src/Model/ResourceModel/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
use Magento\Framework\Model\ResourceModel\Db\Context;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Zend_Db_Expr;

class Page extends AbstractDb
{
Expand Down Expand Up @@ -51,7 +52,7 @@ public function getLandingPageStoreData(int $landingPageId, int $storeId = 0): a
->join(
['p' => $this->getTable('emico_attributelanding_page')],
'ps.page_id = p.page_id',
['name']
['name' => new Zend_Db_Expr('COALESCE(ps.name, p.name)')]
)
->where('ps.page_id = ?', $landingPageId)
->where('store_id = ?', $storeId);
Expand Down
1 change: 1 addition & 0 deletions src/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<column name="page_id" xsi:type="int" nullable="false" unsigned="true" comment="Landing Page ID" />
<column name="store_id" xsi:type="smallint" nullable="false" unsigned="true" comment="Store ID" />
<column xsi:type="boolean" name="active" nullable="true" default="1" comment="Active state" />
<column xsi:type="varchar" name="name" nullable="true" comment="Name"/>
<column xsi:type="varchar" name="url_path" nullable="false" comment="Url Path"/>
<column xsi:type="int" name="category_id" unsigned="true" nullable="true" comment="Category Id"/>
<column xsi:type="varchar" name="heading" nullable="true" comment="H2 Heading"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="source" xsi:type="string">Page</item>
<item name="scopeLabel" xsi:type="string">[STORE VIEW]</item>
<item name="showInDefault" xsi:type="boolean">1</item>
<item name="showInWebsite" xsi:type="boolean">0</item>
<item name="showInStore" xsi:type="boolean">1</item>
</item>
</argument>
<settings>
Expand Down