Custom Order API
-
- Posts: 17
- Joined: Fri Jan 16, 2009 11:16 am
Custom Order API
Is it possible to pass data into the shopping cart and retrieve it with the custom order API?
-
- Site Admin
- Posts: 4953
- Joined: Fri Aug 04, 2006 1:42 pm
- Location: Utah
What type of information do you mean? A list of the fields that are available to Order API can be found at
http://shopsite.com/help/10.0/en-US/sc/ ... .spec.html
If the info isn't in one of those fields then it isn't possible to pass it.
http://shopsite.com/help/10.0/en-US/sc/ ... .spec.html
If the info isn't in one of those fields then it isn't possible to pass it.
-
- Posts: 2572
- Joined: Fri Aug 04, 2006 12:02 pm
- Location: Anywhere
- Contact:
If it's arbitrary info that you don't need to actually be in the shopping cart or in the resulting order, then you could set it in a cookie before the shopper gets to the cart, and then from your custom Order API you can read the cookies in the shopper's browser (assuming the cookie is set from the same domain as the secure shopping cart URL), and capture the information that way.
-Loren
-Loren
-
- Posts: 17
- Joined: Fri Jan 16, 2009 11:16 am
I decided to set up a "Customer Text Entry Box" field for the specific product. I noticed there were "Special Rules" to verify for the drop-down options. Is it possible to do this for the text entry box as well? I need a field that will require a customer to enter a certain amount of characters and will error out if the field is empty.
-
- Site Admin
- Posts: 4953
- Joined: Fri Aug 04, 2006 1:42 pm
- Location: Utah
There is nothing built in to the text field that would require data input. You could probably write some javascript that would check for content and not let them proceed if it is blank. But that would require the shopper to have javascript enabled and that you know javascript well (or someone that knows javascript well).
-
- Posts: 17
- Joined: Fri Jan 16, 2009 11:16 am
I've found how to edit the CheckIt js function, which is what I was looking for. The problem I'm running into now is I need a way to access the "Customer Text Entry Box" data for verification. There is a js variable for the drop-down order options, but from what I can see there is not a variable for the text box. Any suggestions? Thanks for the help.
-
- Posts: 2572
- Joined: Fri Aug 04, 2006 12:02 pm
- Location: Anywhere
- Contact:
Brett,
In JavaScript any form field value can be accessed in the variable format:
document.[form_name].[field_name].value
So for example if you are on the Checkout screen where the form name is 'billing' and via your JavaScript you are checking the value of a Custom Checkout Field whose form field name is field01, then it would be:
document.billing.field01.value
-Loren
In JavaScript any form field value can be accessed in the variable format:
document.[form_name].[field_name].value
So for example if you are on the Checkout screen where the form name is 'billing' and via your JavaScript you are checking the value of a Custom Checkout Field whose form field name is field01, then it would be:
document.billing.field01.value
-Loren