Hello bricks team,
It would be great if there is a new action for the interaction so that we can print the desired selector by clicking a print button.
What is the use of this?
This helps us create a fully customized invoice using dynamic data for the users’ orders in their account. They can then print or download their invoice using this feature.
I tried using the custom code below, but the problem I’m having is that it ignores the page’s css. I hope it gets added to Bricks.
<script>
window.printSection = s => {
const e = document.querySelector(s);
if (!e) return;
const w = window.open('', 'printWindow', 'width=800,height=600');
w.document.write(`<!DOCTYPE html><html><body>${e.innerHTML}</body></html>`);
w.document.close();
w.focus();
w.print();
w.close();
};
</script>