Zen Cart Logo
Forums / General Questions / Scan Barcode > Post Order Update

Scan Barcode > Post Order Update

Views: 1,638

Results 1 to 15 of 15
24 Aug 2015, 1:48 PM
#1
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Scan Barcode > Post Order Update

Hi All,
I'm looking for the following solution, was wondering if this is even possible if yes did anyone work on anything similar in the past ?

I have a barcode with the order# printed on each shipping label, by scanning the barcode with a reader it should post an update to that order that it shipped.

24 Aug 2015, 4:01 PM
#2
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,773
Plugin Contributions:
20

Re: Scan Barcode > Post Order Update

I'm assuming you're gonna be doing that from some new admin page created for that purpose... You will need to create a new input field, scan the barcode into that field and submit the form. Form processing should trigger the status update and send an email to the customer - you can find that code in admin/orders.php and modify it to suit your needs.
Don't get intimidated, it's not as complex as it may seem at first. :wink:

24 Aug 2015, 11:25 PM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Scan Barcode > Post Order Update

ShopVille:

Hi All,
I'm looking for the following solution, was wondering if this is even possible if yes did anyone work on anything similar in the past ?

I have a barcode with the order# printed on each shipping label, by scanning the barcode with a reader it should post an update to that order that it shipped.

Sorry to tell you this, but it isn't quite as easy as balihr is suggesting unless the barcode itself is the order number.
You haven't quite made that clear.

The way I'm reading this is that your shipping label contains a barcode for shipping purposes, and the order number is printed on the label as plain text (along with the customers name and address).

Please clarify.

Cheers
RodG

25 Aug 2015, 4:22 PM
#4
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Scan Barcode > Post Order Update

RodG:

Sorry to tell you this, but it isn't quite as easy as balihr is suggesting unless the barcode itself is the order number.
You haven't quite made that clear.

The way I'm reading this is that your shipping label contains a barcode for shipping purposes, and the order number is printed on the label as plain text (along with the customers name and address).

Please clarify.

Cheers
RodG

Yes the barcode itself is the order number
I implemented this by loading a free barcode font to my server and adding this line to super_shipping_label.php

<td class="labelorderid"><?php echo $oID; ?></td>

And this to the css

