SWAuk / website

Student Windsurfing Association website
www.swa.co.uk
5 stars 3 forks source link

Details column of ticket sales is messy #210

Closed LukeStorry closed 2 years ago

LukeStorry commented 5 years ago

The details column should be cleaned up by parsing the string into json then iterating through addons and checking quantity, to prevent this: image

Ensuring that changes to the format of the details string still results in addons being shown in the table is important however.

LukeStorry commented 5 years ago

Fix would be around line 180 of src/site/views/event/tmpl/default.php

Currently if ($person['Details'] == "{\"addons\":[]}") removes the entry for events with no addons, but cases where no addons are bought, or the string is different, failsafes to showing as above screenshot.

oshotton commented 5 years ago

Parsing the $person['Details'] JSON string to a PHP obj seems very sensible.

LukeStorry commented 5 years ago

I know you said that in the original PR, and now i agree! Iterating through each item in the addons part of that obj to check qty==0 seems to be the best option