Barcode label

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #85130

    How 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

    #85131
    Tom Anbinder
    Moderator
    Plugin Support

    Hi Julien,

    General approach would be to wrap your “Print > Template” content in <table> with two cells, and set width: 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">&nbsp;</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.

    #85132

    Hello, 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 parent td to flex stretch but it didn’t change the image size at all, it is very small: https://prnt.sc/76CCjDHwztQt

    This is the code I’m using:

    <table style="padding: 10px">
        <tr>
            <td style="width: 40%">
                <div style="font-size: 12pt">&nbsp;</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>
    #85133
    Tom Anbinder
    Moderator
    Plugin Support

    Hi Julien,

    [alg_wc_ean_product_image] shortcode has width and height attributes – they will set the image size in pixels. Both values are set to 30 pixels by default. Also, there is the size attribute, which sets the image that should be displayed (e.g. thumbnail or full) – it’s set to woocommerce_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"]
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.