0

How can I securely validate the customer has entered the correct order ID when making a return?

At the moment I do this:

if ($return_info['order_id'] && $this->customer->isLogged() && $this->customer->getId() == $return_info['customer_id']) {   

How should I do this for guest checkout when the customer is not logged in?

John Magnolia
  • 16,769
  • 36
  • 159
  • 270

1 Answers1

3
if ($return_info['order_id'] && 
   $this->customer->isLogged() &&
   $this->customer->getId() == $return_info['customer_id']) {
   //Condition for register user

} else if ($return_info['order_id'] && 
  !$this->customer->isLogged() && 
  $return_info['customer_id'] == 0 ){

   //Condition for guest user
}
Tanmoy
  • 1,035
  • 6
  • 19