Jump to content

freedomfflow

Member
  • Posts

    7
  • Joined

  • Last visited

About freedomfflow

freedomfflow's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. I was able to confirm the following: The hook point ClientAdd does not have the customfields available to it as it runs immediately after adding the client. However, the ClientDetailsValidation hook point does contains the client data and custom fields: http://docs.whmcs.com/Hooks:ClientDetailsValidation
  2. I have a 'timing' problem I believe. I have a script that I'm triggering that is using the API to create a client. I'm using this API option in my postfields: $postfields["action"] = "addclient"; This is working perfectly. However, I also have a hook: add_hook("ClientAdd",10,"papMigration",""); In my hook, I have the following SQL statement: $sql = "SELECT * FROM mywinnet_cart.tblclients as c INNER JOIN mywinnet_cart.tblcustomfieldsvalues as cf ON cf.relid = c.id WHERE c.id='".$userData['userid']."' AND cf.fieldid='3'"; PROBLEM: I've discovered, after many hours of scratching my head and breaking out the JOIN into separate SQL statements, the following problem: In my hook, which is being triggered by the 'ClientAdd' hook point, the data exists in the 'tblclients' table, but it DOES NOT EXIST YET' in the tblcustomfieldsvalues table!!! So in my hook, my query fails, and I can't do what I need to do (which is provision account data to a 3rd party system... post affiliate pro). QUESTION: Is there another hookpoint I can use, or some way to force the data to be written in my current hook, so that the tblcustomfieldsvalues data is present while my hook is executing. Please Help!!
  3. I found this API option that seems to get me what I want: $postfields["username"] = $username; $postfields["password"] = md5($password); $postfields["action"] = "getclientsproducts"; $postfields["clientid"] = "34";
  4. In a hook I have, where I send data to anther system, I need to send them the password an new customer entered when they ordered a product. In the $vars array, there is a password element, but it has an encrypted/hashed password. How can I access the clear-text password so I can post it over to the 3rd party system? Thanks
  5. In the back office to my web site, I want to display the list of products a person has purchased and still owns. That is, that the payment was successful and there has not been a return/refund What is the best approach to finding this data? Also, can you tell me why some purchases show as pending and others as approved when in both cases the payment was successful? Where can I find an explanation of those statuses? Thank you!
  6. Hey all, sorry, I figured it out... Doing a var_dump of $vars in the hook, I see a variable $vars["custtype"] Not sure how I missed it the first time, but its there, right in front of my eyes...
  7. 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?
×
×
  • 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