Adding Custom Fields To Order Download

General ShopSite user discussion

Adding Custom Fields To Order Download

Postby extragear » Mon Sep 20, 2010 7:52 am

Greetings

We have 3 different Shopsite based websites. (All pro with the latest upgrade)

One thing we would like to do is add two custom fields for download with the orders.

For example a customer type code and a source code. Each website would have a different set of these.

From what I have read in the help section, you can include product extra fields in a download if you are using the order api. (we are not using the order api)

The method we use for download of the orders is XML.

I know how to populate the product extra field. How would we associate the product extra fields to be included in any download in our case?

Or, is there another way to include these extra fields and their associated
settings in the download?

Thanks

Tim

Belden Motosport
extragear
 
Posts: 169
Joined: Mon Apr 02, 2007 10:53 am
Location: Binghamton, NY

Re: Adding Custom Fields To Order Download

Postby Jim » Mon Sep 20, 2010 1:06 pm

Are you talking about the Extra Product field on a per product basis? Or the Custom Checkout Fields which are on a per order basis?

If the Extra Product fields, they are not passed along with the order information so there is no way to download them with the order. Your only option for these fields would be to write an OrderAPI script that would send that information to some external database for the orders. The product Order Options and Customer Text Box content is passed along with the order so if you could stuff the Extra Product field info into the Customer Text Box somehow that might be a way to pass the info along with the order. It would then appear in the download field "Other Options" in the download file.

The Custom Checkout Fields are passed along with the order so you should be able to download that information. The information for those fields is in the "Custom Fields" field in the download.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Adding Custom Fields To Order Download

Postby extragear » Tue Sep 21, 2010 8:59 am

Jim

Thanks for the info. Its alittle clearer to me now. What we want is to download a source code and customer type code. This would be the same for each order on the website. Example, EXTRAGEAR for source code and 4 for type code. The codes would change only on a per website basis.

If I understand you correctly, we could visit the Commerce -> Order System -> Checkout

Once there, we would need to define the additional custom fields we want to use.

In our case, we already had an agree to terms and conditions custom field.

We would then setup a Customer Type Field and Source Code Field, leave the selector for email, Conf, Thank You unchecked. Then for type select hidden.

Now we would have to put some coding in on our shipping screen (page).

I checked the Shopsite help section and it provides some examples of non-hidden custom checkout fields.

see the following:

http://www.shopsite.com/help/10.2/en-US/sc/pro/index.htm?page=/help/10.2/en-US/sc/pro/custom.checkout.fields.html


For the hidden fields, I am guessing the code would be something along the lines of

<input type="hidden" name="field02" value="4">
<input type="hidden" name="field03" value="EXTRAGEAR">

FYI: Field name 2 is the Customer Type which we want to be 4
Field name 3 is the Source Code which we want to be EXTRAGEAR

As for where to put this code, the help section states. "To put the list near the bottom of the page, use the HTML Before the Finalize Button field."

Unless you have a custom cart (which we do). In this case I'm guessing we need to add it to the cart_cont.html include file.

Am I on the right track with this? Our cart looks like it doesnt use the field for inserting the "HTML Before Finalize Button"

Thanks

Tim
extragear
 
Posts: 169
Joined: Mon Apr 02, 2007 10:53 am
Location: Binghamton, NY

Re: Adding Custom Fields To Order Download

Postby Jim » Tue Sep 21, 2010 9:17 am

Yes you are on the right track. The tag(s) you would need to put in the [-- DEFINE Shipping --] section of your shopping cart template are
[-- Ship_CustomHTML n --] Insert the Custom Checkout Field where n is the number of the field you want to include.

If the fields are hidden it really won't matter where you put it as long as it is within the <form ...> </form> tags.

You can also create an if statement to see if the Custom Checkout Field feature is enabled by using the tags like this
[-- IF CustomHTML --]
[-- Ship_CustomHTML n --]
[-- END_IF --]
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 66 guests