Announcement

Collapse
No announcement yet.

Displaying Cart Details outside of Actinic?

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

    Displaying Cart Details outside of Actinic?

    Hi,

    I've got Actinic running inside an IFRAME inside a TABLE.

    I need to display the number of items and total value of the shopping cart outside of the IFRAME so that it can be seen at all times by the user.

    Is this possible?

    Any help would be greatly appreciated...

    John

    #2
    The JavaScript in the Actinic page can write to the parent as below:-

    Example page that loads the actinic index.html
    Code:
    <HTML>
    <HEAD>
       <TITLE>Test</TITLE>
    </HEAD>
    <BODY name="topwin">
    <CENTER>
    <H1>Frame Test</h1>
          <table width="100" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
               <td background="pxl_red.gif">
               <form name="infoform">
               Quantity<input name="qty" type=text width=10 value="">
               <br>
               Value<input name="val" type=text width=10 value="">
               </td>
            </tr>
          </table>
    <br>
    <iframe src="index.html" width=800 height=900>OK</iframe></CENTER>
    </BODY>
    </HTML>

    And use this modified JavaScript in the Act_Primary.html template instead of the usual cart content/value code.

    Code:
          <table width="100" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
               <td background="pxl_red.gif">
                <div align="center"> <span class="actxxsmall">
                        <script language="JavaScript">
    						document.write("NETQUOTEVAR:CARTCOOKIEITEMS&nbsp;" + getCartItem(3)+"&nbsp;<BR>");
    						document.write("NETQUOTEVAR:CARTCOOKIEVALUE&nbsp;" + getCartItem(1));
    
    			// display this in the parent form
    			var thisval = getCartItem(1);
    			thisval = thisval.replace(/&#163;/g,"£");   // fix the pound sign
    			thisval = thisval.replace(/&#44;/g,",");    // and any commas
    			thisval = thisval.replace(/&#46;/g,".");    // and the decimal point
    			parent.infoform.val.value = thisval;
    			parent.infoform.qty.value = getCartItem(3);
    
    					</script>
                  </span> </div>
               </td>
             </tr>
           </table>
    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks! I'll try that...

      Comment


        #4
        Grrr... The Forum ate some of the JavaScript above. Here it is corrected:-
        Code:
        			// display this in the parent form
        			var thisval = getCartItem(1);
        			thisval = thisval.replace(/&amp;#163;/g,"£");   // fix the pound sign
        			thisval = thisval.replace(/&amp;#44;/g,",");    // and any commas
        			thisval = thisval.replace(/&amp;#46;/g,".");    // and the decimal point
        			parent.infoform.val.value = thisval;
        			parent.infoform.qty.value = getCartItem(3);

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

        Comment


          #5
          Is there a way to display the values as plain text rather than input text boxes?

          Thanks in advance...

          Comment


            #6
            I'm sure there is but it would take me too long to work it out. I recommend JavaScript The Definitive Guide published by O'Reilly.

            You could use CSS to make the text boxes have no borders and look like the rest of your site.

            Note I just posted a small fix above.

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

            Comment


              #7
              Brochure Pages as well?

              Norman,

              Can this be applied to our brochure pages as well, inc. the home page which sits in a directory one level above the acatalog folder?

              Regards,
              David

              www.youraromatherapy.co.uk

              Comment


                #8
                I can't see why not. However you would need to add the line

                <SCRIPT LANGUAGE="JavaScript" SRC="actinicextras.js" TYPE="text/javascript"></SCRIPT>

                right after the line

                <SCRIPT LANGUAGE="JavaScript" SRC="actiniccore.js" TYPE="text/javascript"></SCRIPT>


                In your Brochure Primary templates. Usually Act_BrochurePrimary.html. In order for the cart cookie code to be available.

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

                Comment


                  #9
                  That appears to work when adding an item to the shopping cart, the items count and value shows in the test text fields, but when a link is clicked on the navigation menu, they reset to zero again... and it doesn't show at all on the home page but that might be because I've imported a html page rather than build it up using the brochure templates.

                  Any suggestions? Do I need professional help (not personally, although thats open to debate)?

                  (I've removed the test text boxes now because its a live shop)...

                  Dave

                  www.youraromatherapy.co.uk

                  Comment


                    #10
                    Your problem is because your Catalog URL is

                    http://www.youraromatherapy.co.uk/acatalog/

                    but your cgi-bin URL is on

                    http://www.your-aromatherapy.co.uk/cgi-bin/

                    These domains both need to be the same in order for the shopping cart summary to work correctly.

                    Comment


                      #11
                      Thanks Chris,

                      I'll get on to my ISP to sort the domains out, and try Norman's code again.

                      Regards,
                      David

                      Comment


                        #12
                        Changing settings

                        Chris,

                        At the moment the web site has a directory structure set up as your-aromatherapy.

                        In the network settings do I just need to change the web site url to 'youraromatherapy' (without the hyphen) and republish the site to solve this problem, or does something server side need to change, or would I need to change the directory paths as well?

                        I don't see why anything server side would need to change as both urls are mapped to the Actinic directory?

                        Regards,
                        David
                        Last edited by DavidGeran; 14-Jul-2004, 01:59 PM. Reason: Clarification

                        Comment


                          #13
                          As long as both URLs point to exactly the same place, then you can just change the values in 'Advanced | Network Setup' to use the same domain names without ill effect.

                          Comment


                            #14
                            One of those eureka moments

                            Thanks for your help Chris, that now works a treat

                            Comment

                            Working...
                            X