Output the barcode image with PHP

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #85189
    IOWEB
    Participant

    Hello,

    I need to output the barcode image in my functions.php file. What should I use for this? I’ve only been able to output the ean itself.

    Best regards and thanks for the plugin

    #85190
    Tom Anbinder
    Moderator
    Plugin Support

    Hi,

    I would suggest using the do_shortcode() function with our [alg_wc_ean_barcode] and/or [alg_wc_ean_barcode_2d] shortcodes, like this:

    echo do_shortcode( '[alg_wc_ean_barcode]' );
    echo do_shortcode( '[alg_wc_ean_barcode_2d]' );

    And if you need to specify the product ID then:

    echo do_shortcode( '[alg_wc_ean_barcode product_id="' . $product_id . '"]' );
    echo do_shortcode( '[alg_wc_ean_barcode_2d product_id="' . $product_id . '"]' );

    Please give it a try and let me know what you think.

    #85191
    IOWEB
    Participant

    Hi that seems to work.

    Thank you.

    #85192
    Tom Anbinder
    Moderator
    Plugin Support

    Hi,

    Happy to hear it’s solved. Let me know if you’ll need anything else.

    And if you like the plugin, please consider leaving me a rating here or here.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.