The weirdness we had with PrestaShop is that people just could flat out not logon. This was the biggest reason we are leaving it. It went so well, testing and everything, but when it came to going live we just had TONs of people with issues logging in and we just couldn't figure it out.
So, back to your system. I know I am just breaking things here, but check this out. The way you pull license code does some weird stuff.
I attached an image of what it does. Your code pulls every key I ever purchased, but mine only pulls the key from that transaction. (Which is how I need it so I can go back and see how many seats are associated with that key.)
Your code pulls it all at once, which does work, but not for what I need.
SELECT f.ID_FILE, f.title, f.filesize, f.maxdownloads, f.remotefilename, c.code
FROM {db_prefix}store_item_file as f
LEFT JOIN {db_prefix}store_item_code as c ON (c.ID_FILE = f.ID_FILE AND c.ID_MEMBER = " . $user_info['id'] .")
WHERE f.ID_ITEM = " . $context['store_itemid']);
Instead I left that alone. When the store goes through the completetransaction phase and assigns the key it also attaches the Basket ID to the ID_TRANS of the code table. (I should probably make that back to transaction ID to keep it consistent, but here is what I have.)
When you go to display the license code I run another query in that spot.
<td align="center">',$row['code'],'</td>'; //This is where you are displaying the code in the image attached.
//Begin my code
echo '<td align=center>';
$dbresult3 = $smcFunc['db_query']('', "
SELECT code
FROM {db_prefix}store_item_code
WHERE ID_FILE = " . $row['ID_FILE'] . " AND ID_MEMBER = " . $user_info['id'] . " AND ID_TRANS = " . $context['store_transid']);
$row3 = $smcFunc['db_fetch_assoc']($dbresult3);
$smcFunc['db_free_result']($dbresult3);
echo $row3['code'];
echo '</td>';
//End my code
echo '</tr>';
.
Should I just send you the two files I have edited so you can see my hack job first hand?