freeopt doesn't work

General ShopSite user discussion

freeopt doesn't work

Postby iTal » Mon Jun 28, 2010 4:21 pm

Hi,

I need to allow customers to add free text before they order a product. I have read in a few posts on the forum that I should use free opt.

Here is what I've put on my page: <textarea name="43:freeopt" rows="1" cols="40"></textarea>.
But I just hard-coded it. Obviously, since it didn't work, I assume I had to do something else to make it work. Could anyone tell me how to do it right? What are the steps I should take in order to add a free text field to my order form?

Many thanks.
iTal
 
Posts: 18
Joined: Mon May 03, 2010 10:22 am
Location: Vancouver, BC, Canada

Postby Jim » Mon Jun 28, 2010 4:43 pm

See the online help http://www.shopsite.com/help/10.0/en-US ... oduct.html

Code: Select all
[-- PRODUCT.OptionsBox --]
    Returns checked if a customer text entry box for this product is to be displayed on the order form. You can also use this tag in an [-- IF --] tag to create a text area on a custom page to collect information from customers, and then pass the input to the order form. You must use an HTML form for the order options and [Add to Cart] button to do this, and you must use "freeopt" as the name of the text area, like this:

    <form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
      <input type=hidden name=storeid value=[-- STORE_ID --]>
      <input type=hidden name=dbname value=products>
      <input type=hidden name=function value=add>
      <input type=hidden name=itemnum value=[-- PRODUCT.RecordNumber --]>
      [-- IF PRODUCT.DisplayOrderingOptions --]
        <br>[-- PRODUCT.OptionText --]
        [-- ORDER_OPTION_MENU LINE --]
      [-- END_IF --]
     
      [-- IF PRODUCT.OptionsBox --]
        <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"> </textarea>
      [-- END_IF --]
     
      <input type=image src="[-- OUTPUT_DIRECTORY_URL --]/media/button_add.gif" border=0 name="Add to Cart" alt="Add to Cart">
    </form>

Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby iTal » Tue Jun 29, 2010 2:59 pm

Hi Jim,

Thank you for your response.

I forgot to mention that I don't use templates. I use the "order Anywhere" option. So is it possible to add a free form textbox to the generated code and how do I notify the shopping cart that there is another field to pass on?
iTal
 
Posts: 18
Joined: Mon May 03, 2010 10:22 am
Location: Vancouver, BC, Canada

Postby loren_d_c » Tue Jun 29, 2010 3:02 pm

Yes, it's possible, but you will have to manually add the <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"> </textarea> form field to the Add To Cart form code that you get from OrderAnywhere. Of course since you are not using a template, you will yourself replace the [-- PRODUCT.Recordnumber --] with whatever the itemnum form field's value is in the product's OrderAnywhere form code.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby iTal » Tue Jun 29, 2010 3:08 pm

Hi Loren,

Thanks for the quick response. I tried to do what you suggested but when I tested it, the value I entered to the textbox didn't get through to the cart. Therefore, I assumed that I need to do one more step to make it work. What should I do to make the cart get the value I put in this textbox?

Thanks for your help
iTal
 
Posts: 18
Joined: Mon May 03, 2010 10:22 am
Location: Vancouver, BC, Canada

Postby loren_d_c » Tue Jun 29, 2010 3:12 pm

Do you have the 'Customer Text Entry' checkbox checked for the product in its Edit Product Info menu? If this isn't checked, the value sent to the cart will just be ignored.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby iTal » Tue Jun 29, 2010 3:27 pm

Ahhhh!

That did the trick. I guess I forgot about it. One more question - Is it possible to place more than one free text textbox in an order form?
iTal
 
Posts: 18
Joined: Mon May 03, 2010 10:22 am
Location: Vancouver, BC, Canada

Postby loren_d_c » Tue Jun 29, 2010 3:39 pm

Sure, it is possible, but they must have the same form field name, and the info from the multiple boxes will be combined together into the one box when it gets to the cart.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere


Return to User Forum

Who is online

Users browsing this forum: No registered users and 102 guests