Jump to content

In hook, determine if processing a New customer or an Existing customer


Recommended Posts

In a hook I wrote, I am validating a custom field against a database table to ensure the value in the custom field is unique (not already used in our database)...

 

add_hook("ShoppingCartValidateCheckout",1,"hook_subdomain_validate");

 

As you can see, I'm doing this at the hook point 'ShoppingCartValidateCheckout'

 

It works great for new customers, but when there is an existing customer, I don't want to do this check as it is not necessary, and by definition it will fail, and is causing problems of course when this occurs. I need to by pass this check for existing customers.

 

Problem:

In my hook code I need to know how to determine if I'm dealing with a New or Existing customer so I can do nothing and return a positive response code if its and existing customer, effectively bypassing the validation logic in my hook.

 

Questions:

1 - How can I determine in my code if I am processing an order for a New customer or an Existing customer?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated