If a customer trying to log in from any of the PDP pages it will redirect to the login page and he/she can log in and it must redirect my account page. But instead of that, we can redirect back to that specific PDP page by adding origin and orgin_hash
We can directly add to <a> tag by orgin=”home” and orgin_hash=”url-component-PDP”
or we can add by javascript
login += '&origin=home&origin_hash=' + currentitemname + '#login-register';