In magento 2.3.0 how to print product view page ? i tried o using window.print() but its shown like below image url. http://prntscr.com/n4i0si

but i need only the product data will be print like below image


any one help on this

My code in .phtml

<div class="product-addto-links addto-links" data-role="add-to-links">
    <a id="print-icon" class="action" href="javascript:void(0);" onclick="myFunction()" data-toggle="tooltip" data-placement="bottom" title="Print Product" data-original-title="Print Product">Print Product</a>

<script type="text/javascript">
    function myFunction(){

1 Answer 1


i got solution:

we can write below code in our CSS file we can hide header footer in window.print():

@media print {
    #header,#footer {display: none;}

Your Answer

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

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