Announcement

Collapse
No announcement yet.

NETQUOTEVAR:PRODUCTNAME not available in Act_ProductLine.

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

    NETQUOTEVAR:PRODUCTNAME not available in Act_ProductLine.

    I've been adding some code to Act_ProductLine.html to enable customers to register an interest in products not available.

    [FONT=courier new]<td colspan=3 valign="TOP" align="RIGHT" class="addtocartline">
    <strong>NETQUOTEVAR:PRODUCTPRICE</strong><span class="actxsmall"> NETQUOTEVAR:CARTERRORXMLNETQUOTEVAR:PRODUCTQUANTITY&nbsp; &nbsp;
    <!-- if the product is Out of Stock or NYP, we want to be able to record a due... -->
    <script language="JavaScript">
    <!--
    if ( 'NETQUOTEVAR:STOCKLEVEL' == 0)
    {
    var productname = 'Record due for ' + 'NETQUOTEVAR:PRODUCTNAME';
    document.write('<font color="red">UNDER DEVELOPMENT - To be contacted when this item becomes available, fill in your e-mail address and click Submit</font>');
    document.write('<form action="/cgi-bin/form_processor.pl method="POST">');
    document.write('<input type="hidden" name="admin" value="web@liamjdavison.info">');
    document.write('<input type="hidden" name="subject" value="'+productname+'"');
    document.write('<input type="hidden" name="redirect" value="">');
    document.write('<input type="TEXT" name="01)required-email" value="@">');
    document.write('<input type="submit" name="Submit" value="Submit"></form>');
    }
    -->
    </script>

    <Actinic:ACTIONS>NETQUOTEVAR:ADDTOCARTBUTTON</Actinic:ACTIONS> </span>
    NETQUOTEVAR:TEMPLATEENDXML </td>


    But when the user clicks submit an error appears:
    A General Script Error Occurred
    Error: Could not locate the book reference.Press the Browser back button and try again or contact the site owner

    This looks like an actinic error because the error page is http://www.luath.co.uk/cgi-bin/ca000000.pl


    This is beyond my understanding. What am I doing wrong?

    Liam

    #2
    There are several coding errors but the main problem is that the Products are already inside a FORM block. You are creating a FORM within a FORM and that's not allowed.

    You could try this. Create your form within Act_Primary right after <BODY> where there's no FORM already defined (with empty hidden fields) and change your JavaScript to populate that form and then submit it.


    Here's my completely unchecked and untested idea (expect errors):-

    Code:
    In Act_Primary.Html (just after <BODY...>
    
    <form name="custform" action="/cgi-bin/form_processor.pl method="POST">
    <input type="hidden" name="admin" value="web@liamjdavison.info">
    <input type="hidden" name="subject" value="">
    <input type="hidden" name="redirect" value="">
    <input type="TEXT" name="01)required-email" value="@">
    </form>
    
    In Product Template
    
    
    <script language="JavaScript">
    <!--
    var custaddr='';
    if ( 'NETQUOTEVAR:STOCKLEVEL' == 0)
      {
      var productname = 'Record due for ' + 'NETQUOTEVAR:PRODUCTNAME';
      document.write('<font color="red">UNDER DEVELOPMENT - To be contacted when this item becomes available, fill in your e-mail address</font>');
      document.write('<input type=text name=custemail onchange="custaddr=this.value;">');
      document.write(' <input type=button value="Send" onclick="document.forms.custform.01)required-email.value=custaddr;document.forms.custform.subject.value=productname;document.forms.custform.submit();">');
      }
    // -->
    </script>
    However that hideous name for the email field "01)required-email" may need changed to something alphabetic.

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks Norman

      Gave it a try, but ended up with a big error about not being able to find certain things; I'll need to give some more thought.

      All I want is to be able to record a customer's interest in a product which isn't available for whatever reason.

      By the way, your solution and mine only appeared in products which hadn't yet become available, not those which were merely out of stock.

      Anyway, thanks again.

      Liam

      Comment


        #4
        Nothing works right first time. I didn't check my code at all so there may well be errors but I'm pretty sure the idea is OK.

        It's a good idea when debugging these things to replace all document.write bits by alert statements

        e.g.

        change

        document.write('<input type=text name=custemail onchange="custaddr=this.value;">');


        to

        alert('<input type=text name=custemail onchange="custaddr=this.value;">');


        and you'll get a box popping up showing you the generated code.

        Norman
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment

        Working...
        X