Printing the UPC Number & Barcode

omgchrisomgchris Member Posts: 7
edited May 2020 in Tips, Tricks & How-to’s

Hello.

I copied this template

i changed:

<img class="ean8" src="/barcode.php?type=label&amp;number={{ Label.Item.systemSku }}&amp;ean8=1&amp;noframe=1">
					<img class="ean" src="/barcode.php?type=label&amp;number={{ Label.Item.systemSku }}&amp;noframe=1">

to

<img class="ean8" src="/barcode.php?type=label&amp;number={{ Label.Item.upc}}&amp;ean8=1&amp;noframe=1">
					<img class="ean" src="/barcode.php?type=label&amp;number={{ Label.Item.upc }}&amp;noframe=1">


My intention with the modification is to print the "UPC" field/number from the UPC field in lightspeed products.

It almost works. It's adding another digit to the end. When I scan the barcode, it wont find anything because the scan gun is also including the extra digit in to the search field.


The UPC or (barcode/digits) on our products are 12 digits long. To me, a lay person this is a UPC/Barcode but I'm told its an EAN.. okay.


I only use the "UPC" field in our lightspeed account and in that field is the barcoded number displayed on all our products, and almost all other products in a normal retail place.

I would really appreciate some help removing that last digit.

Otherwise, the scannable barcode could be the system ID, as long as the 12 digital number/upc, is the same that is displayed in the UPC field when editing a product.

We need to match physical products UPC with the UPC on the tag, so the number should match exactly. As for scanning, we just need that product to be searchable via scan gun which currently we cannot.

If I could have summed this up better I apologize I just want to include as much info as possible.

Thank you!

Best Answer

