0

I have override email/shipment/items.phtml in custom module. in view/frontend/sales_email_order_shipment_items.xml Vendor_module::email/shipment/items.phtml

I am not getting any data on printing $shipment = $block->getShipment();

Is their any thing missing?

3
  • please specify layout file name.
    – Msquare
    Commented Feb 17, 2021 at 7:04
  • sales_email_order_shipment_items.xml
    – devhs
    Commented Feb 17, 2021 at 7:06
  • I have updated the question
    – devhs
    Commented Feb 17, 2021 at 7:06

1 Answer 1

0

Try This

sales_email_order_shipment_items.xml

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Shipment Items List" design_abstraction="custom">
    <update handle="sales_email_order_shipment_renderers"/>
    <body>
        <block class="Magento\Sales\Block\Order\Email\Shipment\Items" name="items" template="Vendor_module::email/shipment/items.phtml">
            <block class="Magento\Framework\View\Element\RendererList" name="sales.email.order.shipment.renderers" as="renderer.list"/>
        </block>
    </body>
</page>
5
  • <update handle="sales_email_order_shipment_renderers"/> & <block class="Magento\Framework\View\Element\RendererList" name="sales.email.order.shipment.renderers" as="renderer.list"/> Is necessary to add ?
    – devhs
    Commented Feb 17, 2021 at 7:17
  • Yes it's necessary to add. It's works for you ?
    – Msquare
    Commented Feb 17, 2021 at 7:23
  • yes it works, but can you please explain why its necessary to add ? & also why settemplate layout is not working with it ?
    – devhs
    Commented Feb 17, 2021 at 7:25
  • ya sure, it would be great if you please explain why its necessary to add ? & also why settemplate layout is not working with it ?
    – devhs
    Commented Feb 17, 2021 at 7:28
  • I am not getting shipmentid in phtml file. at the same time i get it in vendor file
    – devhs
    Commented Feb 17, 2021 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.