Product Option Verification

Posts: 30
Joined: 01/30/2008

Hey guys,

I have some quick questions regarding attributes.

*Let's say I want the user to enter some information along with a product into Field 1, and then I want them to Reenter that information in Field 2 for verification/checking purposes. I can do this with Attributes, but there is no way to check to see if Field 1 = Field 2 without some custom coding...right?

*Also, the second problem I'm having is that I don't want to display the contents of Field 1 and Field 2 on the Cart screen, since there were just 2 fields for verification, and only one counts.

*Lastly, can Attributes have help text? I don't want my Attribute to display in the cart as "Enter your text here:".

Thank you very much! The person I am building this site for says Ubercart saved us a good 2-3 weeks of custom coding! Smiling

Edit 1:
-------
PS: Another way I could possibly do this would be to make the Product have a custom Add to Cart link, which then leads then to a CCK form page where they enter the info and it is checked, and the result of the form would be added as the attribute to the Product in question. Would this be doable? Advice is welcome. Smiling

Edit 2:
-------
Yet another way to do it would be to add another pane on the Checkout page if the user's order contains a certain product, an then do the check there. Would that be easy to accomplish? I know I saw someone doing something like it using soccer tournaments or something before.

Posts: 4686
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hmm... I guess it's hard to give a complete answer w/o more info on what you're trying to verify and how it's tied to the product. You really won't be able to accomplish something like this without custom code, and your best bet is going to be to use hook_form_alter() to add necessary fields to the add to cart form. If you need 1 of the fields to show with the product, make it an attribute. Then use the hook I mentioned to add the verification field and a validate handler to the add to cart form. Here you can check to see if the appropriate fields match and not let it submit if they don't.

Posts: 30
Joined: 01/30/2008

Hi Ryan,
Thanks for responding. I guess I can go into a bit of detail. The person I'm working for is making products that deal with web services. We're using Ubercart along with Drupal to help sell the services he's making. We need to be able to have the client to type in the domain name of the website they want these services we offer applied to. We were thinking of making two fields for this. One is the main field, and the second field is just a verification/check field. Some JavaScript would also be used to check and see if the client entered the domain name in the correct format. This "attribute" needs to be linked to the customer order number in some way if their order contained the service that required the web address verification, as we offer other services that don't need a domain name. They are simply "add-on" kind of products.

We're using Paypal Express Checkout for now, but we're going to switch to a gateway. Not to get too offtopic, but I believe we should be able to copy the Test Gateway, and just modify it to our needs, correct?

As for our products and Paypal, the domain name that the user enters gets carried through the Paypal Express Checkout and back to our site to the Checkout Complete page. Some custom code on this page would then tell another database that we have to start doing something with the domain name the customer entered.

For now, we were thinking of making another table or another database that simply held the order number from Ubercart, along with the domain name that the user entered.

Thoughts?