0

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

http://prntscr.com/n4i2lb

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>
</div> 

<script type="text/javascript">
    function myFunction(){
        window.print();
    }
</script>
0

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, privacy policy and cookie policy

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