Announcement

Collapse
No announcement yet.

Selection on Checkout Page

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

    Selection on Checkout Page

    On my site, when you spend €50 you get €10 free stuff.

    When customers get to the checkout page, I want them to be able to select what pet they want the free stuff for eg Dog, Cat or Fish.

    This option should only be available if they have spent €50.

    Anyone any ideas on how to do this ??
    For Everyday Pet Products
    www.pet-bliss.com

    For Doggy Bling and Clothes
    www.poshpaws.ie

    #2
    It can be done. You'd need some JavaScript. If you go to Design / Text / Web Site (cont) Invoice Address, there's a field User Definable. Check Show, uncheck Required and set it's name to Free Gift.

    You now will have a spare text field called Free Gift on the checkout's Invoice name and address page.

    If you edit Act_Order01.html the relevant code is
    Code:
      NETQUOTEDEL:INVOICEPROMPT013 NETQUOTEDEL:INVOICEPROMPT014
      <tr>
        <td bgcolor="NETQUOTEVAR:CHECKOUTBG">NETQUOTEVAR:INVOICEPROMPT014</td>
        <td bgcolor="NETQUOTEVAR:CHECKOUTBG">
          <input type="TEXT" name="INVOICEUSERDEFINED" size="20" maxlength="255" value="NETQUOTEVAR:INVOICEUSERDEFINED">
        </td>
      </tr>
      NETQUOTEDEL:INVOICEPROMPT014 NETQUOTEDEL:INVOICEPROMPT015
    You'll need some JavaScript these that calls getCartItem(1) to return the value of the Cart, and that shows/ hides the above prompt and input field depending on the value. You can also change the <input type=text...> above to a set of

    <input type="radio" name="INVOICEUSERDEFINED" value="DOG">
    <input type="radio" name="INVOICEUSERDEFINED" value="CAT">
    <input type="radio" name="INVOICEUSERDEFINED" value="FISH">

    Here's the (untested) bit to replace the above with
    Code:
     NETQUOTEDEL:INVOICEPROMPT013 NETQUOTEDEL:INVOICEPROMPT014
      <tr>
        <td bgcolor="NETQUOTEVAR:CHECKOUTBG">NETQUOTEVAR:INVOICEPROMPT014</td>
        <td bgcolor="NETQUOTEVAR:CHECKOUTBG">
        <script language=JavaScript>
        <!--
        var bits = getCartItem(1).match(/(\d*&#38;#46;\d\d)/);		// deal with multi-currency (look for 1st number only)
        var val = bits[1].replace(/&#38;#46;/,".");			// restore decimal point
        if ( val > 50 ) // price in pounds here
          {
           document.write('Dog<input checked type="radio" name="INVOICEUSERDEFINED" value="DOG"> ');
           document.write('Cat<input type="radio" name="INVOICEUSERDEFINED" value="CAT"> ');
           document.write('Fish<input type="radio" name="INVOICEUSERDEFINED" value="FISH"> ');
          }
        else
          {
           document.write('N/A if order below £50.00');
          }
        //-->
        </script>
        </td>
      </tr>
      NETQUOTEDEL:INVOICEPROMPT014 NETQUOTEDEL:INVOICEPROMPT015
    I'm not sure if getCartItem(1) returns the inc VAT and Inc carriage amount. You'll have to experiment (it's the value shown in the summary on every shopping page).
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      I just tested (and amended the above) it works fine now. The info appears on the Customer tab on the order.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        I had to amend it to work if you had more than one currency displayed. All OK now.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Hi Norman,

          That worked excellently for what I wanted to do as well.

          Thank you very much!!!!

          Neil

          Comment

          Working...
          X