luigidefra Posted July 9, 2020 Share Posted July 9, 2020 Hi, i'm a new WHMCS user. I wanted to know if it was possible to set a personalized value in the product tab. It would serve me generic for all users who choose that product, so I cannot use the custom fields as they will then have to be set for each individual user who purchases that product. Is it possible to do this or do I need a hook? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 13, 2020 Share Posted July 13, 2020 On 09/07/2020 at 17:41, luigidefra said: It would serve me generic for all users who choose that product, so I cannot use the custom fields as they will then have to be set for each individual user who purchases that product. you want a personalised value, but you don't want to set it individually ?? there's nothing to stop you using a custom field, setting it as admin only, and setting the values individually when you need to. alternatively, if the value is going to be a same for all users, then you could use a product custom field, make it a dropdown and only enter one value as an option - and then don't show it on the order forms. On 09/07/2020 at 17:41, luigidefra said: Is it possible to do this or do I need a hook? i'd still use a custom field whether you use a hook to fill it or not... but what is this personalised value going to be and do you want the user to know about it or enter a value for it ?? 0 Quote Link to comment Share on other sites More sharing options...
luigidefra Posted July 15, 2020 Author Share Posted July 15, 2020 On 7/13/2020 at 5:24 PM, brian! said: i'd still use a custom field whether you use a hook to fill it or not... but what is this personalised value going to be and do you want the user to know about it or enter a value for it ?? The user does not need to know anything about this field. It is a field that I must insert when creating a new product. It would like to be shown only in my products tab and only I can edit it. I need it to use in an external addon made by me. In fact, I asked if it is feasible via hook to make sure to add an additional field in the create product and change product tab 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2020 Share Posted July 16, 2020 23 hours ago, luigidefra said: The user does not need to know anything about this field. It is a field that I must insert when creating a new product. It would like to be shown only in my products tab and only I can edit it. I need it to use in an external addon made by me. I still think the native way to do it would be an admin-only product custom field... client wouldn't never see it and it gives you a value in the database per service that you can adjust. 23 hours ago, luigidefra said: In fact, I asked if it is feasible via hook to make sure to add an additional field in the create product and change product tab with a product custom field, you can obtain, or update, its value by any number of methods (sql/capsule/api etc). 0 Quote Link to comment Share on other sites More sharing options...
luigidefra Posted July 23, 2020 Author Share Posted July 23, 2020 On 7/16/2020 at 7:03 PM, brian! said: I still think the native way to do it would be an admin-only product custom field... client wouldn't never see it and it gives you a value in the database per service that you can adjust. with a product custom field, you can obtain, or update, its value by any number of methods (sql/capsule/api etc). yes, But so I will have to go to each user card, select the product and fill in the custom field. Instead, I already know upstream, creating a product, what will be its value for all users 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 24, 2020 Share Posted July 24, 2020 21 hours ago, luigidefra said: yes, But so I will have to go to each user card, select the product and fill in the custom field. i'm not suggesting that you necessarily have to fill these details in manually. 21 hours ago, luigidefra said: Instead, I already know upstream, creating a product, what will be its value for all users the reason why i'm suggesting a PCF is because it gives you an empty container that you can use when the service is created - so when you, or WHMCS automatically, creates the client's service, you can fill this PCF with whatever your default value is... via hook, api whatever. 0 Quote Link to comment Share on other sites More sharing options...
luigidefra Posted July 24, 2020 Author Share Posted July 24, 2020 16 minutes ago, brian! said: the reason why i'm suggesting a PCF is because it gives you an empty container that you can use when the service is created - so when you, or WHMCS automatically, creates the client's service, you can fill this PCF with whatever your default value is... via hook, api whatever. ok, this was a solution! today, I solved it by adding a configurable option group hidden and set as a dropdown with a single value inside. So during the creation of the product by a customer, the product will have its option as attribute ... Is this also correct as a solution? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 25, 2020 Share Posted July 25, 2020 17 hours ago, luigidefra said: Is this also correct as a solution? if it works, yes. 🙂 it's just another empty container that you're filling on account creation, but instead of being stored in the tblcustomfieldsvalues database table, it's going to be stored in the tblhostingconfigoptions table. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.