Announcement

Collapse
No announcement yet.

Give a unique number to each item purchased...?

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

    Give a unique number to each item purchased...?

    Can anyone help with this....?

    I want to be able to sell tickets on a web site - but let Actinic handle the generation of unique ticket numbers. I could use the order number if each person were only allowed to buy one ticket per transaction, but I want shoppers to be able to buy multiple tickets.

    For example, you could buy three tickets, and your order confirmation lists three unique ticket numbers which has been automatically generated by Actinic.

    What are the chances....?

    #2
    Hi,

    This isn't something that Actinic will do out of the box and I don't know of any plug-ins I'm afraid.
    ********************
    Tracey
    SellerDeck

    Comment


      #3
      If you're not using the other info prompt on these these products then it may be possible to auto-create a random number and populate that field with it.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Here's how to do the above.

        Go to Design / Library / Layouts / Products, right-click your usual product layout and choose Copy.

        Rename that copy to something like "Numbered Ticket Layout".

        Double-click Numbered Ticket Layout to edit it.

        Replace the line:
        Code:
              <form method="post" action="<actinic:variable name="OnlineScriptURL" value="Shopping Cart Script URL" />">
        with
        Code:
              <form method="post" action="<actinic:variable name="OnlineScriptURL" value="Shopping Cart Script URL" />"
        			onsubmit="document.getElementById('O_<actinic:variable name="ProductID" />').value=Math.ceil((1+Math.random())*100000000);return true;"
        		>
        Replace the lines:
        Code:
                 <actinic:block if="%3cactinic%3avariable%20name%3d%22IsOtherInfoPromptShown%22%20%2f%3e">
                    <br />
                    <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>
        with
        Code:
                 <actinic:block if="%3cactinic%3avariable%20name%3d%22IsOtherInfoPromptShown%22%20%2f%3e">
                    <input type="hidden" id="O_<actinic:variable Name="ProductID"/>" name="O_<actinic:variable Name="ProductID"/>" value="" />
                 </actinic:block>
        Use this layout for ticket products and in Product Details / Prompts, set the Other Info prompt to "Ticket no".

        That's it.

        You will find that the ticket number can be adjusted in the Cart. If you want to prevent this (it will stop all Other Info's being editable in the Cart), edit ActincOrder.pm.

        Look for:
        Code:
        $sHTML = ACTINIC::GetPhrase(-1, 2161, "", $sIndex, 35, 1000, $sValue, $sStyle);
        replace with
        Code:
        $sHTML = "<input type=text readonly size=\"20\" name=\"$sIndex\" value=\"$sValue\"/>";
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment

        Working...
        X