abantecart-src
abantecart-src copied to clipboard
Issue in coupon listing grid not showing the correct on/off status
Hi admins,
We found out that in AbanteCart v1.3.2, the coupon listing grid is not showing the correct on/off status like in the edit page status.
This is what the listing grid shows:
While in the edit coupon page:
I checked the core code and found out that in the model. The coupon status is based on $sqlDateRange = "(CASE WHEN c.date_start < NOW() AND c.date_end > NOW() THEN 1 ELSE 0 END)";
, not the actual coupon status.
Is this intentionally changed or is it a bug?
Did you change coupon status in the grid? If yes, please reload page
yes i did. coupon status is the listing grid are not changed.
Please post all coupon settings and step-by-step what did you do.
I create a new coupon: Status: Off Coupon Name: Test Coupon Description: Testing Code: test Type: Percentage Discount: 10.00 Date Start: 07/06/2022 Date End: 07/09/2022 Uses Per Coupon: - Uses Per Customer: -
When i open the coupon listing grid, the coupon status is turned ON, but in the edit page the status is OFF
Hi Basara - Lee here - let me add clarity here- this action is the same in all the 1.3.2 installations we have.
in 1.3.2 cart versions it seems the coupon grid keys off the coupon date for reporting the on/off condition.
If the edit page is set to off, the coupon does not work in the cart which is correct action. But in order to get the grid to report correctly one has to change the edit page stop date to at least one day earlier than the current date - then grid will show off setting, the same as edit setting. That is new behavior in cart 1.3.2 We are running PHP 8.0 in all our installations.
Unless the expiring date is manual changed. it does not matter how many times we set the grid to off. It will show off UNTIL we leave the grid page and come back to it, or refresh the page - it will have reverted to the ON condition, even with the edit page still off.
@abolabo to replicate create the coupon with params described by handoyo, next set status to OFF and click save button (at the very bottom of page). then go to the listing grid. The status showed as ON. I think we should separate status from the date range.
Hi @BasaraABC and @abolabo ,
I tested again on 1.3.3 and found out that the issue still occurs. I tried to turn ON via the listing grid, saved the status and when i refresh, the status is still OFF.
A fix would be appreciated.
Thanks.
@handoyo . please check activation date range of coupon. It's not a bug.
I think we should separate status from the date range.
@BasaraABC how it can be an active within non-current date range? i think all works fine there
Please read the description again. The case of the bug: listing shows ON but coupon details show OFF. Should be consistent (whatever approach you choose status should show the same in the listing and details page).
The issue is not fixed.
https://github.com/abantecart/abantecart-src/assets/2631910/45a3fb6c-143d-486d-810c-ba0b1e085966