11-28-2023 05:12 PM
anyone knows what type of barcode SS uses? it reads something like this "ì^#^1418A660^=î" no idea what is it, order id of that order is "11117112048385002" I wanted to get same codes and be able to pull up order, I can use ORDER ID, but somethings its too long or too short, so its a problem on small barcode label.
Monday
The barcode is the order id encoded to hexadecimal with ^#^ in the beginning and ^ at the end.
so an id of 11234567 in the api would be a value of AB6D07. So the barcode would be ^#^AB6D07^.
Was looking for years and finally noticed the correlation one day.
PHP:
$orderId = 11234567;
$barcode = '^#^' . strtoupper(dechex($orderId)) . '^';
And reverse barcode to order ID:
$fromBarcode = '^#^AB6D07^';
if (preg_match('/\^#\^[a-fA-F0-9]*\^/', $fromBarcode) === 1) {
$fromOrderId = hexdec(substr($fromBarcode, 3, -1));
}
Javascript:
const orderId = 11234567