Question

My site has the ability for logged-in customers to see orders in their Order History page and also a Guest Lookup where they can lookup an existing order putting in order number and last name.

The two reports are identical with one exception: Order Notes that we put in with "Visible On Storefront" checked will show up if you're looking at the order while logged in, but they do not show up when looking at the Guest Lookup page. I would like to change that so that the notes do show, but so far I'm having trouble tracking down where to make that change.

How could I change that setting that hides comments / notes while looking at the order through Guest view?

Was it helpful?

Solution

I figured this one out. The layout XML for the order view page is different for logged-in users (Magento_Sales/view/layout/sales_order_view.xml) than for guest (Magento_Sales/view/layout/sales_guest_view.xml). The first one includes the block for comments and the second one does not.

Easy fix: add that block in myself.

Create file:

MyCompany/MyTheme/Magento_Sales/layout/sales_guest_view.xml

Contents:

<?xml version="1.0"?>
<page layout="1column" 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="Magento\Sales\Block\Order\View" name="order.comments" template="Magento_Sales::order/order_comments.phtml" before="sales.order.info.links"/>
        </referenceContainer>
    </body>
</page>

Done! Comments on the Guest version of the Order View page.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top