Top WooCommerce & WordPress Plugins › Forums › EAN and Barcodes for WooCommerce › Barcode label
- Support forum for the EAN and Barcodes for WooCommerce.
- This topic has 3 replies, 2 voices, and was last updated 1 year, 9 months ago by
Tom Anbinder.
- AuthorPosts
-
March 3, 2022 at 10:52 am #85130
Julien Vanwinsberghe
ParticipantHow to show the product image on the left side of the barcode label, and on the right half showing the barcode, product name, variation name, price?
Like this: https://prnt.sc/_L5a0XmRu602
March 3, 2022 at 11:50 pm #85131Hi Julien,
General approach would be to wrap your “Print > Template” content in
<table>
with two cells, and setwidth: 50%
for both cells. With some additional styling it could look like this:<table style="padding: 10px"> <tr> <td style="width: 50%; text-align: center"> <div style="font-size: 15pt"> </div> [alg_wc_ean_product_image] </td> <td style="width: 50%; text-align: center"> [alg_wc_ean_barcode after="<br>"] [alg_wc_ean_product_name after="<br>"] [alg_wc_ean_product_price] </td> </tr> </table>
One note about the “variation name” though – the
[alg_wc_ean_product_name]
shortcode outputs full variation name with attributes, e.g. if the main variable product’s name is “Hat”, then this shortcode will output something like “Hat – Green” for variation. If that’s not what you need, and you want to output variable name and variation’s attributes on different lines, then please update the plugin to the latest v3.6.0, and replace this:[alg_wc_ean_product_name after="<br>"]
with this:
[alg_wc_ean_product_name parent="yes" after="<br>"] [alg_wc_ean_product_function name="get_attribute_summary" after="<br>"]
Hope this helps. Please let me know if you have any questions.
March 4, 2022 at 4:47 pm #85132Julien Vanwinsberghe
ParticipantHello, one last question. How to define the size of the image with the
[alg_wc_ean_product_image]
shortcode?I tried to add a
style="width:..."
atttribute or to set the parenttd
to flex stretch but it didn’t change the image size at all, it is very small: https://prnt.sc/76CCjDHwztQtThis is the code I’m using:
<table style="padding: 10px"> <tr> <td style="width: 40%"> <div style="font-size: 12pt"> </div> [alg_wc_ean_product_image] </td> <td style="width: 60%;text-align: center"> [alg_wc_ean_barcode after="<br>"] [alg_wc_ean_product_name] - [alg_wc_ean_product_price] </td> </tr> </table>
March 4, 2022 at 6:00 pm #85133Hi Julien,
[alg_wc_ean_product_image]
shortcode haswidth
andheight
attributes – they will set the image size in pixels. Both values are set to30
pixels by default. Also, there is thesize
attribute, which sets the image that should be displayed (e.g. thumbnail or full) – it’s set towoocommerce_thumbnail
by default, so you may want to set it to e.g.full
:[alg_wc_ean_product_image width="50" height="50" size="full"]
- AuthorPosts
- You must be logged in to reply to this topic.