Top WooCommerce & WordPress Plugins › Forums › EAN and Barcodes for WooCommerce › Questions regarding the barcodes
- Support forum for the EAN and Barcodes for WooCommerce.
- This topic has 1 reply, 2 voices, and was last updated 1 year, 9 months ago by
Tom Anbinder.
- AuthorPosts
-
March 3, 2022 at 7:38 am #85124
Julien Vanwinsberghe
ParticipantHello, I have bought the product, it’s great! I have a few questions regarding the barcodes:
- How to remove the EAN number from the field
[alg_wc_ean_product_name]
to only show the name and variation but not the EAN number? (https://prnt.sc/4FXDJDpPkq5G) - How to vertically center the content on the label?
- How to horizontally center the elements on the label?
Thanks!
March 3, 2022 at 11:25 pm #85125Hi 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 itsfont-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 addtext-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.
- How to remove the EAN number from the field
- AuthorPosts
- You must be logged in to reply to this topic.