Jump to content

Community

IPCommerceFan

Commerce > Custom Fields > Custom Input Validation?

Recommended Posts

Hi guys,

I've finally had a chance to poke around 4.0 (Beta 6), and was wondering about the possibility of adding Custom Input Validation to custom fields in Commerce (specifically regex), similar to how it is available in custom fields for Pages?

e.g. - When creating a new custom field, select Text as the field type, and a new option for Custom Input Validation appears where you can enter the validation criteria.

It seems to me there should actually be parity across Commerce and Pages custom field type options, at least as far as things like this, field length, and text formatting are concerned.  I would love to have a custom commerce field automatically converted to upper case once submitted, as well as limited to a certain number of characters and the option of setting a default value!

Thanks!

Edited by Steven@wt

Share this post


Link to post
Share on other sites

It looks like this was added to custom fields for support requests (or it was already there?), but this would still be an awesome addition to custom package fields!

P.S. -  So far so good testing 4.0.0 with a copy of my live site.  I *almost* switched to cs-cart because of missing features like this one, but the complete integration IPS offers is very hard to beat, even in this very early stage.

Share this post


Link to post
Share on other sites

This is still not available as of 4.3.6:

image.thumb.png.2a698785234b676fb0e44c7d5290a63e.png
Commerce --> Store --> Custom Fields 

This is what is needed (specifically Default Value, Max Length, Custom Input Validation, and Apply text formatter):

image.thumb.png.a17c7a1f9db9730b714e515765c39267.png

Pages --> Content --> Fields

 

Fingers crossed for 4.4.

Share this post


Link to post
Share on other sites
Posted (edited)

I got this working by modifying \IPS\nexus\Package\CustomField (the actual php file that relates to that class)!

image.thumb.png.8639d82ff025fe08313075497d2c027b.pngimage.thumb.png.0c2e0f667139acfce9b9e60a0f4cbcfb.png

 

All I had to do was:

- borrow the $form->add statements for pf_max_input and pf_input_format from  \IPS\CustomField\CustomField
- comment out the "unset" statements for those fields
- Add the fields to the nexus_package_fields table in the database

It works like a charm!  Now to figure out how to do what I did in the form of a plugin or application since I don't really feel comfortable with the fact I edited the source files directly...

Still hoping IPS will roll this into the core product, but I'm very thankful for the fact the framework was intuitive enough to allow this workaround!

Edited by IPCommerceFan

Share this post


Link to post
Share on other sites

Highlighting this as a pressing issue for us still too. Surprised to see someone else encountering the same difficulties as we, but at least this shows there is a demand for this change.

 

Edited by Aaron M

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...