Skip to content

Commit

Permalink
Take 'show in account' configuration into account
Browse files Browse the repository at this point in the history
  • Loading branch information
schmengler committed Jul 5, 2017
1 parent 22653e4 commit 8e9fe4f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<section id="sales">
<group id="ordercomments" translate="label" type="text" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Order Comment</label>
<field id="show_in_account" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<field id="show_in_account" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>Show comments in customer account</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
</section>
Expand Down
10 changes: 10 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<sales>
<ordercomments>
<show_in_account>1</show_in_account>
</ordercomments>
</sales>
</default>
</config>
2 changes: 1 addition & 1 deletion view/frontend/layout/sales_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Bold\OrderComment\Block\Order\Comment" as="ordercomment" name="sales.order.comment" after="sales.order.info"/>
<block ifconfig="sales/ordercomments/show_in_account" class="Bold\OrderComment\Block\Order\Comment" as="ordercomment" name="sales.order.comment" after="sales.order.info"/>
</referenceContainer>
</body>
</page>

0 comments on commit 8e9fe4f

Please sign in to comment.