View Full Version : Purchase Without Account

12-17-2007, 08:01 AM
This is a simple version.. probably can be improved but for a quick fix untill someone pro comes along, this should help you if customers who purchased using PWA can see each others orders / addresses etc.





FIND: require('includes/application_top.php');
BELOW ADD: include('includes/orderciddbupdate.php');


FIND: if ($orders['customers_id']==0) $orders['customers_name'] = '!! ' . $orders['customers_name'];
BELOW ADD: if ($orders['customers_id']==-1) $orders['customers_name'] = '!!+ ' . $orders['customers_name'];

UPLOAD orderciddbupdate.php to catalog/includes/

What does this do?
Now, when a customer reachs the Success Page, a database query will be performed to change all customer ID's in
the database that are set to "0" and change them to "-1".

The customer_id 0 is the guest ID, so the customer is classed as a guest throughout the checkout process untill
the end, where at the last page checkout_sucess.php it will update the customer_id to -1, so its no longer a
visible order and since the customer is still a guest (0) they cannot view orders which have a different
customer_id numbers (which in this case is now -1)

The orders can still be viewed in the Admin panel etc, everything is still normal :)

!!+ Means the order is from a customer who hasn't registered and has the -1 ID (Hidden ID)
!! Means the order is from a customer who hasn't registered, but for some reason still has the 0 ID (Visible ID)

More... (http://addons.oscommerce.com/info/355)