最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin4浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论