ajax - POS System - Unable to Toggle 'Show Receipt' Feature Based on Setting (Laravel, JavaScript, Session Manag

Problem Description:I am working on a POS system where I need to allow users to enable or disable the

Problem Description: I am working on a POS system where I need to allow users to enable or disable the "Show Receipt" feature after completing a cash transaction. The receipt should only be shown if the setting is enabled; otherwise, it should be skipped.

I have implemented the following: Backend (Laravel):

A setting in the business settings (enable_show_receipt) that controls whether the receipt is shown after a transaction. The setting is stored in the session and should be accessible in the JavaScript part. Frontend (JavaScript):

A JavaScript function (pos_print(receipt)) that checks the session value of enable_show_receipt and either shows or hides the receipt accordingly. I'm trying to dynamically check this value and skip the receipt print if the setting is disabled.

However, the issue is:

Even when the "Enable Show Receipt" checkbox is disabled or enabled in the settings, the print preview window still shows up. The setting does not seem to be applied properly, and the receipt is always printed regardless of the checkbox setting.

When the "Enable Show Receipt" checkbox is checked: The receipt should be shown after a successful transaction.

When the checkbox is unchecked: The receipt should be skipped.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744572416a4581533.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信