Hi Julien,
Thank you 🙂
> How to remove the EAN number from the field [alg_wc_ean_product_name]
Please try this:
[alg_wc_ean_product_name type="title"]
P.S. It’s adding EAN to the product name because WooCommerce adds SKU there, and they are the same in your case.
> How to vertically center the content on the label?
Unfortunately, it’s not as easy as it may seem. We are using the TCPDF library to produce PDFs in our plugin. And while this library can render the most-used HTML and CSS codes, it cannot handle all of it the way a browser can. There are a couple of solutions though (found them here):
1. Try wrapping your “Print > Template” in <table>
, and add this <div>
to cells:
<table>
<tr>
<td>
<div style="font-size: 27pt"> </div>
[alg_wc_ean_barcode]
</td>
</tr>
</table>
That is – we are adding an empty <div>
, and by adjusting its font-size
, you can position the content in the middle of the cell.
2. Another solution would be to simply add a number of <br>
before the content, like this:
<table>
<tr>
<td>
<br><br><br><br>
[alg_wc_ean_barcode]
</td>
</tr>
</table>
> How to horizontally center the elements on the label?
Luckily, this is much easier than aligning it vertically. Again, I would suggest wrapping it in <table>
, and then you can simply add text-align: center
styling to your table cells, e.g.:
<table>
<tr>
<td style="text-align: center">[alg_wc_ean_barcode]</td>
</tr>
</table>
Hope this helps. Please let me know if you have any questions.