Postponed (maintainer needs more info)
Project:
Commerce Point of Sale (POS)
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
8 Jul 2018 at 19:53 UTC
Updated:
19 Sep 2019 at 20:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
asespat commentedThe error dissapears when i unninstall barcode scanner but is not finding the products
Comment #3
asespat commentedit looks should work but pos do not find the products. the mesaage in reports lasts messages is:
Drupal\search_api\SearchApiException: Unknown field in filter clause: 'stores'. en Drupal\search_api_db\Plugin\search_api\backend\Database->createDbCondition() (linea 2137 de /home1/rodatsco/public_html/nueva/nueva3/modules/search_api/modules/search_api_db/src/Plugin/search_api/backend/Database.php).
any idea?
Comment #4
travis-bradbury commentedThat error suggests your search index is missing the stores field. You need the store indexed as an integer in the Search API index's Fields configuration.
Comment #5
asespat commentedthanks. that worked
Comment #6
bildesbil commentedHello,
I encountered the same error. But I have a question how to run the barcode scanner module with search? Since when activated, you can not do any product search and you have an ajax error.
Any help is welcome. Thank you.
Comment #7
gmem commentedComment #8
bildesbil commentedhi,
please how to run the barcode scanner module in search product form?
Help me please.
Comment #9
gmem commentedHey Bildsebil, you should be able to just enable the module and then configure it under admin/commerce/config/pos/barcode-scanning - you will also need to install the quagga JS library. There you can enable it to open when the register opens, and keeping it open after an item is scanned. I'll be trying to replicate the described error today.
Comment #10
gmem commentedWould you mind posting a screenshot of your POS register configuration and search API index fields @bildesbil? I'm unable to replicate the ajax error so far. Also would you mind bringing up the browser Developer Console (hit F12) and check the console for any errors?
Comment #11
bildesbil commentedHi gmem,
I uninstalled the barcode-scanning module and then I reinstalled it and the display problem has been solved (thanks for your help). But I have another problem when I open a registry the camera is not detected. I downloaded the specified library.
the example file of the library launches my camera but in POS is not the case.
Thank you for guiding me in solving this problem.
Comment #12
bildesbil commentedComment #13
bildesbil commentedComment #14
nor sairi commentedhi.. i have a isue with no camera detect, and another isue pos custumer display not loading.
Comment #15
nor sairi commentedComment #16
gmem commentedWhen you guys loaded up the page, did your browser prompt you to share your webcam? If not, could you verify the permission given by clicking on the (i) right beside the URL?
@maxsim86 Could you verify your settings under /admin/commerce/config/pos/barcode-scanning? You need to check "Scanning interface open by default" to "Open" and it should pop up automatically. As for the customer interface, it might be a websocket port related issue. Would you mind posting a screenshot of your settings at /admin/commerce/config/pos/customer-display/settings?
Comment #17
nor sairi commented@gmem yes i check barcode-scanning default is open. and isue number 2. you right my websocket not figure yet.
Comment #18
bildesbil commentedHello @nor sairi
to solve your barcode problem you must uninstall the module and then reinstall it after installing the barcode library (quagga JS library) in the right place (/ libraries /quagga) and check if you have /quagga / quagga.min.js in your root folder else copy it from the "dist" folder.. if that can help you.
Comment #19
bildesbil commentedHello @gmem,
I have a problem with the client display page I do not know exactly what to configure. if you can help me I'm on a local server.
Comment #20
nor sairi commented@bildesbil .. yes tq i forget to add library, now its work..
Comment #21
gmem commented@bildesbil You'll want to make sure your ports are set in the settings, then execute
php path/to/commerce_pos/modules/customer_display/server.php. This will start up the websocket server and should allow you to connect properly. Here's an example of my settings.Comment #22
nor sairi commentedok i sucess to execute php
.now my custumer display still blank, please see my figure,
Comment #23
nor sairi commentedsee my figure customer disply
Comment #24
gmem commentedYou'll want to remove the HTTP:// from the Websocket Host field - try just entering "localhost" here and see if that works. Hit F12 on the customer display page to bring up the "Inspector" then click over to the "Console" tab and see if there are any errors regarding a failed connection as well.
Comment #25
nor sairi commentedok, i have change it. i print the error below..
Firefox can’t establish a connection to the server at wss://localhost:5000/display. this happen when use chrome;
commerce_pos_customer_display.js?v=8.5.5:4 WebSocket connection to 'wss://localhost:5000/display' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
(anonymous) @ commerce_pos_customer_display.js?v=8.5.5:4
Comment #26
gmem commentedOkay, so after a ton of troubleshooting, it turns out browsers really don't like mixed content when it comes to websockets, and generally fail to connect if you're connecting to a websocket over wss:// from a plain http:// page, or vice versa (https:// -> ws://). The trouble is even when using HTTPS the connection times out. I'll have to bring this up with Shawn, but in the mean time, would you mind applying the attached patch and letting me know if it works? It should also log to the console when the websocket server receives messages.
Comment #27
nor sairi commentedi try apply patch and it work, can u verify what i do is right. after apply patch i flush cache and the output stil show "can't establish a connection to the server at wss://localhost:5000/display"
"patches": {
"drupal/commerce_pos/commerce_pos_customer_display": {
"Drupal Commerce Customer Display fix Display Custumer Pos": "https://www.drupal.org/files/issues/2018-07-19/websocket_wss_to_ws-test...."
Comment #28
gmem commentedYou'll want to apply it like so:
Since it's a submodule, the code is included in the commerce_pos module, which is how it will be patched. Make sure you do a composer install after as well.
Comment #29
nor sairi commentedtq @gmem, this error bring to me
i also try with another desktop, it's same, are u think this about php 7.2?
Comment #30
gmem commentedMake sure the websocket server is indeed running, in this case you should run
You shouldn't see any errors, and it should appear to "hang" when it's running. It will print out the contents of a message as a debugging step just to ensure there is a solid connection. I would also recommend running the latest PHP version, 7.2, just to eliminate that as a potential variable. Also because you're running the website on your computer locally it won't be accessible from other computers unless you use the IP. Regardless you should be able to connect fine on your local machine. If you need to verify the server is running you can use netcat to check the port, although this might not be necessary.
Comment #31
nor sairi commentedok, tq, i have to test websocket server. i run php server.php and this error output come out; what u think about this.
Uncaught PHP Exception Twig_Error_Loader: "Template "block--bare.html.twig" is not defined in "themes/contrib/bootstrap/templates/block/block--system-branding-block.html.twig" at line 1." at /var/www/html/sairi/vendor/twig/twig/lib/Twig/Loader/Chain.php line 129
also test nc -vz localhost 5000, and output; mean ok
Connection to localhost 5000 port [tcp/*] succeeded!
Comment #32
gmem commentedEnsure you're within the sairi folder when you run the command, because of the way the websocket server works it has to briefly load up Drupal to grab the configuration.
Comment #33
nor sairi commentedwow.. and finally its work, what i do is i remove register entities and add it back, i just try because i see a error
The order you tried to load is not compatible with the POS, it must have a cashier and a register field.tq gmem.Comment #34
cham74 commentedGetting the same issue. Not sure how the original thread issue was solved?
Typing anything in the Product Search box and hitting Return gives window with:
Tried uninstalling and does not prevent ajax error, reinstalling doesn't either.
This thread does not seem to cover this issue, or rather goes into other related issues.
Comment #35
cham74 commentedIn Performance config JavaScript aggregation was checked on, which is the preferred setting, and despite flushing caches this module does not work with that set.
Un checking Aggregate JavaScript files allows POS to function for product search, however, we do need JS aggregation to work.
Comment #36
smccabe commentedHey @cham74, I tested both with and without aggregation and I don't get any errors. That ajax error you are getting is likely due to something failing before that, can you check your watchdog and see if there are any errors that pop up before that? Drupal doesn't always do a good job of passing along errors that occur during an AJAX request.
Comment #37
arvindswarnkar commentedI am getting websocket error for my local
1.
js_yz8gNmj2E2pbMt-EUD7TBDVgu9SFDSXaYMMqt_rcr78.js:2917 WebSocket connection to 'wss://localhost:8080/display' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
(anonymous) @ js_yz8gNmj2E2pbMt-EUD7TBDVgu9SFDSXaYMMqt_rcr78.js:2917
(anonymous) @ js_yz8gNmj2E2pbMt-EUD7TBDVgu9SFDSXaYMMqt_rcr78.js:3050
2. My configrations are: admin/commerce/config/pos/customer-display/settings
Websocket Host
localhost
Websocket External Port
8080
Websocket Internal Port
8080
Websocket Client Address(s)
0.0.0.0
Comment #38
arvindswarnkar commentedWhen I am trying to run
php modules\commerce_pos\modules\customer_display\server.php
Getting error
Fatal error: Interface 'Ratchet\MessageComponentInterface' not found in \modules\commerce_pos\modules\customer_display\src\DisplayServer.php on line 13
Comment #39
Elifas commented#35 WORKED FOR ME ON THE AJAX SEARCH.