Answers

  • omgchrisomgchris Member Posts: 7

    Anyone there? I need some help, I shouldn't have to hire a developer to print a standard upc.

  • gregaricangregarican Member Posts: 683 
    edited June 2020

    An EAN is different than a UPC. The former is 13 digits, while the latter is 12 digits. I wonder if the referenced class="ean" and class="ean8" is properly handling a different value compared to what it would be expecting?

  • gregaricangregarican Member Posts: 683 
    edited June 2020

    Just paste this into a plain text file, save it with an HTML extension and see what happens.


    <img class="ean" src="https://cloud.merchantos.com/barcode.php?type=label&amp;number=210000004030&amp;noframe=1">

    <img class="upc" src="https://cloud.merchantos.com/barcode.php?type=label&amp;number=21000000403&amp;noframe=1">


    There is a class="upc" that should work for you in the case of the second barcode. 🙂 And there are ways you can configure a barcode scanner to ignore these extra digits (i.e. - the check digit).

    And there is a reference Lightspeed provides on how to do this as well!

    https://hyperspace.zendesk.com/hc/en-us/articles/360018664893-How-do-I-print-the-UPC-as-a-scannable-Barcode-in-Lightspeed-

    Post edited by gregarican on
  • omgchrisomgchris Member Posts: 7

    Thank you, I've tried this before though and it still adds this additional digit to the end, making what the barcode scanner prints in to the search field, return no results due to the extra digit.

    I understand the barcode scanner can be programmed this way but we're trying to follow some standards, our vendors all use different barcode scaners etc and we need to print just the normal barcode/upc without the digit, so they and we, don't have to re program our barcode scanners.

  • gregaricangregarican Member Posts: 683 

    You need to perhaps look at some reference materials on how these barcode symbologies work. Here's a reference in terms of the UPC-A barcode symbology --> https://www.tec-it.com/en/support/knowbase/barcode-overview/linear/Default.aspx#UPC%20Version%20A. Although the values are 12 digits long, only the first 11 digits are user-assignable. The last digit is a check digit and validates the first 11.

    While you can program a scanner to ignore that final check digit when reading a barcode, a barcode itself cannot be readily forced to drop the final digit since that in and of itself helps define the standard it's printing (e.g. - UPC-A requires 12 digits to be valid).

  • omgchrisomgchris Member Posts: 7

    Thanks again, I have read this and formatted to UPC-A, the one I want.


    When using that websites tool, I get it working without issue.

    Trying in lightspeed, it wont work.

  • gregaricangregarican Member Posts: 683 
    edited June 2020

    Back in 2018 when first launching Retail we had issues scanning our existing tags. Here are a couple of links to videos demonstrating the issues:


    From what I remember there was a difference between the iPad's POS scanning them versus scanning them in the Retail Manager area of iPad POS. Our barcodes weren't UPC or EAN. Just a shorter ALU. But they still wouldn't scan for accurate lookups in Retail Manager.

    It boiled down to the actual make/model of the barcode scanner from what I recall. We had to implement Zebra CS4070 models for Retail and then things "just worked."

  • omgchrisomgchris Member Posts: 7

    Thanks, the videos didn't quite help though.

    The issue is the output of the scannable bar-code (and numerical) is outputting with an extra digit programmed in to the scannable area, and when scanned, that extra digit is included in the field which the bar-code is scanned in to, search field, or anything else, this is on ipad, PC, etc

    When I use {{OrderLine.Item.upc}} in the purchase order template, it outputs the UPC which I want.

    When I wrap that like:

    <img class="upc" src="/barcode.php?type=label&amp;number={{OrderLine.Item.upc}}&amp;upc=1&amp;noframe=1">

    or

    <img class="upc-a" src="/barcode.php?type=label&amp;number={{OrderLine.Item.upc}}&amp;upc-a=1&amp;noframe=1">

    That is now taking {{OrderLine.Item.upc}} and outputting it incorrectly, with the extra digit.

    Something in the class or url paramters is not right, and i can't find a reference to how to format this html properly for lightspeed to output the right UPC

    I don't think this has anything to do with the scanner. I can use a third party generator and it works fine, but then i don't want to pay for commercial use for that generator when I'm certain lightspeed can do this for me.

  • gregaricangregarican Member Posts: 683 

    I see what you're getting at now. If Lightspeed won't help you and you are somewhat of a developer, you could "roll your own" barcode generator and deploy it to a public host where you could reference it in the template. Or perhaps you could find a truly free resource that's already out there.

    If you need a custom developer, there's a gentleman named Brett Gordon that owns Hyperspace (https://hyperspacehq.com). He might be able to whip something up for you.

    Good luck!

  • omgchrisomgchris Member Posts: 7

    I was thinking about contacting Brett actually. Just hoping I don't need to bother him with something that should be easily and readily available in lightspeed resources. I mean I want to include scannable UPC barcodes in my purchase orders, seems like PO's 101 and yet I can't do it without looking outside.. Thanks for trying to help Gregarican.

  • gregaricangregarican Member Posts: 683 

    If for some unknown reason this isn't possible natively within Retail's UI, then you could create a separate app for generating PO's. Utilizing the Retail API. Then you could include something like this to generate the barcodes for each PO line item --> https://lindell.me/JsBarcode/. I suspect that Brett might lead you in a similar direction if this indeed isn't possible natively within Retail. Good luck!

  • SGIOutfittersSGIOutfitters Member Posts: 6

    I have a similar situation - I have 12 digits for my UPC code I just want to print the UPC barcode on Labels not the system ID. Anyone create a template that does just that?

  • gregaricangregarican Member Posts: 683 

    @SGIOutfitters if you are talking about the price tags, then there is a template for that. Under Settings --> Print Templates. Just change the field that's being referenced in there.

  • SGIOutfittersSGIOutfitters Member Posts: 6

    I did change the field from systemSku to upc - It prints the UPC but adds an additional number at the end so the system does not find the item.


    Original:

    <footer class="barcode">

              <img class="ean8" src="/barcode.php?type=label&amp;number={{ Label.Item.systemSku }}&amp;ean8=1&amp;noframe=1&amp;hide_text={{ hide_text }}">

              <img class="ean" src="/barcode.php?type=label&amp;number={{ Label.Item.systemSku }}&amp;noframe=1&amp;hide_text={{ hide_text }}">

            </footer>

    Changed:

    <footer class="barcode">

              <img class="ean8" src="/barcode.php?type=label&amp;number={{ Label.Item.upc }}&amp;ean8=1&amp;noframe=1&amp;hide_text={{ hide_text }}">

              <img class="ean" src="/barcode.php?type=label&amp;number={{ Label.Item.upc }}&amp;noframe=1&amp;hide_text={{ hide_text }}">

            </footer>

  • SGIOutfittersSGIOutfitters Member Posts: 6

    The template does mention that using UPC barcodes doesn't work but this just seems like a simple request - everyone uses UPC codes not their System SKU

  • gregaricangregarican Member Posts: 683 

    You might not need to tweak the actual code in the ItemLabel print template, other than the boolean options at the top. Around here, although it's commented that the UPC in barcodes doesn't work. Likely due to the extra character.

    Out of all POS systems we have used in the past and currently use, Retail is the only one with the finicky behavior in how they've implemented these check digits. So configuring scanners and whatnot is clumsy at best.


    {% set show_custom_sku = false %}          {# Display Custom SKU (if available) above Description #}

    {% set show_manufacturer_sku = false %}       {# Display Manufacturer SKU (if available) above Description #}

    {% set show_upc_code = false %}           {# Display the UPC code at the top of the receipt (using UPC codes in barcode does not work) #}

    {% set show_date = false %}             {# Display today's date above description (ddmmyy formatting) #}

    {% set price_with_no_cents = true %}        {# Remove cents from being displayed in price #}

    {% set date_format = 'mdy' %}            {# Format the date is shown in if show_date is enabled.

                                m = 2 digit month, d = 2 digit day, y = 2 digit year, Y = 4 digit year #}

    {% set hide_price = false %}            {# Remove the price from displaying on label #}

    {% set hide_description = false %}         {# Remove the description from displaying on label #}

    {% set hide_barcode = false %}           {# Remove the barcode from displaying on label #}

    {% set hide_barcode_sku = false %}         {# Remove the System ID from displaying at the bottom of barcdoes #}

  • SGIOutfittersSGIOutfitters Member Posts: 6

    I did change this to true but it just displays the UPC as a number not the actual barcode. The barcode is still the system SKU.

    {% set show_upc_code = false %}           {# Display the UPC code at the top of the receipt (using UPC codes in barcode does not work) #}

    My scanner is programmed to ignore the last "check digit" from the UPC code.

    I just would like to see the barcode printed to be the UPC so you can match the lightspeed label to the item's label that has the UPC code. I can change the code to hide the barcode but the space is still there and you cannot change the margins to make up for that "reserved" space even though you tell it to hide it.

  • gregaricangregarican Member Posts: 683 

    Hmmm....what about this section?


    <footer class="barcode">

              <img class="ean8" src="/barcode.php?type=label&amp;number={{ Label.Item.systemSku }}&amp;ean8=1&amp;noframe=1&amp;hide_text={{ hide_text }}">

              <img class="ean" src="/barcode.php?type=label&amp;number={{ Label.Item.systemSku }}&amp;noframe=1&amp;hide_text={{ hide_text }}">

            </footer>

    I wonder if you change Label.Item.systemSku to be Label.Item.upc instead? Oops, just read up the thread where you already did that. Now I wonder if there is a query parameter in that PHP call that would drop the trailing digit. Would be nice if someone from Lightspeed could chime in as well 😀

  • SGIOutfittersSGIOutfitters Member Posts: 6

    It would be nice if Lightspeed could provide an explanation as to why you cannot print UPC codes instead of SystemSKU - ID codes on the labels, other than they just don't support UPC codes on the label other than displaying it as a number - not the barcode.

  • ShootersshedShootersshed Member Posts: 93 ✭

    UPC is universal whereas the system ID is Lightspeed only.

    It means the barcodes only work within the lightspeed environment this way.

    It is I assume some way of making sure you are only using lightspeed with their labels.

  • ibgrafxibgrafx Member Posts: 2

    I know I'm late to the party but we are having same issue. Anyone else notice at top of code it says:

     {# Display the UPC code at the top of the receipt (using UPC codes in barcode does not work) #}

    Does this mean that it cannot display UPC codes correctly when calling for src="/barcode.php?type=label&amp;number={{ Label.Item.upc }}

    Are we just out of luck?

  • ShootersshedShootersshed Member Posts: 93 ✭

    I think its LS's way of controlling what scanner you buy etc.

    More likely to use the hardware setup they sell if it is the only stuff that works.

  • troyjwrctroyjwrc Member Posts: 5

    FWIW, For anyone else who comes across printing/ label issues:

    The Lightspeed answer to virtually anything to do with printing/ labels and their templates is "hire a 3rd party integration partner."

    You use what LS gives you, or you pay someone else to fix it.

    They have zero interest or support resources in working with printer/ label templates. Exasperating.

Sign In or Register to comment.