Announcement

Collapse
No announcement yet.

How can I prompt the buyer for more than one 'Other Info' field?

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

    How can I prompt the buyer for more than one 'Other Info' field?

    It is possible to split the 'Other Information' field in the shopping cart and on the confirmation page into two different fields. This allows your customers to provide much more detailed information with a product. Furthermore, it is possible to only have the extra field created just for specific products, based on the product reference of the product.

    In order to do this, you need to open the file called 'ActinicOrder.pm'. When you have the file open, do a search for

    sub InfoHTMLGenerate

    This will bring you into a subroutine within ActinicOrder.pm that controls this functionality.

    Look for the following code under where it says 'CUSTOMISATION BEGIN' code:

    if ($sProdref eq "5")
    {
    my @aValues = split /\|\|\|/, $sValue;
    if ($bStatic)
    {
    $sHTML = join "<BR>", @aValues;
    }
    else
    {
    $sHTML = "<INPUT TYPE=TEXT SIZE=\"80\" NAME=\"O_1_$nIndex\" VALUE=\"" . $aValues[0] . "\"><BR>";
    $sHTML .= "<INPUT TYPE=TEXT SIZE=\"80\" NAME=\"O_2_$nIndex\" VALUE=\"" . $aValues[1] . "\">";
    }
    }

    Note the word wrap that has occurred on the 11th and 12th line in the code above. These should be long lines without line breaks.

    You will see that this code is all preceded with hashes '#'. These comment out the lines and prevent them from being active. In order to make the lines active, remove the '#'s.

    Change the if ($sProdref eq "5") line to reflect the product reference of the product that you want to use the extra fields. For instance, if you wanted the extra field on a product with a reference of 'b16' then change the line to read

    if ($sProdref eq "b16").

    You then need to go down to 'sub InfoGetValue' and remove the '#'s from the custom code there, again changing the if ($sProdref eq "5") line as necessary.

    Finally, if you want any specific validation done on the entries in the two fields, you need to go down to 'sub InfoValidate' and uncomment and adjust the code in there. The sample code there will flash up a warning message if the number of characters in either field does not exceed '5'.

    Once you have made the required changes you can save the file and upload your store.

    Disclaimer: This code was provided by an SellerDeck user via the SellerDeck Community (http://community.sellerdeck.com/) and so can't be supported by the SellerDeck Technical Support team. If you find that there is a problem, an original copy of the script can be found within the 'Original' folder in your installation. Copy this into your site folder.
Working...
X