Jump to content

Custom product attributes


Recommended Posts

Hi,

I want some custom attributes on some of my products - such as Manufactures Part Number & Warranty - that are displayed on the product page to customers and can be entered on the product page in the admin portal (and ultimately will be shown on order forms & customer invoices)

I can’t see anyway to add fields to the product page in the admin portal. Custom fields on the product don’t have an option for a display only field otherwise I’d be inclined to take that route unless I’m missing something 

Edited by MrGettingRatherFrustrated
Link to comment
Share on other sites

7 hours ago, MrGettingRatherFrustrated said:

I want some custom attributes on some of my products - such as Manufactures Part Number & Warranty - that are displayed on the product page to customers and can be entered on the product page in the admin portal (and ultimately will be shown on order forms & customer invoices)

I can think of one user who spent a four-figure sum to have a similar feature added by a developer many years ago... from that price, there's probably no need to even name the developer involved  as long-time users would be able to make an educated guess lol. 🤑

7 hours ago, MrGettingRatherFrustrated said:

I can’t see anyway to add fields to the product page in the admin portal.

indeed.

7 hours ago, MrGettingRatherFrustrated said:

Custom fields on the product don’t have an option for a display only field otherwise I’d be inclined to take that route unless I’m missing something 

PCF are really a method of obtaining further information from the user rather than to give them more details.

Link to comment
Share on other sites

Thanks Brian, that confirms what I suspected - I’m not intending on spending that - or anything!

I am relatively comfortable I can find a way to display the information to the end user - I was going to say it’s just the admin side which seems unnecessarily restrictive but then realised that it applies all over the place and the admin side is completely restricted - it really should  be so simple to do this!

So I guess I’ll need to:-

Create new columns in the products DB - my preference although against WHMCS “guidance” 

Create a custom php page on the admin side to write the various attributes to new fields in the DB, I can create a menu link to it as an addon module (or a hook from what I understand)

 Add some code to the various product & order templates, email templates (possibly) and to display the additional desired info and similarly for invoices 

Am I missing anything?

Link to comment
Share on other sites

16 hours ago, MrGettingRatherFrustrated said:

Thanks Brian, that confirms what I suspected - I’m not intending on spending that - or anything!

a frugal chap! 👛

16 hours ago, MrGettingRatherFrustrated said:

I am relatively comfortable I can find a way to display the information to the end user - I was going to say it’s just the admin side which seems unnecessarily restrictive but then realised that it applies all over the place and the admin side is completely restricted - it really should  be so simple to do this!

like lemmings, we're all conditioned to the admin area being restricted... every now and again a refreshing enthusiastic new user appears and says "what the hell is this? it should be really simple to do x!".... a couple of years later, they've either learnt to accept it or moved away from WHMCS.... i've seen that cycle occur so many times over the years - my bookmarks of users sites are littered with those that are still trading, but no longer using WHMCS.

16 hours ago, MrGettingRatherFrustrated said:

Create new columns in the products DB - my preference although against WHMCS “guidance” 

on this, i'd be inclined to follow that guidance.

with WHMCS, one of the things you always have to worry about is updating - even if you ignore whether the upgrade process goes swimmingly or not, there are always unknowns with new releases.

  • new features won't have been thoroughly tested, so will inevitably be buggy... and remain so for many releases afterwards.
  • existing features might be removed - often without warning (even in the release notes and changelogs).
  • features that worked well in a previous release, suddenly become buggy - the fix could be days/weeks/months/years away... or they go into denial about it being a problem that needs to be addressed.
  • more importantly perhaps in your case, SQL queries are often used during the upgrade process - now WHMCS will have written and, one hopes, tested based on the default structure of a table - if you alter that structure, even by just adding fields, then you would run the risk of losing/corrupting data during an update... of course, you will have taken a db backup before updating, but even so, that's avoidable potential hassle in my eyes.

so all you really need to use is a new table, and when you update it, one of the fields will be used to store the PID value, which is in effect the 'id' from the tblproducts table.... that way, there is a relationship link between the tables and so should be simpler to get the desired information.

17 hours ago, MrGettingRatherFrustrated said:

Add some code to the various product & order templates, email templates (possibly) and to display the additional desired info and similarly for invoices 

depending on where this info is to be shown, you might not need to touch the templates - if you could prepend/append the existing description values, then a hook could be used for that - otherwise, cart template changes might be required.... similarly, if these values need to be shown in the client area.... of the four client side options, the cart/CA should be relatively simple, email templates could be tickly depending on how you want to manipulate existing values and for the PDF templates, it's a php template so you'll be able to use php to access the database in the template itself.

17 hours ago, MrGettingRatherFrustrated said:

Am I missing anything?

nothing obvious springs to mind... though there will be something - there always is!

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