.labelorderid {
	color:#003D00; /*727272*/
	font-size:40px;
	font-family: 'Code39AzaleaFont';
25 Aug 2015, 11:02 PM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Scan Barcode > Post Order Update

ShopVille:

Yes the barcode itself is the order number

In that case, the solution hinted at by balihr would be quite feasible, and as stated, probably not as complex as it may first appear.

Alas, it will require custom coding, so the actual difficulty level would very much depend on your own skill level.
As far as I'm aware no one has done anything like this before.

ShopVille:

I implemented this by loading a free barcode font to my server and adding this line to super_shipping_label.php

<td class="labelorderid"><?php echo $oID; ?></td> ``` > > > And this to the css > ``` .labelorderid { color:#003D00; /*727272*/ font-size:40px; font-family: 'Code39AzaleaFont'; ```

Very clever. I thought this would have been a lot more difficult/complex.

Anyway, as for what you are now trying to achieve, the first step would be to create an admin page that has a simple text input box whereby you can enter an order number (via keyboard) and echo it back to the screen. You can probably use something like the 'whos online' module as the basis of this (unless balihr provides a better 'starting point' (which I know he has done before).

Next step would be to replace/update the input field with the scanner input, then from there it should be an 'easy' matter of creating the database queries to extract the customers email address, and even eaiser to create the code needed to send the email with the information you wish to send.

In short, there are basically only 4 steps needed - With the most difficult (in my opinion) the initial creation of the admin page to perform the functions.

I wish you well with this project. It looks as though it could be quite useful and not a lot of work - in fact to me it looks like an ideal 'beginners' project. (beginner being a relative term that assumes some prior experience with PHP and SQL).

Cheers
RodG

8 Sep 2015, 5:16 PM
#6
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,773
Plugin Contributions:
20

Re: Scan Barcode > Post Order Update

ShopVille, I hope you're still following this thread...

I have just built this as a plugin and will be releasing it in a few days, but got stuck when I tried to implement YOUR approach. Maybe it's just my barcode scanner and the fact it's probably one of the very first USB models :smile:, but I can't seem to scan that font after printing it out, it just doesn't recognize it... Did you try scanning it, does your scanner recognize it? I've tried a few other 3of9 fonts (Code 39), but can't scan any...

8 Sep 2015, 6:52 PM
#7
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Scan Barcode > Post Order Update

balihr:

ShopVille, I hope you're still following this thread...

I have just built this as a plugin and will be releasing it in a few days, but got stuck when I tried to implement YOUR approach. Maybe it's just my barcode scanner and the fact it's probably one of the very first USB models :smile:, but I can't seem to scan that font after printing it out, it just doesn't recognize it... Did you try scanning it, does your scanner recognize it? I've tried a few other 3of9 fonts (Code 39), but can't scan any...

Glad to hear that, looking forward!
Actually i had the same difficulty when I tried to scan, it most be the font, I guess we have to find an authentic barcode font.

8 Sep 2015, 7:06 PM
#8
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,773
Plugin Contributions:
20

Re: Scan Barcode > Post Order Update

Yeah, that's actually not as simple as one might expect... I've already bought a new scanner on ebay (15 bucks and it says it supports Code39), but it's gonna take at least a month for it to arrive... :sadwalk:

I'll see if I can work out an alternative solution in the meantime.

8 Sep 2015, 7:08 PM
#9
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Scan Barcode > Post Order Update

balihr:

Yeah, that's actually not as simple as one might expect... I've already bought a new scanner on ebay (15 bucks and it says it supports Code39), but it's gonna take at least a month for it to arrive... :sadwalk:

I'll see if I can work out an alternative solution in the meantime.

The app mentioned above also officially supports code39 I would guess these fonts are not authentic code39?

8 Sep 2015, 7:13 PM
#10
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,773
Plugin Contributions:
20

Re: Scan Barcode > Post Order Update

The app isn't mentioned here... :smile: I'm just installing it from Play Store, but am still not sure how the scanned code gets sent into the web form... Just downloading it and will give it a try.

8 Sep 2015, 7:23 PM
#11
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Scan Barcode > Post Order Update

balihr:

The app isn't mentioned here... :smile: I'm just installing it from Play Store, but am still not sure how the scanned code gets sent into the web form... Just downloading it and will give it a try.

Sorry mentioned it in PM
https://play.google.com/store/apps/details?id=com.scandit.scandium&hl=en

I wasn't yet at the step of having it submit any data, but just tested the scanner and it would not detect them

8 Sep 2015, 8:45 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Scan Barcode > Post Order Update

As far as fonts/barcodes, anyone come across this PHP barcode generator?

https://github.com/davidscotttufts/php-barcode

Looks like it works for the most part based on all of the comments in the associated article referenced at the top of the github page... There might be a tweak or two in the comments of that article, but seems like overall functional.. (meaning I don't have tools to test, but looks legit. :) )

8 Sep 2015, 8:54 PM
#13
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,773
Plugin Contributions:
20

Re: Scan Barcode > Post Order Update

This is actually a step back... It generates an image in the same formats as the fonts available...

But, I've already figured out my problem, or shall we call it stupidity... I didn't notice that I had my font in bold - that's why the scanner didn't read it... :lamo: At least I'll have a spare scanner now... :D It works perfectly fine now that the font is normal. Just a few more tweaks, then the documentation and then it go live.

8 Sep 2015, 9:47 PM
#14
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Scan Barcode > Post Order Update

balihr:

This is actually a step back... It generates an image in the same formats as the fonts available...

But, I've already figured out my problem, or shall we call it stupidity... I didn't notice that I had my font in bold - that's why the scanner didn't read it... :lamo: At least I'll have a spare scanner now... :D It works perfectly fine now that the font is normal. Just a few more tweaks, then the documentation and then it go live.

Interesting find but by me I tested in regular type na dit would not detect but as long as you have a working font its good

12 Sep 2015, 1:41 AM
#15
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,773
Plugin Contributions:
20

Re: Scan Barcode > Post Order Update

Just wrapped it all up and have it working. If anyone is interested in this, please PM me.