Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm working on a custom app using the POS UI extension.
It's utilising the CameraScanner and
useScannerDataSubscription
listener to get scanned barcode data.
I was really surprised to see that that ProductSearch library that comes with the POS UI extension doesn't seem to let you search for products by barcode.
I can use
api.productSearch.fetchProductVariantWithId()
or
api.productSearch.searchProducts()
but neither of these seem to allow you to search by barcode.
The example they use in the docs assumes that a product's barcode will be the same as its variantId, but this isn't necessarily the case - in fact if you use Shopify's own Retail Barcode Labels app then it will generate barcodes using only the last 6 digits of the variantId.
It seems like the only option is to create my own endpoint outside the app to take the barcode and return product variants.
Does anybody know if I've missed something here - it seems like quite an oversight that the barcode scanner functionality doesn't seem to let you do anything with the barcodes that are scanned.
Thanks
Pete
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024