Announcement

Collapse
No announcement yet.

Product choice

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Product choice

    http://www.scottishgifts4u.co.uk/aca...TTIE_DOGS.html

    We have products with 2500 options !!, is it possible to put in a box where the customer can simply type in their own option?

    Failing this (or it is too complicated to do) is there an easier way to insert the options into a drop down box than by typing them in individually?...obviously we will then limit the choice to the most popular,
    Scottish Gifts 4U - quality gifts from Scotland

    #2
    Since you're nearly a neighbour, here's how to use the Other Info Prompt to collect the tartan name from an automatically created drop-down list. Or the customer can simply type it in.

    This list is held in a separate file so you only need to create it once and it will be automatically displayed on the products that require it.

    See the attached file for an example.

    Installation:

    Make a file called alltartans.js from the following code and save it in your Site folder.
    Code:
    var alltartans=["Choose a tartan ...",
    "Mackay",
    "Maclean",
    "Macduff",
    ""];
    function TartanOptions(){
      for(var i=0; i<alltartans.length-1; i++)
        {
        document.write('<option value="' + i + '">' + alltartans[i] + '</option>');
        }
    }
    function CopyOptionToInfo(sel, pid){
      document.getElementById('O_' + pid).value=sel.options[sel.selectedIndex].text;
    }
    You will want to extend the above code to contain a line for each tartan.

    Just above the </head> line in your overall layout add the line:
    Code:
    <script type="text/javascript" src="alltartans.js"></script>
    In your Product Layout(s), replace the lines:
    Code:
                <span class="actrequired"><Actinic:Variable Name="OtherInfoPrompt"/></span><br />
                <input type="text" name="O_<actinic:variable Name="ProductID"/>" size="40" maxlength="1000" value="" />
    with
    Code:
            <actinic:block if="%3cactinic%3avariable%20name%3d%22OtherInfoPrompt%22%20%2f%3e%20%21%3d%20%22Choose%20a%20tartan%22" >
                <span class="actrequired"><Actinic:Variable Name="OtherInfoPrompt"/></span><br />
                <input type="text" name="O_<actinic:variable Name="ProductID"/>" size="40" maxlength="1000" value="" />
            </actinic:block>
            <actinic:block if="%3cactinic%3avariable%20name%3d%22OtherInfoPrompt%22%20%2f%3e%20%3d%3d%20%22Choose%20a%20tartan%22" >
                <span class="actrequired">Type in your chosen tartan or select it from the drop-down list</span><br />
                <input type="text" id="O_<actinic:variable Name="ProductID"/>" name="O_<actinic:variable Name="ProductID"/>" size="20" maxlength="1000" value="" />
                <select onchange="CopyOptionToInfo(this,'<actinic:variable name="ProductID" />');">
                    <script type="text/javascript">TartanOptions();</script>
                </select>
            </actinic:block>
    Operation:

    If you set the Other Info prompt to "Choose a tartan" then the huge list is automatically generated.
    The customer can either type in a tartan or select it from the drop-down list.

    If you set the Other Info prompt to anything but "Choose a tartan" then Other Info operates as usual.
    Attached Files
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment

    Working...
    X